Commit 64d9a39ec9ad074384b548c0cead89265c82e166

Authored by Linus Torvalds

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

Showing 14 changed files Side-by-side Diff

Documentation/hwmon/adm9240
... ... @@ -24,7 +24,7 @@
24 24 Frodo Looijaard <frodol@dds.nl>,
25 25 Philip Edelbrock <phil@netroedge.com>,
26 26 Michiel Rook <michiel@grendelproject.nl>,
27   - Grant Coady <gcoady@gmail.com> with guidance
  27 + Grant Coady <gcoady.lk@gmail.com> with guidance
28 28 from Jean Delvare <khali@linux-fr.org>
29 29  
30 30 Interface
Documentation/hwmon/f71805f
... ... @@ -17,7 +17,7 @@
17 17 providing additional documentation.
18 18  
19 19 Thanks to Chris Lin from Jetway for providing wiring schematics and
20   -anwsering technical questions.
  20 +answering technical questions.
21 21  
22 22  
23 23 Description
Documentation/hwmon/k8temp
... ... @@ -2,7 +2,7 @@
2 2 ====================
3 3  
4 4 Supported chips:
5   - * AMD K8 CPU
  5 + * AMD Athlon64/FX or Opteron CPUs
6 6 Prefix: 'k8temp'
7 7 Addresses scanned: PCI space
8 8 Datasheet: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
... ... @@ -13,10 +13,13 @@
13 13 Description
14 14 -----------
15 15  
16   -This driver permits reading temperature sensor(s) embedded inside AMD K8 CPUs.
17   -Official documentation says that it works from revision F of K8 core, but
18   -in fact it seems to be implemented for all revisions of K8 except the first
19   -two revisions (SH-B0 and SH-B3).
  16 +This driver permits reading temperature sensor(s) embedded inside AMD K8
  17 +family CPUs (Athlon64/FX, Opteron). Official documentation says that it works
  18 +from revision F of K8 core, but in fact it seems to be implemented for all
  19 +revisions of K8 except the first two revisions (SH-B0 and SH-B3).
  20 +
  21 +Please note that you will need at least lm-sensors 2.10.1 for proper userspace
  22 +support.
20 23  
21 24 There can be up to four temperature sensors inside single CPU. The driver
22 25 will auto-detect the sensors and will display only temperatures from
Documentation/hwmon/smsc47m1
... ... @@ -2,12 +2,14 @@
2 2 ======================
3 3  
4 4 Supported chips:
5   - * SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192
  5 + * SMSC LPC47B27x, LPC47M112, LPC47M10x, LPC47M13x, LPC47M14x,
  6 + LPC47M15x and LPC47M192
6 7 Addresses scanned: none, address read from Super I/O config space
7 8 Prefix: 'smsc47m1'
8 9 Datasheets:
9 10 http://www.smsc.com/main/datasheets/47b27x.pdf
10 11 http://www.smsc.com/main/datasheets/47m10x.pdf
  12 + http://www.smsc.com/main/datasheets/47m112.pdf
11 13 http://www.smsc.com/main/tools/discontinued/47m13x.pdf
12 14 http://www.smsc.com/main/datasheets/47m14x.pdf
13 15 http://www.smsc.com/main/tools/discontinued/47m15x.pdf
Documentation/hwmon/w83627ehf
... ... @@ -26,7 +26,7 @@
26 26 Temperatures are measured in degrees Celsius and measurement resolution is 1
27 27 degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
28 28 the temperature gets higher than high limit; it stays on until the temperature
29   -falls below the Hysteresis value.
  29 +falls below the hysteresis value.
30 30  
31 31 Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
32 32 triggered if the rotation speed has dropped below a programmable limit. Fan
33 33  
... ... @@ -67,9 +67,9 @@
67 67  
68 68 If the temperature is in the range defined by:
69 69  
70   -pwm[1-4]_target - set target temperature, unit millidegree Celcius
  70 +pwm[1-4]_target - set target temperature, unit millidegree Celsius
71 71 (range 0 - 127000)
72   -pwm[1-4]_tolerance - tolerance, unit millidegree Celcius (range 0 - 15000)
  72 +pwm[1-4]_tolerance - tolerance, unit millidegree Celsius (range 0 - 15000)
73 73  
74 74 there are no changes to fan speed. Once the temperature leaves the interval,
75 75 fan speed increases (temp is higher) or decreases if lower than desired.
... ... @@ -1668,6 +1668,12 @@
1668 1668 L: ext2-devel@lists.sourceforge.net
1669 1669 S: Maintained
1670 1670  
  1671 +K8TEMP HARDWARE MONITORING DRIVER
  1672 +P: Rudolf Marek
  1673 +M: r.marek@assembler.cz
  1674 +L: lm-sensors@lm-sensors.org
  1675 +S: Maintained
  1676 +
