diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-07-19 23:56:35 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 09:14:10 -0700 |
commit | 2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0 (patch) | |
tree | f01f038198bad63fee4c7d23af806ad0ab4e5071 /drivers/hwmon/pc87360.c | |
parent | 5042c7d752fe72c6924037058367f63902e68c5c (diff) | |
download | talos-obmc-linux-2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0.tar.gz talos-obmc-linux-2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0.zip |
[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (5/9)
Call the ISA chip drivers detection function directly instead of relying
on i2c_detect. The net effect is that address lists won't be handled
anymore, but they were mostly useless in the ISA case anyway (pc87360,
smsc47m1, smsc47b397 had already dropped them).
We don't need to handle multiple devices, all we may need is a way to
force a given address instead of the original one (some drivers already
do: sis5595, via686a, w83627hf), and, for drivers supporting multiple
chips, a way to force one given kind. All this may be added later on
demand, but I actually don't think there will be much demand.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/pc87360.c')
-rw-r--r-- | drivers/hwmon/pc87360.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c index 97ffe5b5cf83..4041488de6f1 100644 --- a/drivers/hwmon/pc87360.c +++ b/drivers/hwmon/pc87360.c @@ -39,25 +39,17 @@ #include <linux/jiffies.h> #include <linux/i2c.h> #include <linux/i2c-isa.h> -#include <linux/i2c-sensor.h> #include <linux/i2c-vid.h> #include <linux/hwmon.h> #include <linux/err.h> #include <asm/io.h> -static unsigned short normal_i2c[] = { I2C_CLIENT_END }; -static unsigned int normal_isa[] = { 0, I2C_CLIENT_ISA_END }; -static struct i2c_force_data forces[] = {{ NULL }}; static u8 devid; -static unsigned int extra_isa[3]; +static unsigned short address; +static unsigned short extra_isa[3]; static u8 confreg[4]; enum chips { any_chip, pc87360, pc87363, pc87364, pc87365, pc87366 }; -static struct i2c_address_data addr_data = { - .normal_i2c = normal_i2c, - .normal_isa = normal_isa, - .forces = forces, -}; static int init = 1; module_param(init, int, 0); @@ -228,8 +220,7 @@ struct pc87360_data { * Functions declaration */ -static int pc87360_attach_adapter(struct i2c_adapter *adapter); -static int pc87360_detect(struct i2c_adapter *adapter, int address, int kind); +static int pc87360_detect(struct i2c_adapter *adapter); static int pc87360_detach_client(struct i2c_client *client); static int pc87360_read_value(struct pc87360_data *data, u8 ldi, u8 bank, @@ -246,8 +237,7 @@ static struct pc87360_data *pc87360_update_device(struct device *dev); static struct i2c_driver pc87360_driver = { .owner = THIS_MODULE, .name = "pc87360", - .flags = I2C_DF_NOTIFY, - .attach_adapter = pc87360_attach_adapter, + .attach_adapter = pc87360_detect, .detach_client = pc87360_detach_client, }; @@ -636,12 +626,7 @@ static DEVICE_ATTR(alarms_temp, S_IRUGO, show_temp_alarms, NULL); * Device detection, registration and update */ -static int pc87360_attach_adapter(struct i2c_adapter *adapter) -{ - return i2c_detect(adapter, &addr_data, pc87360_detect); -} - -static int pc87360_find(int sioaddr, u8 *devid, int *address) +static int pc87360_find(int sioaddr, u8 *devid, unsigned short *addresses) { u16 val; int i; @@ -687,7 +672,7 @@ static int pc87360_find(int sioaddr, u8 *devid, int *address) continue; } - address[i] = val; + addresses[i] = val; if (i==0) { /* Fans */ confreg[0] = superio_inb(sioaddr, 0xF0); @@ -731,9 +716,7 @@ static int pc87360_find(int sioaddr, u8 *devid, int *address) return 0; } -/* We don't really care about the address. - Read from extra_isa instead. */ -int pc87360_detect(struct i2c_adapter *adapter, int address, int kind) +static int pc87360_detect(struct i2c_adapter *adapter) { int i; struct i2c_client *new_client; @@ -742,9 +725,6 @@ int pc87360_detect(struct i2c_adapter *adapter, int address, int kind) const char *name = "pc87360"; int use_thermistors = 0; - if (!i2c_is_isa_adapter(adapter)) - return -ENODEV; - if (!(data = kmalloc(sizeof(struct pc87360_data), GFP_KERNEL))) return -ENOMEM; memset(data, 0x00, sizeof(struct pc87360_data)); @@ -1334,12 +1314,12 @@ static int __init pc87360_init(void) /* Arbitrarily pick one of the addresses */ for (i = 0; i < 3; i++) { if (extra_isa[i] != 0x0000) { - normal_isa[0] = extra_isa[i]; + address = extra_isa[i]; break; } } - if (normal_isa[0] == 0x0000) { + if (address == 0x0000) { printk(KERN_WARNING "pc87360: No active logical device, " "module not inserted.\n"); return -ENODEV; |