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/sis5595.c | |
parent | 5042c7d752fe72c6924037058367f63902e68c5c (diff) | |
download | op-kernel-dev-2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0.zip op-kernel-dev-2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0.tar.gz |
[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/sis5595.c')
-rw-r--r-- | drivers/hwmon/sis5595.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index e5db835..6724629 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -71,14 +71,10 @@ module_param(force_addr, ushort, 0); MODULE_PARM_DESC(force_addr, "Initialize the base address of the sensors"); -/* Addresses to scan. +/* Device address Note that we can't determine the ISA address until we have initialized our module */ -static unsigned short normal_i2c[] = { I2C_CLIENT_END }; -static unsigned int normal_isa[] = { 0x0000, I2C_CLIENT_ISA_END }; - -/* Insmod parameters */ -SENSORS_INSMOD_1(sis5595); +static unsigned short address; /* Many SIS5595 constants specified below */ @@ -194,8 +190,7 @@ struct sis5595_data { static struct pci_dev *s_bridge; /* pointer to the (only) sis5595 */ -static int sis5595_attach_adapter(struct i2c_adapter *adapter); -static int sis5595_detect(struct i2c_adapter *adapter, int address, int kind); +static int sis5595_detect(struct i2c_adapter *adapter); static int sis5595_detach_client(struct i2c_client *client); static int sis5595_read_value(struct i2c_client *client, u8 register); @@ -206,9 +201,7 @@ static void sis5595_init_client(struct i2c_client *client); static struct i2c_driver sis5595_driver = { .owner = THIS_MODULE, .name = "sis5595", - .id = I2C_DRIVERID_SIS5595, - .flags = I2C_DF_NOTIFY, - .attach_adapter = sis5595_attach_adapter, + .attach_adapter = sis5595_detect, .detach_client = sis5595_detach_client, }; @@ -480,14 +473,7 @@ static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, ch static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); /* This is called when the module is loaded */ -static int sis5595_attach_adapter(struct i2c_adapter *adapter) -{ - if (!(adapter->class & I2C_CLASS_HWMON)) - return 0; - return i2c_detect(adapter, &addr_data, sis5595_detect); -} - -int sis5595_detect(struct i2c_adapter *adapter, int address, int kind) +static int sis5595_detect(struct i2c_adapter *adapter) { int err = 0; int i; @@ -496,10 +482,6 @@ int sis5595_detect(struct i2c_adapter *adapter, int address, int kind) char val; u16 a; - /* Make sure we are probing the ISA bus!! */ - if (!i2c_is_isa_adapter(adapter)) - goto exit; - if (force_addr) address = force_addr & ~(SIS5595_EXTENT - 1); /* Reserve the ISA region */ @@ -642,8 +624,7 @@ static int sis5595_detach_client(struct i2c_client *client) return err; } - if (i2c_is_isa_client(client)) - release_region(client->addr, SIS5595_EXTENT); + release_region(client->addr, SIS5595_EXTENT); kfree(data); @@ -760,7 +741,6 @@ static int __devinit sis5595_pci_probe(struct pci_dev *dev, { u16 val; int *i; - int addr = 0; for (i = blacklist; *i != 0; i++) { struct pci_dev *dev; @@ -776,19 +756,16 @@ static int __devinit sis5595_pci_probe(struct pci_dev *dev, pci_read_config_word(dev, SIS5595_BASE_REG, &val)) return -ENODEV; - addr = val & ~(SIS5595_EXTENT - 1); - if (addr == 0 && force_addr == 0) { + address = val & ~(SIS5595_EXTENT - 1); + if (address == 0 && force_addr == 0) { dev_err(&dev->dev, "Base address not set - upgrade BIOS or use force_addr=0xaddr\n"); return -ENODEV; } - if (force_addr) - addr = force_addr; /* so detect will get called */ - if (!addr) { + if (!address) { dev_err(&dev->dev,"No SiS 5595 sensors found.\n"); return -ENODEV; } - normal_isa[0] = addr; s_bridge = pci_dev_get(dev); if (i2c_isa_add_driver(&sis5595_driver)) { |