1671 1677 KCONFIG
1672 1678 P: Roman Zippel
1673 1679 M: zippel@linux-m68k.org
drivers/hwmon/Kconfig
... ... @@ -95,11 +95,13 @@
95 95 will be called adm9240.
96 96  
97 97 config SENSORS_K8TEMP
98   - tristate "AMD K8 processor sensor"
  98 + tristate "AMD Athlon64/FX or Opteron temperature sensor"
99 99 depends on HWMON && X86 && PCI && EXPERIMENTAL
100 100 help
101 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 106 This driver can also be built as a module. If so, the module
105 107 will be called k8temp.
... ... @@ -369,8 +371,8 @@
369 371 help
370 372 If you say yes here you get support for the integrated fan
371 373 monitoring and control capabilities of the SMSC LPC47B27x,
372   - LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x, LPC47M192 and
373   - LPC47M997 chips.
  374 + LPC47M10x, LPC47M112, LPC47M13x, LPC47M14x, LPC47M15x,
  375 + LPC47M192 and LPC47M997 chips.
374 376  
375 377 The temperature and voltage sensor features of the LPC47M192
376 378 and LPC47M997 are supported by another driver, select also
drivers/hwmon/adm9240.c
... ... @@ -5,7 +5,7 @@
5 5 * Copyright (C) 1999 Frodo Looijaard <frodol@dds.nl>
6 6 * Philip Edelbrock <phil@netroedge.com>
7 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 9 * guidance from Jean Delvare
10 10 *
11 11 * Driver supports Analog Devices ADM9240
... ... @@ -774,7 +774,7 @@
774 774 }
775 775  
776 776 MODULE_AUTHOR("Michiel Rook <michiel@grendelproject.nl>, "
777   - "Grant Coady <gcoady@gmail.com> and others");
  777 + "Grant Coady <gcoady.lk@gmail.com> and others");
778 778 MODULE_DESCRIPTION("ADM9240/DS1780/LM81 driver");
779 779 MODULE_LICENSE("GPL");
780 780  
drivers/hwmon/lm78.c
... ... @@ -815,18 +815,18 @@
815 815 if (res)
816 816 return res;
817 817  
818   - res = i2c_isa_add_driver(&lm78_isa_driver);
819   - if (res) {
820   - i2c_del_driver(&lm78_driver);
821   - return res;
822   - }
  818 + /* Don't exit if this one fails, we still want the I2C variants
  819 + to work! */
  820 + if (i2c_isa_add_driver(&lm78_isa_driver))
  821 + isa_address = 0;
823 822  
824 823 return 0;
825 824 }
826 825  
827 826 static 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 830 i2c_del_driver(&lm78_driver);
831 831 }
832 832  
drivers/hwmon/smsc47m1.c
... ... @@ -2,8 +2,8 @@
2 2 smsc47m1.c - Part of lm_sensors, Linux kernel modules
3 3 for hardware monitoring
4 4  
5   - Supports the SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x,
6   - LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips.
  5 + Supports the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x,
  6 + LPC47M14x, LPC47M15x, LPC47M192 and LPC47M997 Super-I/O chips.
7 7  
8 8 Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
9 9 Copyright (C) 2004 Jean Delvare <khali@linux-fr.org>
... ... @@ -380,8 +380,8 @@
380 380 val = superio_inb(SUPERIO_REG_DEVID);
381 381  
382 382 /*
383   - * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id
384   - * 0x5F) and LPC47B27x (device id 0x51) have fan control.
  383 + * SMSC LPC47M10x/LPC47M112/LPC47M13x (device id 0x59), LPC47M14x
  384 + * (device id 0x5F) and LPC47B27x (device id 0x51) have fan control.
385 385 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"
386 386 * can do much more besides (device id 0x60).
387 387 * The LPC47M997 is undocumented, but seems to be compatible with
... ... @@ -390,7 +390,8 @@
390 390 if (val == 0x51)
391 391 printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n");
392 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 395 else if (val == 0x5F)
395 396 printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n");
396 397 else if (val == 0x60)
drivers/hwmon/w83627ehf.c
... ... @@ -354,6 +354,8 @@
354 354 case 0:
355 355 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0xcf)
356 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 359 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
358 360 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xdf)
359 361 | ((data->fan_div[0] & 0x04) << 3);
... ... @@ -362,6 +364,8 @@
362 364 case 1:
363 365 reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0x3f)
364 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 369 w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);
366 370 reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xbf)
367 371 | ((data->fan_div[1] & 0x04) << 4);
368 372  
... ... @@ -1216,13 +1220,16 @@
1216 1220 superio_exit();
1217 1221  
1218 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 1228 data->has_fan = 0x07; /* fan1, fan2 and fan3 */
1222 1229 i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);
1223 1230 if ((i & (1 << 2)) && (!fan4pin))
1224 1231 data->has_fan |= (1 << 3);
1225   - if ((i & (1 << 0)) && (!fan5pin))
  1232 + if (!(i & (1 << 1)) && (!fan5pin))
