diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-09 15:23:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-09 15:23:54 -0400 |
commit | 07f405541892bd9bab4cca6c12499091ef4dd556 (patch) | |
tree | 54f85f9314716275e46882c47cfe75541371bc22 | |
parent | 9283dfed51b223eddf68bdf91c5cddc4a9abbdbe (diff) | |
parent | 5e5cddbc3f2936c9fefbae64633c522e242c350d (diff) |
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
hwmon: (abituguru3) Enable DMI probing feature on Abit AT8 32X
hwmon: (abituguru3) Enable reading from AUX3 fan on Abit AT8 32X
hwmon: (adt7473) Fix some bogosity in documentation file
hwmon: Define sysfs interface for energy consumption register
hwmon: (it87) Prevent power-off on Shuttle SN68PT
eeepc-laptop: Fix hwmon interface
-rw-r--r-- | Documentation/hwmon/adt7473 | 18 | ||||
-rw-r--r-- | Documentation/hwmon/sysfs-interface | 12 | ||||
-rw-r--r-- | drivers/hwmon/abituguru3.c | 3 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 70 | ||||
-rw-r--r-- | drivers/misc/eeepc-laptop.c | 16 |
5 files changed, 83 insertions, 36 deletions
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473 index 2126de34c711..1cbf671822e2 100644 --- a/Documentation/hwmon/adt7473 +++ b/Documentation/hwmon/adt7473 | |||
@@ -14,14 +14,14 @@ Description | |||
14 | 14 | ||
15 | This driver implements support for the Analog Devices ADT7473 chip family. | 15 | This driver implements support for the Analog Devices ADT7473 chip family. |
16 | 16 | ||
17 | The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 | 17 | The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0 |
18 | specification. Using an analog to digital converter it measures three (3) | 18 | specification. Using an analog to digital converter it measures three (3) |
19 | temperatures and two (2) voltages. It has three (3) 16-bit counters for | 19 | temperatures and two (2) voltages. It has four (4) 16-bit counters for |
20 | measuring fan speed. There are three (3) PWM outputs that can be used | 20 | measuring fan speed. There are three (3) PWM outputs that can be used |
21 | to control fan speed. | 21 | to control fan speed. |
22 | 22 | ||
23 | A sophisticated control system for the PWM outputs is designed into the | 23 | A sophisticated control system for the PWM outputs is designed into the |
24 | LM85 that allows fan speed to be adjusted automatically based on any of the | 24 | ADT7473 that allows fan speed to be adjusted automatically based on any of the |
25 | three temperature sensors. Each PWM output is individually adjustable and | 25 | three temperature sensors. Each PWM output is individually adjustable and |
26 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in | 26 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in |
27 | response to the measured temperatures without further host intervention. | 27 | response to the measured temperatures without further host intervention. |
@@ -46,14 +46,6 @@ from the raw value to get the temperature value. | |||
46 | The Analog Devices datasheet is very detailed and describes a procedure for | 46 | The Analog Devices datasheet is very detailed and describes a procedure for |
47 | determining an optimal configuration for the automatic PWM control. | 47 | determining an optimal configuration for the automatic PWM control. |
48 | 48 | ||
49 | Hardware Configurations | ||
50 | ----------------------- | ||
51 | |||
52 | The ADT7473 chips have an optional SMBALERT output that can be used to | ||
53 | signal the chipset in case a limit is exceeded or the temperature sensors | ||
54 | fail. Individual sensor interrupts can be masked so they won't trigger | ||
55 | SMBALERT. The SMBALERT output if configured replaces the PWM2 function. | ||
56 | |||
57 | Configuration Notes | 49 | Configuration Notes |
58 | ------------------- | 50 | ------------------- |
59 | 51 | ||
@@ -61,8 +53,8 @@ Besides standard interfaces driver adds the following: | |||
61 | 53 | ||
62 | * PWM Control | 54 | * PWM Control |
63 | 55 | ||
64 | * pwm#_auto_point1_pwm and pwm#_auto_point1_temp and | 56 | * pwm#_auto_point1_pwm and temp#_auto_point1_temp and |
65 | * pwm#_auto_point2_pwm and pwm#_auto_point2_temp - | 57 | * pwm#_auto_point2_pwm and temp#_auto_point2_temp - |
66 | 58 | ||
67 | point1: Set the pwm speed at a lower temperature bound. | 59 | point1: Set the pwm speed at a lower temperature bound. |
68 | point2: Set the pwm speed at a higher temperature bound. | 60 | point2: Set the pwm speed at a higher temperature bound. |
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index 2d845730d4e0..6dbfd5efd991 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -329,6 +329,10 @@ power[1-*]_average Average power use | |||
329 | Unit: microWatt | 329 | Unit: microWatt |
330 | RO | 330 | RO |
331 | 331 | ||
332 | power[1-*]_average_interval Power use averaging interval | ||
333 | Unit: milliseconds | ||
334 | RW | ||
335 | |||
332 | power[1-*]_average_highest Historical average maximum power use | 336 | power[1-*]_average_highest Historical average maximum power use |
333 | Unit: microWatt | 337 | Unit: microWatt |
334 | RO | 338 | RO |
@@ -354,6 +358,14 @@ power[1-*]_reset_history Reset input_highest, input_lowest, | |||
354 | WO | 358 | WO |
355 | 359 | ||
356 | ********** | 360 | ********** |
361 | * Energy * | ||
362 | ********** | ||
363 | |||
364 | energy[1-*]_input Cumulative energy use | ||
365 | Unit: microJoule | ||
366 | RO | ||
367 | |||
368 | ********** | ||
357 | * Alarms * | 369 | * Alarms * |
358 | ********** | 370 | ********** |
359 | 371 | ||
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index d568c65c1370..d9e7a49d6cbf 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c | |||
@@ -279,7 +279,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
279 | { "OTES1 Fan", 36, 2, 60, 1, 0 }, | 279 | { "OTES1 Fan", 36, 2, 60, 1, 0 }, |
280 | { NULL, 0, 0, 0, 0, 0 } } | 280 | { NULL, 0, 0, 0, 0, 0 } } |
281 | }, | 281 | }, |
282 | { 0x0011, NULL /* Abit AT8 32X, need DMI string */, { | 282 | { 0x0011, "AT8 32X(ATI RD580-ULI M1575)", { |
283 | { "CPU Core", 0, 0, 10, 1, 0 }, | 283 | { "CPU Core", 0, 0, 10, 1, 0 }, |
284 | { "DDR", 1, 0, 20, 1, 0 }, | 284 | { "DDR", 1, 0, 20, 1, 0 }, |
285 | { "DDR VTT", 2, 0, 10, 1, 0 }, | 285 | { "DDR VTT", 2, 0, 10, 1, 0 }, |
@@ -303,6 +303,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
303 | { "SYS Fan", 34, 2, 60, 1, 0 }, | 303 | { "SYS Fan", 34, 2, 60, 1, 0 }, |
304 | { "AUX1 Fan", 35, 2, 60, 1, 0 }, | 304 | { "AUX1 Fan", 35, 2, 60, 1, 0 }, |
305 | { "AUX2 Fan", 36, 2, 60, 1, 0 }, | 305 | { "AUX2 Fan", 36, 2, 60, 1, 0 }, |
306 | { "AUX3 Fan", 37, 2, 60, 1, 0 }, | ||
306 | { NULL, 0, 0, 0, 0, 0 } } | 307 | { NULL, 0, 0, 0, 0, 0 } } |
307 | }, | 308 | }, |
308 | { 0x0012, NULL /* Abit AN8 32X, need DMI string */, { | 309 | { 0x0012, NULL /* Abit AN8 32X, need DMI string */, { |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index f1133081cc42..d793cc011990 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #include <linux/err.h> | 46 | #include <linux/err.h> |
47 | #include <linux/mutex.h> | 47 | #include <linux/mutex.h> |
48 | #include <linux/sysfs.h> | 48 | #include <linux/sysfs.h> |
49 | #include <linux/string.h> | ||
50 | #include <linux/dmi.h> | ||
49 | #include <asm/io.h> | 51 | #include <asm/io.h> |
50 | 52 | ||
51 | #define DRVNAME "it87" | 53 | #define DRVNAME "it87" |
@@ -236,6 +238,8 @@ struct it87_sio_data { | |||
236 | /* Values read from Super-I/O config space */ | 238 | /* Values read from Super-I/O config space */ |
237 | u8 revision; | 239 | u8 revision; |
238 | u8 vid_value; | 240 | u8 vid_value; |
241 | /* Values set based on DMI strings */ | ||
242 | u8 skip_pwm; | ||
239 | }; | 243 | }; |
240 | 244 | ||
241 | /* For each registered chip, we need to keep some data in memory. | 245 | /* For each registered chip, we need to keep some data in memory. |
@@ -964,6 +968,7 @@ static int __init it87_find(unsigned short *address, | |||
964 | { | 968 | { |
965 | int err = -ENODEV; | 969 | int err = -ENODEV; |
966 | u16 chip_type; | 970 | u16 chip_type; |
971 | const char *board_vendor, *board_name; | ||
967 | 972 | ||
968 | superio_enter(); | 973 | superio_enter(); |
969 | chip_type = force_id ? force_id : superio_inw(DEVID); | 974 | chip_type = force_id ? force_id : superio_inw(DEVID); |
@@ -1022,6 +1027,24 @@ static int __init it87_find(unsigned short *address, | |||
1022 | pr_info("it87: in7 is VCCH (+5V Stand-By)\n"); | 1027 | pr_info("it87: in7 is VCCH (+5V Stand-By)\n"); |
1023 | } | 1028 | } |
1024 | 1029 | ||
1030 | /* Disable specific features based on DMI strings */ | ||
1031 | board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||
1032 | board_name = dmi_get_system_info(DMI_BOARD_NAME); | ||
1033 | if (board_vendor && board_name) { | ||
1034 | if (strcmp(board_vendor, "nVIDIA") == 0 | ||
1035 | && strcmp(board_name, "FN68PT") == 0) { | ||
1036 | /* On the Shuttle SN68PT, FAN_CTL2 is apparently not | ||
1037 | connected to a fan, but to something else. One user | ||
1038 | has reported instant system power-off when changing | ||
1039 | the PWM2 duty cycle, so we disable it. | ||
1040 | I use the board name string as the trigger in case | ||
1041 | the same board is ever used in other systems. */ | ||
1042 | pr_info("it87: Disabling pwm2 due to " | ||
1043 | "hardware constraints\n"); | ||
1044 | sio_data->skip_pwm = (1 << 1); | ||
1045 | } | ||
1046 | } | ||
1047 | |||
1025 | exit: | 1048 | exit: |
1026 | superio_exit(); | 1049 | superio_exit(); |
1027 | return err; | 1050 | return err; |
@@ -1168,25 +1191,33 @@ static int __devinit it87_probe(struct platform_device *pdev) | |||
1168 | } | 1191 | } |
1169 | 1192 | ||
1170 | if (enable_pwm_interface) { | 1193 | if (enable_pwm_interface) { |
1171 | if ((err = device_create_file(dev, | 1194 | if (!(sio_data->skip_pwm & (1 << 0))) { |
1172 | &sensor_dev_attr_pwm1_enable.dev_attr)) | 1195 | if ((err = device_create_file(dev, |
1173 | || (err = device_create_file(dev, | 1196 | &sensor_dev_attr_pwm1_enable.dev_attr)) |
1174 | &sensor_dev_attr_pwm2_enable.dev_attr)) | 1197 | || (err = device_create_file(dev, |
1175 | || (err = device_create_file(dev, | 1198 | &sensor_dev_attr_pwm1.dev_attr)) |
1176 | &sensor_dev_attr_pwm3_enable.dev_attr)) | 1199 | || (err = device_create_file(dev, |
1177 | || (err = device_create_file(dev, | 1200 | &dev_attr_pwm1_freq))) |
1178 | &sensor_dev_attr_pwm1.dev_attr)) | 1201 | goto ERROR4; |
1179 | || (err = device_create_file(dev, | 1202 | } |
1180 | &sensor_dev_attr_pwm2.dev_attr)) | 1203 | if (!(sio_data->skip_pwm & (1 << 1))) { |
1181 | || (err = device_create_file(dev, | 1204 | if ((err = device_create_file(dev, |
1182 | &sensor_dev_attr_pwm3.dev_attr)) | 1205 | &sensor_dev_attr_pwm2_enable.dev_attr)) |
1183 | || (err = device_create_file(dev, | 1206 | || (err = device_create_file(dev, |
1184 | &dev_attr_pwm1_freq)) | 1207 | &sensor_dev_attr_pwm2.dev_attr)) |
1185 | || (err = device_create_file(dev, | 1208 | || (err = device_create_file(dev, |
1186 | &dev_attr_pwm2_freq)) | 1209 | &dev_attr_pwm2_freq))) |
1187 | || (err = device_create_file(dev, | 1210 | goto ERROR4; |
1188 | &dev_attr_pwm3_freq))) | 1211 | } |
1189 | goto ERROR4; | 1212 | if (!(sio_data->skip_pwm & (1 << 2))) { |
1213 | if ((err = device_create_file(dev, | ||
1214 | &sensor_dev_attr_pwm3_enable.dev_attr)) | ||
1215 | || (err = device_create_file(dev, | ||
1216 | &sensor_dev_attr_pwm3.dev_attr)) | ||
1217 | || (err = device_create_file(dev, | ||
1218 | &dev_attr_pwm3_freq))) | ||
1219 | goto ERROR4; | ||
1220 | } | ||
1190 | } | 1221 | } |
1191 | 1222 | ||
1192 | if (data->type == it8712 || data->type == it8716 | 1223 | if (data->type == it8712 || data->type == it8716 |
@@ -1546,6 +1577,7 @@ static int __init sm_it87_init(void) | |||
1546 | unsigned short isa_address=0; | 1577 | unsigned short isa_address=0; |
1547 | struct it87_sio_data sio_data; | 1578 | struct it87_sio_data sio_data; |
1548 | 1579 | ||
1580 | memset(&sio_data, 0, sizeof(struct it87_sio_data)); | ||
1549 | err = it87_find(&isa_address, &sio_data); | 1581 | err = it87_find(&isa_address, &sio_data); |
1550 | if (err) | 1582 | if (err) |
1551 | return err; | 1583 | return err; |
diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c index facdb9893c84..1ee8501e90f1 100644 --- a/drivers/misc/eeepc-laptop.c +++ b/drivers/misc/eeepc-laptop.c | |||
@@ -450,12 +450,14 @@ static int eeepc_get_fan_pwm(void) | |||
450 | int value = 0; | 450 | int value = 0; |
451 | 451 | ||
452 | read_acpi_int(NULL, EEEPC_EC_FAN_PWM, &value); | 452 | read_acpi_int(NULL, EEEPC_EC_FAN_PWM, &value); |
453 | value = value * 255 / 100; | ||
453 | return (value); | 454 | return (value); |
454 | } | 455 | } |
455 | 456 | ||
456 | static void eeepc_set_fan_pwm(int value) | 457 | static void eeepc_set_fan_pwm(int value) |
457 | { | 458 | { |
458 | value = SENSORS_LIMIT(value, 0, 100); | 459 | value = SENSORS_LIMIT(value, 0, 255); |
460 | value = value * 100 / 255; | ||
459 | ec_write(EEEPC_EC_SC02, value); | 461 | ec_write(EEEPC_EC_SC02, value); |
460 | } | 462 | } |
461 | 463 | ||
@@ -520,15 +522,23 @@ static ssize_t show_sys_hwmon(int (*get)(void), char *buf) | |||
520 | static SENSOR_DEVICE_ATTR(_name, _mode, show_##_name, store_##_name, 0); | 522 | static SENSOR_DEVICE_ATTR(_name, _mode, show_##_name, store_##_name, 0); |
521 | 523 | ||
522 | EEEPC_CREATE_SENSOR_ATTR(fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL); | 524 | EEEPC_CREATE_SENSOR_ATTR(fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL); |
523 | EEEPC_CREATE_SENSOR_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, | 525 | EEEPC_CREATE_SENSOR_ATTR(pwm1, S_IRUGO | S_IWUSR, |
524 | eeepc_get_fan_pwm, eeepc_set_fan_pwm); | 526 | eeepc_get_fan_pwm, eeepc_set_fan_pwm); |
525 | EEEPC_CREATE_SENSOR_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, | 527 | EEEPC_CREATE_SENSOR_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, |
526 | eeepc_get_fan_ctrl, eeepc_set_fan_ctrl); | 528 | eeepc_get_fan_ctrl, eeepc_set_fan_ctrl); |
527 | 529 | ||
530 | static ssize_t | ||
531 | show_name(struct device *dev, struct device_attribute *attr, char *buf) | ||
532 | { | ||
533 | return sprintf(buf, "eeepc\n"); | ||
534 | } | ||
535 | static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0); | ||
536 | |||
528 | static struct attribute *hwmon_attributes[] = { | 537 | static struct attribute *hwmon_attributes[] = { |
529 | &sensor_dev_attr_fan1_pwm.dev_attr.attr, | 538 | &sensor_dev_attr_pwm1.dev_attr.attr, |
530 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 539 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
531 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, | 540 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, |
541 | &sensor_dev_attr_name.dev_attr.attr, | ||
532 | NULL | 542 | NULL |
533 | }; | 543 | }; |
534 | 544 | ||