diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-07-19 17:51:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:14:09 -0400 |
commit | fde0950903ce8cc38a91dd095280decceda2ff82 (patch) | |
tree | 5a970459793ac46ad7082f0d722616730b0589c2 /drivers/hwmon/it87.c | |
parent | 400c455eaa0d0819d18cd42a74070e0e238a73dc (diff) |
[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9)
Convert the 10 ISA hardware monitoring drivers (it87, lm78, pc87360,
sis5595, smsc47b397, smsc47m1, via686a, w83627hf, w83627ehf, w83781d) to
explicitely register with i2c-isa. For hybrid drivers (it87, lm78,
w83781d), we now have two separate instances of i2c_driver, one for the
I2C interface of the chip, and one for ISA interface. In the long run,
the one for ISA will be replaced with a different driver type.
At this point, all drivers are working again, except for missing
dependencies in Kconfig.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r-- | drivers/hwmon/it87.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 92c5b2420f9b..a438adb4b09f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/jiffies.h> | 37 | #include <linux/jiffies.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | #include <linux/i2c-isa.h> | ||
39 | #include <linux/i2c-sensor.h> | 40 | #include <linux/i2c-sensor.h> |
40 | #include <linux/i2c-vid.h> | 41 | #include <linux/i2c-vid.h> |
41 | #include <linux/hwmon-sysfs.h> | 42 | #include <linux/hwmon-sysfs.h> |
@@ -242,6 +243,14 @@ static struct i2c_driver it87_driver = { | |||
242 | .detach_client = it87_detach_client, | 243 | .detach_client = it87_detach_client, |
243 | }; | 244 | }; |
244 | 245 | ||
246 | static struct i2c_driver it87_isa_driver = { | ||
247 | .owner = THIS_MODULE, | ||
248 | .name = "it87-isa", | ||
249 | .attach_adapter = it87_attach_adapter, | ||
250 | .detach_client = it87_detach_client, | ||
251 | }; | ||
252 | |||
253 | |||
245 | static ssize_t show_in(struct device *dev, struct device_attribute *attr, | 254 | static ssize_t show_in(struct device *dev, struct device_attribute *attr, |
246 | char *buf) | 255 | char *buf) |
247 | { | 256 | { |
@@ -741,7 +750,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) | |||
741 | 750 | ||
742 | /* Reserve the ISA region */ | 751 | /* Reserve the ISA region */ |
743 | if (is_isa) | 752 | if (is_isa) |
744 | if (!request_region(address, IT87_EXTENT, it87_driver.name)) | 753 | if (!request_region(address, IT87_EXTENT, it87_isa_driver.name)) |
745 | goto ERROR0; | 754 | goto ERROR0; |
746 | 755 | ||
747 | /* Probe whether there is anything available on this address. Already | 756 | /* Probe whether there is anything available on this address. Already |
@@ -787,7 +796,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) | |||
787 | i2c_set_clientdata(new_client, data); | 796 | i2c_set_clientdata(new_client, data); |
788 | new_client->addr = address; | 797 | new_client->addr = address; |
789 | new_client->adapter = adapter; | 798 | new_client->adapter = adapter; |
790 | new_client->driver = &it87_driver; | 799 | new_client->driver = is_isa ? &it87_isa_driver : &it87_driver; |
791 | new_client->flags = 0; | 800 | new_client->flags = 0; |
792 | 801 | ||
793 | /* Now, we do the remaining detection. */ | 802 | /* Now, we do the remaining detection. */ |
@@ -1172,16 +1181,28 @@ static struct it87_data *it87_update_device(struct device *dev) | |||
1172 | 1181 | ||
1173 | static int __init sm_it87_init(void) | 1182 | static int __init sm_it87_init(void) |
1174 | { | 1183 | { |
1175 | int addr; | 1184 | int addr, res; |
1176 | 1185 | ||
1177 | if (!it87_find(&addr)) { | 1186 | if (!it87_find(&addr)) { |
1178 | normal_isa[0] = addr; | 1187 | normal_isa[0] = addr; |
1179 | } | 1188 | } |
1180 | return i2c_add_driver(&it87_driver); | 1189 | |
1190 | res = i2c_add_driver(&it87_driver); | ||
1191 | if (res) | ||
1192 | return res; | ||
1193 | |||
1194 | res = i2c_isa_add_driver(&it87_isa_driver); | ||
1195 | if (res) { | ||
1196 | i2c_del_driver(&it87_driver); | ||
1197 | return res; | ||
1198 | } | ||
1199 | |||
1200 | return 0; | ||
1181 | } | 1201 | } |
1182 | 1202 | ||
1183 | static void __exit sm_it87_exit(void) | 1203 | static void __exit sm_it87_exit(void) |
1184 | { | 1204 | { |
1205 | i2c_isa_del_driver(&it87_isa_driver); | ||
1185 | i2c_del_driver(&it87_driver); | 1206 | i2c_del_driver(&it87_driver); |
1186 | } | 1207 | } |
1187 | 1208 | ||