1226 1233 data->has_fan |= (1 << 4);
1227 1234  
1228 1235 /* Register sysfs hooks */
drivers/hwmon/w83781d.c
... ... @@ -1099,7 +1099,8 @@
1099 1099 bank. */
1100 1100 if (kind < 0) {
1101 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 1104 err = -ENODEV;
1104 1105 goto ERROR2;
1105 1106 }
... ... @@ -1109,7 +1110,8 @@
1109 1110 if ((!(val1 & 0x07)) &&
1110 1111 (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
1111 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 1115 err = -ENODEV;
1114 1116 goto ERROR2;
1115 1117 }
... ... @@ -1119,7 +1121,8 @@
1119 1121 ((val1 & 0x80) && (val2 == 0x5c)))) {
1120 1122 if (w83781d_read_value
1121 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 1126 err = -ENODEV;
1124 1127 goto ERROR2;
1125 1128 }
... ... @@ -1141,8 +1144,8 @@
1141 1144 else if (val2 == 0x12)
1142 1145 vendid = asus;
1143 1146 else {
1144   - dev_dbg(dev, "Chip was made by neither "
1145   - "Winbond nor Asus?\n");
  1147 + dev_dbg(&adapter->dev, "w83781d chip vendor is "
  1148 + "neither Winbond nor Asus\n");
1146 1149 err = -ENODEV;
1147 1150 goto ERROR2;
1148 1151 }
1149 1152  
... ... @@ -1161,10 +1164,9 @@
1161 1164 kind = as99127f;
1162 1165 else {
1163 1166 if (kind == 0)
1164   - dev_warn(dev, "Ignoring 'force' "
  1167 + dev_warn(&adapter->dev, "Ignoring 'force' "
1165 1168 "parameter for unknown chip at "
1166   - "adapter %d, address 0x%02x\n",
1167   - i2c_adapter_id(adapter), address);
  1169 + "address 0x%02x\n", address);
1168 1170 err = -EINVAL;
1169 1171 goto ERROR2;
1170 1172 }
... ... @@ -1685,11 +1687,10 @@
1685 1687 if (res)
1686 1688 return res;
1687 1689  
1688   - res = i2c_isa_add_driver(&w83781d_isa_driver);
1689   - if (res) {
1690   - i2c_del_driver(&w83781d_driver);
1691   - return res;
1692   - }
  1690 + /* Don't exit if this one fails, we still want the I2C variants
  1691 + to work! */
  1692 + if (i2c_isa_add_driver(&w83781d_isa_driver))
  1693 + isa_address = 0;
1693 1694  
1694 1695 return 0;
1695 1696 }
... ... @@ -1697,7 +1698,8 @@
1697 1698 static void __exit
1698 1699 sensors_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 1703 i2c_del_driver(&w83781d_driver);
1702 1704 }
1703 1705  
drivers/hwmon/w83791d.c
... ... @@ -746,6 +746,52 @@
746 746  
747 747 static 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 +
  764 +static 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 +
  791 +static const struct attribute_group w83791d_group = {
  792 + .attrs = w83791d_attributes,
  793 +};
  794 +
749 795 /* This function is called when:
750 796 * w83791d_driver is inserted (when this module is loaded), for each
751 797 available adapter
752 798  
753 799  
754 800  
... ... @@ -967,41 +1013,20 @@
967 1013 }
968 1014  
969 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 1020 data->class_dev = hwmon_device_register(dev);
971 1021 if (IS_ERR(data->class_dev)) {
972 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 1026 return 0;
1004 1027  
  1028 +error4:
  1029 + sysfs_remove_group(&client->dev.kobj, &w83791d_group);
1005 1030 error3:
1006 1031 if (data->lm75[0] != NULL) {
1007 1032 i2c_detach_client(data->lm75[0]);
1008 1033  
... ... @@ -1025,8 +1050,10 @@
1025 1050 int err;
1026 1051  
1027 1052 /* main client */
1028   - if (data)
  1053 + if (data) {
1029 1054 hwmon_device_unregister(data->class_dev);
  1055 + sysfs_remove_group(&client->dev.kobj, &w83791d_group);
  1056 + }
1030 1057  
1031 1058 if ((err = i2c_detach_client(client)))
1032 1059 return err;
drivers/i2c/busses/i2c-isa.c
... ... @@ -91,7 +91,7 @@
91 91 /* Now look for clients */
92 92 res = driver->attach_adapter(&isa_adapter);
93 93 if (res) {
94   - dev_err(&isa_adapter.dev,
  94 + dev_dbg(&isa_adapter.dev,
95 95 "Driver %s failed to attach adapter, unregistering\n",
96 96 driver->driver.name);
97 97 driver_unregister(&driver->driver);