diff options
-rw-r--r-- | Documentation/hwmon/it87 | 8 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 51 |
2 files changed, 15 insertions, 44 deletions
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index 0d0195040d88..7f42e441c645 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -4,18 +4,18 @@ Kernel driver it87 | |||
4 | Supported chips: | 4 | Supported chips: |
5 | * IT8705F | 5 | * IT8705F |
6 | Prefix: 'it87' | 6 | Prefix: 'it87' |
7 | Addresses scanned: from Super I/O config space, or default ISA 0x290 (8 I/O ports) | 7 | Addresses scanned: from Super I/O config space (8 I/O ports) |
8 | Datasheet: Publicly available at the ITE website | 8 | Datasheet: Publicly available at the ITE website |
9 | http://www.ite.com.tw/ | 9 | http://www.ite.com.tw/ |
10 | * IT8712F | 10 | * IT8712F |
11 | Prefix: 'it8712' | 11 | Prefix: 'it8712' |
12 | Addresses scanned: I2C 0x28 - 0x2f | 12 | Addresses scanned: I2C 0x28 - 0x2f |
13 | from Super I/O config space, or default ISA 0x290 (8 I/O ports) | 13 | from Super I/O config space (8 I/O ports) |
14 | Datasheet: Publicly available at the ITE website | 14 | Datasheet: Publicly available at the ITE website |
15 | http://www.ite.com.tw/ | 15 | http://www.ite.com.tw/ |
16 | * SiS950 [clone of IT8705F] | 16 | * SiS950 [clone of IT8705F] |
17 | Prefix: 'sis950' | 17 | Prefix: 'it87' |
18 | Addresses scanned: from Super I/O config space, or default ISA 0x290 (8 I/O ports) | 18 | Addresses scanned: from Super I/O config space (8 I/O ports) |
19 | Datasheet: No longer be available | 19 | Datasheet: No longer be available |
20 | 20 | ||
21 | Author: Christophe Gauthron <chrisg@0-in.com> | 21 | Author: Christophe Gauthron <chrisg@0-in.com> |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 53cc2b6d6385..55e1c835a046 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -2,7 +2,7 @@ | |||
2 | it87.c - Part of lm_sensors, Linux kernel modules for hardware | 2 | it87.c - Part of lm_sensors, Linux kernel modules for hardware |
3 | monitoring. | 3 | monitoring. |
4 | 4 | ||
5 | Supports: IT8705F Super I/O chip w/LPC interface & SMBus | 5 | Supports: IT8705F Super I/O chip w/LPC interface |
6 | IT8712F Super I/O chip w/LPC interface & SMBus | 6 | IT8712F Super I/O chip w/LPC interface & SMBus |
7 | Sis950 A clone of the IT8705F | 7 | Sis950 A clone of the IT8705F |
8 | 8 | ||
@@ -47,7 +47,7 @@ | |||
47 | /* Addresses to scan */ | 47 | /* Addresses to scan */ |
48 | static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, | 48 | static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, |
49 | 0x2e, 0x2f, I2C_CLIENT_END }; | 49 | 0x2e, 0x2f, I2C_CLIENT_END }; |
50 | static unsigned short isa_address = 0x290; | 50 | static unsigned short isa_address; |
51 | 51 | ||
52 | /* Insmod parameters */ | 52 | /* Insmod parameters */ |
53 | I2C_CLIENT_INSMOD_2(it87, it8712); | 53 | I2C_CLIENT_INSMOD_2(it87, it8712); |
@@ -706,7 +706,7 @@ static int it87_isa_attach_adapter(struct i2c_adapter *adapter) | |||
706 | } | 706 | } |
707 | 707 | ||
708 | /* SuperIO detection - will change isa_address if a chip is found */ | 708 | /* SuperIO detection - will change isa_address if a chip is found */ |
709 | static int __init it87_find(int *address) | 709 | static int __init it87_find(unsigned short *address) |
710 | { | 710 | { |
711 | int err = -ENODEV; | 711 | int err = -ENODEV; |
712 | 712 | ||
@@ -757,34 +757,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) | |||
757 | if (!request_region(address, IT87_EXTENT, it87_isa_driver.name)) | 757 | if (!request_region(address, IT87_EXTENT, it87_isa_driver.name)) |
758 | goto ERROR0; | 758 | goto ERROR0; |
759 | 759 | ||
760 | /* Probe whether there is anything available on this address. Already | 760 | /* For now, we presume we have a valid client. We create the |
761 | done for SMBus and Super-I/O clients */ | ||
762 | if (kind < 0) { | ||
763 | if (is_isa && !chip_type) { | ||
764 | #define REALLY_SLOW_IO | ||
765 | /* We need the timeouts for at least some IT87-like chips. But only | ||
766 | if we read 'undefined' registers. */ | ||
767 | i = inb_p(address + 1); | ||
768 | if (inb_p(address + 2) != i | ||
769 | || inb_p(address + 3) != i | ||
770 | || inb_p(address + 7) != i) { | ||
771 | err = -ENODEV; | ||
772 | goto ERROR1; | ||
773 | } | ||
774 | #undef REALLY_SLOW_IO | ||
775 | |||
776 | /* Let's just hope nothing breaks here */ | ||
777 | i = inb_p(address + 5) & 0x7f; | ||
778 | outb_p(~i & 0x7f, address + 5); | ||
779 | if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) { | ||
780 | outb_p(i, address + 5); | ||
781 | err = -ENODEV; | ||
782 | goto ERROR1; | ||
783 | } | ||
784 | } | ||
785 | } | ||
786 | |||
787 | /* OK. For now, we presume we have a valid client. We now create the | ||
788 | client structure, even though we cannot fill it completely yet. | 761 | client structure, even though we cannot fill it completely yet. |
789 | But it allows us to access it87_{read,write}_value. */ | 762 | But it allows us to access it87_{read,write}_value. */ |
790 | 763 | ||
@@ -1182,20 +1155,18 @@ static struct it87_data *it87_update_device(struct device *dev) | |||
1182 | 1155 | ||
1183 | static int __init sm_it87_init(void) | 1156 | static int __init sm_it87_init(void) |
1184 | { | 1157 | { |
1185 | int addr, res; | 1158 | int res; |
1186 | |||
1187 | if (!it87_find(&addr)) { | ||
1188 | isa_address = addr; | ||
1189 | } | ||
1190 | 1159 | ||
1191 | res = i2c_add_driver(&it87_driver); | 1160 | res = i2c_add_driver(&it87_driver); |
1192 | if (res) | 1161 | if (res) |
1193 | return res; | 1162 | return res; |
1194 | 1163 | ||
1195 | res = i2c_isa_add_driver(&it87_isa_driver); | 1164 | if (!it87_find(&isa_address)) { |
1196 | if (res) { | 1165 | res = i2c_isa_add_driver(&it87_isa_driver); |
1197 | i2c_del_driver(&it87_driver); | 1166 | if (res) { |
1198 | return res; | 1167 | i2c_del_driver(&it87_driver); |
1168 | return res; | ||
1169 | } | ||
1199 | } | 1170 | } |
1200 | 1171 | ||
1201 | return 0; | 1172 | return 0; |