aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-18 20:52:27 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-18 20:52:27 -0400
commit64d9a39ec9ad074384b548c0cead89265c82e166 (patch)
tree5c0cdd72f41584d33e76e4a3c08eeb1960a0b5c7
parent17e6c600b2bc4f15dd5f9144ccb8b5c5211dd6e4 (diff)
parentbd452e6f178a559408c54c2b4ca29191b812d47f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/hwmon-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/hwmon-2.6: hwmon: Fix debug messages in w83781d hwmon: Let w83781d and lm78 load again w83627ehf: Fix the detection of fan5 k8temp: Documentation update smsc47m1: List the SMSC LPC47M112 as supported hwmon: Fix documentation typos adm9240: Update Grant Coady's email address w83791d: Fix unchecked return status
-rw-r--r--Documentation/hwmon/adm92402
-rw-r--r--Documentation/hwmon/f71805f2
-rw-r--r--Documentation/hwmon/k8temp13
-rw-r--r--Documentation/hwmon/smsc47m14
-rw-r--r--Documentation/hwmon/w83627ehf6
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/hwmon/Kconfig10
-rw-r--r--drivers/hwmon/adm9240.c4
-rw-r--r--drivers/hwmon/lm78.c12
-rw-r--r--drivers/hwmon/smsc47m1.c11
-rw-r--r--drivers/hwmon/w83627ehf.c11
-rw-r--r--drivers/hwmon/w83781d.c30
-rw-r--r--drivers/hwmon/w83791d.c85
-rw-r--r--drivers/i2c/busses/i2c-isa.c2
14 files changed, 124 insertions, 74 deletions
diff --git a/Documentation/hwmon/adm9240 b/Documentation/hwmon/adm9240
index 35f618f32896..2c6f1fed4618 100644
--- a/Documentation/hwmon/adm9240
+++ b/Documentation/hwmon/adm9240
@@ -24,7 +24,7 @@ Authors:
24 Frodo Looijaard <frodol@dds.nl>, 24 Frodo Looijaard <frodol@dds.nl>,
25 Philip Edelbrock <phil@netroedge.com>, 25 Philip Edelbrock <phil@netroedge.com>,
26 Michiel Rook <michiel@grendelproject.nl>, 26 Michiel Rook <michiel@grendelproject.nl>,
27 Grant Coady <gcoady@gmail.com> with guidance 27 Grant Coady <gcoady.lk@gmail.com> with guidance
28 from Jean Delvare <khali@linux-fr.org> 28 from Jean Delvare <khali@linux-fr.org>
29 29
30Interface 30Interface
diff --git a/Documentation/hwmon/f71805f b/Documentation/hwmon/f71805f
index 28c5b7d1eb90..2ca69df669c3 100644
--- a/Documentation/hwmon/f71805f
+++ b/Documentation/hwmon/f71805f
@@ -17,7 +17,7 @@ Thanks to Kris Chen from Fintek for answering technical questions and
17providing additional documentation. 17providing additional documentation.
18 18
19Thanks to Chris Lin from Jetway for providing wiring schematics and 19Thanks to Chris Lin from Jetway for providing wiring schematics and
20anwsering technical questions. 20answering technical questions.
21 21
22 22
23Description 23Description
diff --git a/Documentation/hwmon/k8temp b/Documentation/hwmon/k8temp
index bab445ab0f52..30d123b8d920 100644
--- a/Documentation/hwmon/k8temp
+++ b/Documentation/hwmon/k8temp
@@ -2,7 +2,7 @@ Kernel driver k8temp
2==================== 2====================
3 3
4Supported chips: 4Supported chips:
5 * AMD K8 CPU 5 * AMD Athlon64/FX or Opteron CPUs
6 Prefix: 'k8temp' 6 Prefix: 'k8temp'
7 Addresses scanned: PCI space 7 Addresses scanned: PCI space
8 Datasheet: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf 8 Datasheet: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
@@ -13,10 +13,13 @@ Contact: Rudolf Marek <r.marek@sh.cvut.cz>
13Description 13Description
14----------- 14-----------
15 15
16This driver permits reading temperature sensor(s) embedded inside AMD K8 CPUs. 16This driver permits reading temperature sensor(s) embedded inside AMD K8
17Official documentation says that it works from revision F of K8 core, but 17family CPUs (Athlon64/FX, Opteron). Official documentation says that it works
18in fact it seems to be implemented for all revisions of K8 except the first 18from revision F of K8 core, but in fact it seems to be implemented for all
19two revisions (SH-B0 and SH-B3). 19revisions of K8 except the first two revisions (SH-B0 and SH-B3).
20
21Please note that you will need at least lm-sensors 2.10.1 for proper userspace
22support.
20 23
21There can be up to four temperature sensors inside single CPU. The driver 24There can be up to four temperature sensors inside single CPU. The driver
22will auto-detect the sensors and will display only temperatures from 25will auto-detect the sensors and will display only temperatures from
diff --git a/Documentation/hwmon/smsc47m1 b/Documentation/hwmon/smsc47m1
index c15bbe68264e..04a11124f667 100644
--- a/Documentation/hwmon/smsc47m1
+++ b/Documentation/hwmon/smsc47m1
@@ -2,12 +2,14 @@ Kernel driver smsc47m1
2====================== 2======================
3 3
4Supported chips: 4Supported chips:
5 * SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192 5 * SMSC LPC47B27x, LPC47M112, LPC47M10x, LPC47M13x, LPC47M14x,
6 LPC47M15x and LPC47M192
6 Addresses scanned: none, address read from Super I/O config space 7 Addresses scanned: none, address read from Super I/O config space
7 Prefix: 'smsc47m1' 8 Prefix: 'smsc47m1'
8 Datasheets: 9 Datasheets:
9 http://www.smsc.com/main/datasheets/47b27x.pdf 10 http://www.smsc.com/main/datasheets/47b27x.pdf
10 http://www.smsc.com/main/datasheets/47m10x.pdf 11 http://www.smsc.com/main/datasheets/47m10x.pdf
12 http://www.smsc.com/main/datasheets/47m112.pdf
11 http://www.smsc.com/main/tools/discontinued/47m13x.pdf 13 http://www.smsc.com/main/tools/discontinued/47m13x.pdf
12 http://www.smsc.com/main/datasheets/47m14x.pdf 14 http://www.smsc.com/main/datasheets/47m14x.pdf
13 http://www.smsc.com/main/tools/discontinued/47m15x.pdf 15 http://www.smsc.com/main/tools/discontinued/47m15x.pdf
diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf
index fae3b781d82d..caa610a297e8 100644
--- a/Documentation/hwmon/w83627ehf
+++ b/Documentation/hwmon/w83627ehf
@@ -26,7 +26,7 @@ fan control mode).
26Temperatures are measured in degrees Celsius and measurement resolution is 1 26Temperatures are measured in degrees Celsius and measurement resolution is 1
27degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when 27degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
28the temperature gets higher than high limit; it stays on until the temperature 28the temperature gets higher than high limit; it stays on until the temperature
29falls below the Hysteresis value. 29falls below the hysteresis value.
30 30
31Fan rotation speeds are reported in RPM (rotations per minute). An alarm is 31Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
32triggered if the rotation speed has dropped below a programmable limit. Fan 32triggered if the rotation speed has dropped below a programmable limit. Fan
@@ -67,9 +67,9 @@ Thermal Cruise mode
67 67
68If the temperature is in the range defined by: 68If the temperature is in the range defined by:
69 69
70pwm[1-4]_target - set target temperature, unit millidegree Celcius 70pwm[1-4]_target - set target temperature, unit millidegree Celsius
71 (range 0 - 127000) 71 (range 0 - 127000)
72pwm[1-4]_tolerance - tolerance, unit millidegree Celcius (range 0 - 15000) 72pwm[1-4]_tolerance - tolerance, unit millidegree Celsius (range 0 - 15000)
73 73
74there are no changes to fan speed. Once the temperature leaves the interval, 74there are no changes to fan speed. Once the temperature leaves the interval,
75fan speed increases (temp is higher) or decreases if lower than desired. 75fan speed increases (temp is higher) or decreases if lower than desired.
diff --git a/MAINTAINERS b/MAINTAINERS
index 9b6b88268d3f..d708702aba2f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1668,6 +1668,12 @@ M: sct@redhat.com, akpm@osdl.org
1668L: ext2-devel@lists.sourceforge.net 1668L: ext2-devel@lists.sourceforge.net
1669S: Maintained 1669S: Maintained
1670 1670
1671K8TEMP HARDWARE MONITORING DRIVER
1672P: Rudolf Marek
1673M: r.marek@assembler.cz
1674L: lm-sensors@lm-sensors.org
1675S: Maintained
1676
1671KCONFIG 1677KCONFIG
1672P: Roman Zippel 1678P: Roman Zippel
1673M: zippel@linux-m68k.org 1679M: zippel@linux-m68k.org
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 9b88b25b6edb..e76d91906c99 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -95,11 +95,13 @@ config SENSORS_ADM9240
95 will be called adm9240. 95 will be called adm9240.
96 96
97config SENSORS_K8TEMP 97config SENSORS_K8TEMP
98 tristate "AMD K8 processor sensor" 98 tristate "AMD Athlon64/FX or Opteron temperature sensor"
99 depends on HWMON && X86 && PCI && EXPERIMENTAL 99 depends on HWMON && X86 && PCI && EXPERIMENTAL
100 help 100 help
101 If you say yes here you get support for the temperature 101 If you say yes here you get support for the temperature
102 sensor(s) inside your AMD K8 CPU. 102 sensor(s) inside your CPU. Supported is whole AMD K8
103 microarchitecture. Please note that you will need at least
104 lm-sensors 2.10.1 for proper userspace support.
103 105
104 This driver can also be built as a module. If so, the module 106 This driver can also be built as a module. If so, the module
105 will be called k8temp. 107 will be called k8temp.
@@ -369,8 +371,8 @@ config SENSORS_SMSC47M1
369 help 371 help
370 If you say yes here you get support for the integrated fan 372 If you say yes here you get support for the integrated fan
371 monitoring and control capabilities of the SMSC LPC47B27x, 373 monitoring and control capabilities of the SMSC LPC47B27x,
372 LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x, LPC47M192 and 374 LPC47M10x, LPC47M112, LPC47M13x, LPC47M14x, LPC47M15x,
373 LPC47M997 chips. 375 LPC47M192 and LPC47M997 chips.
374 376
375 The temperature and voltage sensor features of the LPC47M192 377 The temperature and voltage sensor features of the LPC47M192
376 and LPC47M997 are supported by another driver, select also 378 and LPC47M997 are supported by another driver, select also
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 377961c4a41e..aad594adf0c7 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -5,7 +5,7 @@
5 * Copyright (C) 1999 Frodo Looijaard <frodol@dds.nl> 5 * Copyright (C) 1999 Frodo Looijaard <frodol@dds.nl>
6 * Philip Edelbrock <phil@netroedge.com> 6 * Philip Edelbrock <phil@netroedge.com>
7 * Copyright (C) 2003 Michiel Rook <michiel@grendelproject.nl> 7 * Copyright (C) 2003 Michiel Rook <michiel@grendelproject.nl>
8 * Copyright (C) 2005 Grant Coady <gcoady@gmail.com> with valuable 8 * Copyright (C) 2005 Grant Coady <gcoady.lk@gmail.com> with valuable
9 * guidance from Jean Delvare 9 * guidance from Jean Delvare
10 * 10 *
11 * Driver supports Analog Devices ADM9240 11 * Driver supports Analog Devices ADM9240
@@ -774,7 +774,7 @@ static void __exit sensors_adm9240_exit(void)
774} 774}
775 775
776MODULE_AUTHOR("Michiel Rook <michiel@grendelproject.nl>, " 776MODULE_AUTHOR("Michiel Rook <michiel@grendelproject.nl>, "
777 "Grant Coady <gcoady@gmail.com> and others"); 777 "Grant Coady <gcoady.lk@gmail.com> and others");
778MODULE_DESCRIPTION("ADM9240/DS1780/LM81 driver"); 778MODULE_DESCRIPTION("ADM9240/DS1780/LM81 driver");
779MODULE_LICENSE("GPL"); 779MODULE_LICENSE("GPL");
780 780
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index ac1b746df6d0..73bc2ffc598d 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -815,18 +815,18 @@ static int __init sm_lm78_init(void)
815 if (res) 815 if (res)
816 return res; 816 return res;
817 817
818 res = i2c_isa_add_driver(&lm78_isa_driver); 818 /* Don't exit if this one fails, we still want the I2C variants
819 if (res) { 819 to work! */
820 i2c_del_driver(&lm78_driver); 820 if (i2c_isa_add_driver(&lm78_isa_driver))
821 return res; 821 isa_address = 0;
822 }
823 822
824 return 0; 823 return 0;
825} 824}
826 825
827static void __exit sm_lm78_exit(void) 826static void __exit sm_lm78_exit(void)
828{ 827{
829 i2c_isa_del_driver(&lm78_isa_driver); 828 if (isa_address)
829 i2c_isa_del_driver(&lm78_isa_driver);
830 i2c_del_driver(&lm78_driver); 830 i2c_del_driver(&lm78_driver);
831} 831}
832 832
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index 47132fd26b1b..beb881c4b2e8 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -2,8 +2,8 @@
2 smsc47m1.c - Part of lm_sensors, Linux kernel modules 2 smsc47m1.c - Part of lm_sensors, Linux kernel modules
3 for hardware monitoring 3 for hardware monitoring
4 4
5 Supports the SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x, 5 Supports the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x,
6 LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips. 6 LPC47M14x, LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips.
7 7
8 Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> 8 Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
9 Copyright (C) 2004 Jean Delvare <khali@linux-fr.org> 9 Copyright (C) 2004 Jean Delvare <khali@linux-fr.org>
@@ -380,8 +380,8 @@ static int __init smsc47m1_find(unsigned short *addr)
380 val = superio_inb(SUPERIO_REG_DEVID); 380 val = superio_inb(SUPERIO_REG_DEVID);
381 381
382 /* 382 /*
383 * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id 383 * SMSC LPC47M10x/LPC47M112/LPC47M13x (device id 0x59), LPC47M14x
384 * 0x5F) and LPC47B27x (device id 0x51) have fan control. 384 * (device id 0x5F) and LPC47B27x (device id 0x51) have fan control.
385 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block" 385 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"
386 * can do much more besides (device id 0x60). 386 * can do much more besides (device id 0x60).
387 * The LPC47M997 is undocumented, but seems to be compatible with 387 * The LPC47M997 is undocumented, but seems to be compatible with
@@ -390,7 +390,8 @@ static int __init smsc47m1_find(unsigned short *addr)
390 if (val == 0x51) 390 if (val == 0x51)
391 printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n"); 391 printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n");
392 else if (val == 0x59) 392 else if (val == 0x59)
393 printk(KERN_INFO "smsc47m1: Found SMSC LPC47M10x/LPC47M13x\n"); 393 printk(KERN_INFO "smsc47m1: Found SMSC "
394 "LPC47M10x/LPC47M112/LPC47M13x\n");
394 else if (val == 0x5F) 395 else if (val == 0x5F)
395 printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n"); 396 printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n");
396 else if (val == 0x60) 397 else if (val == 0x60)
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 833faa275ffa..2257806d0102 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -354,6 +354,8 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)
354 case 0: 354 case 0:
355 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0xcf) 355 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0xcf)
356 | ((data->fan_div[0] & 0x03) << 4); 356 | ((data->fan_div[0] & 0x03) << 4);
357 /* fan5 input control bit is write only, compute the value */
358 reg |= (data->has_fan & (1 << 4)) ? 1 : 0;
357 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg); 359 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
358 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xdf) 360 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xdf)
359 | ((data->fan_div[0] & 0x04) << 3); 361 | ((data->fan_div[0] & 0x04) << 3);
@@ -362,6 +364,8 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)
362 case 1: 364 case 1:
363 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0x3f) 365 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0x3f)
364 | ((data->fan_div[1] & 0x03) << 6); 366 | ((data->fan_div[1] & 0x03) << 6);
367 /* fan5 input control bit is write only, compute the value */
368 reg |= (data->has_fan & (1 << 4)) ? 1 : 0;
365 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg); 369 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
366 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xbf) 370 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xbf)
367 | ((data->fan_div[1] & 0x04) << 4); 371 | ((data->fan_div[1] & 0x04) << 4);
@@ -1216,13 +1220,16 @@ static int w83627ehf_detect(struct i2c_adapter *adapter)
1216 superio_exit(); 1220 superio_exit();
1217 1221
1218 /* It looks like fan4 and fan5 pins can be alternatively used 1222 /* It looks like fan4 and fan5 pins can be alternatively used
1219 as fan on/off switches */ 1223 as fan on/off switches, but fan5 control is write only :/
1224 We assume that if the serial interface is disabled, designers
1225 connected fan5 as input unless they are emitting log 1, which
1226 is not the default. */
1220 1227
1221 data->has_fan = 0x07; /* fan1, fan2 and fan3 */ 1228 data->has_fan = 0x07; /* fan1, fan2 and fan3 */
1222 i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1); 1229 i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);
1223 if ((i & (1 << 2)) && (!fan4pin)) 1230 if ((i & (1 << 2)) && (!fan4pin))
1224 data->has_fan |= (1 << 3); 1231 data->has_fan |= (1 << 3);
1225 if ((i & (1 << 0)) && (!fan5pin)) 1232 if (!(i & (1 << 1)) && (!fan5pin))
1226 data->has_fan |= (1 << 4); 1233 data->has_fan |= (1 << 4);
1227 1234
1228 /* Register sysfs hooks */ 1235 /* Register sysfs hooks */
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index a4584ec69842..1232171c3aad 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1099,7 +1099,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1099 bank. */ 1099 bank. */
1100 if (kind < 0) { 1100 if (kind < 0) {
1101 if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) { 1101 if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) {
1102 dev_dbg(dev, "Detection failed at step 3\n"); 1102 dev_dbg(&adapter->dev, "Detection of w83781d chip "
1103 "failed at step 3\n");
1103 err = -ENODEV; 1104 err = -ENODEV;
1104 goto ERROR2; 1105 goto ERROR2;
1105 } 1106 }
@@ -1109,7 +1110,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1109 if ((!(val1 & 0x07)) && 1110 if ((!(val1 & 0x07)) &&
1110 (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3)) 1111 (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
1111 || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) { 1112 || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
1112 dev_dbg(dev, "Detection failed at step 4\n"); 1113 dev_dbg(&adapter->dev, "Detection of w83781d chip "
1114 "failed at step 4\n");
1113 err = -ENODEV; 1115 err = -ENODEV;
1114 goto ERROR2; 1116 goto ERROR2;
1115 } 1117 }
@@ -1119,7 +1121,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1119 ((val1 & 0x80) && (val2 == 0x5c)))) { 1121 ((val1 & 0x80) && (val2 == 0x5c)))) {
1120 if (w83781d_read_value 1122 if (w83781d_read_value
1121 (client, W83781D_REG_I2C_ADDR) != address) { 1123 (client, W83781D_REG_I2C_ADDR) != address) {
1122 dev_dbg(dev, "Detection failed at step 5\n"); 1124 dev_dbg(&adapter->dev, "Detection of w83781d "
1125 "chip failed at step 5\n");
1123 err = -ENODEV; 1126 err = -ENODEV;
1124 goto ERROR2; 1127 goto ERROR2;
1125 } 1128 }
@@ -1141,8 +1144,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1141 else if (val2 == 0x12) 1144 else if (val2 == 0x12)
1142 vendid = asus; 1145 vendid = asus;
1143 else { 1146 else {
1144 dev_dbg(dev, "Chip was made by neither " 1147 dev_dbg(&adapter->dev, "w83781d chip vendor is "
1145 "Winbond nor Asus?\n"); 1148 "neither Winbond nor Asus\n");
1146 err = -ENODEV; 1149 err = -ENODEV;
1147 goto ERROR2; 1150 goto ERROR2;
1148 } 1151 }
@@ -1161,10 +1164,9 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1161 kind = as99127f; 1164 kind = as99127f;
1162 else { 1165 else {
1163 if (kind == 0) 1166 if (kind == 0)
1164 dev_warn(dev, "Ignoring 'force' " 1167 dev_warn(&adapter->dev, "Ignoring 'force' "
1165 "parameter for unknown chip at " 1168 "parameter for unknown chip at "
1166 "adapter %d, address 0x%02x\n", 1169 "address 0x%02x\n", address);
1167 i2c_adapter_id(adapter), address);
1168 err = -EINVAL; 1170 err = -EINVAL;
1169 goto ERROR2; 1171 goto ERROR2;
1170 } 1172 }
@@ -1685,11 +1687,10 @@ sensors_w83781d_init(void)
1685 if (res) 1687 if (res)
1686 return res; 1688 return res;
1687 1689
1688 res = i2c_isa_add_driver(&w83781d_isa_driver); 1690 /* Don't exit if this one fails, we still want the I2C variants
1689 if (res) { 1691 to work! */
1690 i2c_del_driver(&w83781d_driver); 1692 if (i2c_isa_add_driver(&w83781d_isa_driver))
1691 return res; 1693 isa_address = 0;
1692 }
1693 1694
1694 return 0; 1695 return 0;
1695} 1696}
@@ -1697,7 +1698,8 @@ sensors_w83781d_init(void)
1697static void __exit 1698static void __exit
1698sensors_w83781d_exit(void) 1699sensors_w83781d_exit(void)
1699{ 1700{
1700 i2c_isa_del_driver(&w83781d_isa_driver); 1701 if (isa_address)
1702 i2c_isa_del_driver(&w83781d_isa_driver);
1701 i2c_del_driver(&w83781d_driver); 1703 i2c_del_driver(&w83781d_driver);
1702} 1704}
1703 1705
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index 371ed4f69a97..9e5f885368b4 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -746,6 +746,52 @@ static ssize_t store_vrm_reg(struct device *dev,
746 746
747static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 747static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
748 748
749#define IN_UNIT_ATTRS(X) \
750 &sda_in_input[X].dev_attr.attr, \
751 &sda_in_min[X].dev_attr.attr, \
752 &sda_in_max[X].dev_attr.attr
753
754#define FAN_UNIT_ATTRS(X) \
755 &sda_fan_input[X].dev_attr.attr, \
756 &sda_fan_min[X].dev_attr.attr, \
757 &sda_fan_div[X].dev_attr.attr
758
759#define TEMP_UNIT_ATTRS(X) \
760 &sda_temp_input[X].dev_attr.attr, \
761 &sda_temp_max[X].dev_attr.attr, \
762 &sda_temp_max_hyst[X].dev_attr.attr
763
764static struct attribute *w83791d_attributes[] = {
765 IN_UNIT_ATTRS(0),
766 IN_UNIT_ATTRS(1),
767 IN_UNIT_ATTRS(2),
768 IN_UNIT_ATTRS(3),
769 IN_UNIT_ATTRS(4),
770 IN_UNIT_ATTRS(5),
771 IN_UNIT_ATTRS(6),
772 IN_UNIT_ATTRS(7),
773 IN_UNIT_ATTRS(8),
774 IN_UNIT_ATTRS(9),
775 FAN_UNIT_ATTRS(0),
776 FAN_UNIT_ATTRS(1),
777 FAN_UNIT_ATTRS(2),
778 FAN_UNIT_ATTRS(3),
779 FAN_UNIT_ATTRS(4),
780 TEMP_UNIT_ATTRS(0),
781 TEMP_UNIT_ATTRS(1),
782 TEMP_UNIT_ATTRS(2),
783 &dev_attr_alarms.attr,
784 &sda_beep_ctrl[0].dev_attr.attr,
785 &sda_beep_ctrl[1].dev_attr.attr,
786 &dev_attr_cpu0_vid.attr,
787 &dev_attr_vrm.attr,
788 NULL
789};
790
791static const struct attribute_group w83791d_group = {
792 .attrs = w83791d_attributes,
793};
794
749/* This function is called when: 795/* This function is called when:
750 * w83791d_driver is inserted (when this module is loaded), for each 796 * w83791d_driver is inserted (when this module is loaded), for each
751 available adapter 797 available adapter
@@ -967,41 +1013,20 @@ static int w83791d_detect(struct i2c_adapter *adapter, int address, int kind)
967 } 1013 }
968 1014
969 /* Register sysfs hooks */ 1015 /* Register sysfs hooks */
1016 if ((err = sysfs_create_group(&client->dev.kobj, &w83791d_group)))
1017 goto error3;
1018
1019 /* Everything is ready, now register the working device */
970 data->class_dev = hwmon_device_register(dev); 1020 data->class_dev = hwmon_device_register(dev);
971 if (IS_ERR(data->class_dev)) { 1021 if (IS_ERR(data->class_dev)) {
972 err = PTR_ERR(data->class_dev); 1022 err = PTR_ERR(data->class_dev);
973 goto error3; 1023 goto error4;
974 } 1024 }
975 1025
976 for (i = 0; i < NUMBER_OF_VIN; i++) {
977 device_create_file(dev, &sda_in_input[i].dev_attr);
978 device_create_file(dev, &sda_in_min[i].dev_attr);
979 device_create_file(dev, &sda_in_max[i].dev_attr);
980 }
981
982 for (i = 0; i < NUMBER_OF_FANIN; i++) {
983 device_create_file(dev, &sda_fan_input[i].dev_attr);
984 device_create_file(dev, &sda_fan_div[i].dev_attr);
985 device_create_file(dev, &sda_fan_min[i].dev_attr);
986 }
987
988 for (i = 0; i < NUMBER_OF_TEMPIN; i++) {
989 device_create_file(dev, &sda_temp_input[i].dev_attr);
990 device_create_file(dev, &sda_temp_max[i].dev_attr);
991 device_create_file(dev, &sda_temp_max_hyst[i].dev_attr);
992 }
993
994 device_create_file(dev, &dev_attr_alarms);
995
996 for (i = 0; i < ARRAY_SIZE(sda_beep_ctrl); i++) {
997 device_create_file(dev, &sda_beep_ctrl[i].dev_attr);
998 }
999
1000 device_create_file(dev, &dev_attr_cpu0_vid);
1001 device_create_file(dev, &dev_attr_vrm);
1002
1003 return 0; 1026 return 0;
1004 1027
1028error4:
1029 sysfs_remove_group(&client->dev.kobj, &w83791d_group);
1005error3: 1030error3:
1006 if (data->lm75[0] != NULL) { 1031 if (data->lm75[0] != NULL) {
1007 i2c_detach_client(data->lm75[0]); 1032 i2c_detach_client(data->lm75[0]);
@@ -1025,8 +1050,10 @@ static int w83791d_detach_client(struct i2c_client *client)
1025 int err; 1050 int err;
1026 1051
1027 /* main client */ 1052 /* main client */
1028 if (data) 1053 if (data) {
1029 hwmon_device_unregister(data->class_dev); 1054 hwmon_device_unregister(data->class_dev);
1055 sysfs_remove_group(&client->dev.kobj, &w83791d_group);
1056 }
1030 1057
1031 if ((err = i2c_detach_client(client))) 1058 if ((err = i2c_detach_client(client)))
1032 return err; 1059 return err;
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index 4380653748a4..8ed59a2dff53 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -91,7 +91,7 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
91 /* Now look for clients */ 91 /* Now look for clients */
92 res = driver->attach_adapter(&isa_adapter); 92 res = driver->attach_adapter(&isa_adapter);
93 if (res) { 93 if (res) {
94 dev_err(&isa_adapter.dev, 94 dev_dbg(&isa_adapter.dev,
95 "Driver %s failed to attach adapter, unregistering\n", 95 "Driver %s failed to attach adapter, unregistering\n",
96 driver->driver.name); 96 driver->driver.name);
97 driver_unregister(&driver->driver); 97 driver_unregister(&driver->driver);