diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-26 12:36:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-26 12:36:19 -0400 |
commit | b1cd2ee3b95f1c3108c68c82342c614e58ce1f13 (patch) | |
tree | f282632a4cd5de359c8ba586371e907ade0543ec | |
parent | e383d56487062275e9971094f2efcca34227ee60 (diff) | |
parent | c02d65694debbc82dc48453a9fd52efb036c7258 (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 AW9D-MAX
hwmon: (abituguru3) Cosmetic whitespace fixes
hwmon: (adt7473) Fix voltage conversion routines
hwmon: (lm90) Add support for the LM99 16 degree offset
hwmon: (lm90) Fix handling of hysteresis value
hwmon-vid: Add support for AMD family 10h CPUs
hwmon: (w83781d) Fix linking when built-in
-rw-r--r-- | Documentation/hwmon/lm90 | 2 | ||||
-rw-r--r-- | drivers/hwmon/abituguru3.c | 30 | ||||
-rw-r--r-- | drivers/hwmon/adt7473.c | 29 | ||||
-rw-r--r-- | drivers/hwmon/hwmon-vid.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/lm90.c | 52 | ||||
-rw-r--r-- | drivers/hwmon/w83781d.c | 4 |
6 files changed, 73 insertions, 45 deletions
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90 index e0d5206d1de3..0e8411710238 100644 --- a/Documentation/hwmon/lm90 +++ b/Documentation/hwmon/lm90 | |||
@@ -8,7 +8,7 @@ Supported chips: | |||
8 | Datasheet: Publicly available at the National Semiconductor website | 8 | Datasheet: Publicly available at the National Semiconductor website |
9 | http://www.national.com/pf/LM/LM90.html | 9 | http://www.national.com/pf/LM/LM90.html |
10 | * National Semiconductor LM89 | 10 | * National Semiconductor LM89 |
11 | Prefix: 'lm99' | 11 | Prefix: 'lm89' (no auto-detection) |
12 | Addresses scanned: I2C 0x4c and 0x4d | 12 | Addresses scanned: I2C 0x4c and 0x4d |
13 | Datasheet: Publicly available at the National Semiconductor website | 13 | Datasheet: Publicly available at the National Semiconductor website |
14 | http://www.national.com/mpf/LM/LM89.html | 14 | http://www.national.com/mpf/LM/LM89.html |
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index d9e7a49d6cbf..70bb854086df 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c | |||
@@ -178,7 +178,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
178 | { "+3.3V", 10, 0, 20, 1, 0 }, | 178 | { "+3.3V", 10, 0, 20, 1, 0 }, |
179 | { "5VSB", 11, 0, 30, 1, 0 }, | 179 | { "5VSB", 11, 0, 30, 1, 0 }, |
180 | { "CPU", 24, 1, 1, 1, 0 }, | 180 | { "CPU", 24, 1, 1, 1, 0 }, |
181 | { "System ", 25, 1, 1, 1, 0 }, | 181 | { "System", 25, 1, 1, 1, 0 }, |
182 | { "PWM", 26, 1, 1, 1, 0 }, | 182 | { "PWM", 26, 1, 1, 1, 0 }, |
183 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 183 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
184 | { "NB Fan", 33, 2, 60, 1, 0 }, | 184 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -200,7 +200,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
200 | { "+3.3V", 10, 0, 20, 1, 0 }, | 200 | { "+3.3V", 10, 0, 20, 1, 0 }, |
201 | { "5VSB", 11, 0, 30, 1, 0 }, | 201 | { "5VSB", 11, 0, 30, 1, 0 }, |
202 | { "CPU", 24, 1, 1, 1, 0 }, | 202 | { "CPU", 24, 1, 1, 1, 0 }, |
203 | { "System ", 25, 1, 1, 1, 0 }, | 203 | { "System", 25, 1, 1, 1, 0 }, |
204 | { "PWM1", 26, 1, 1, 1, 0 }, | 204 | { "PWM1", 26, 1, 1, 1, 0 }, |
205 | { "PWM2", 27, 1, 1, 1, 0 }, | 205 | { "PWM2", 27, 1, 1, 1, 0 }, |
206 | { "PWM3", 28, 1, 1, 1, 0 }, | 206 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -229,7 +229,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
229 | { "+3.3V", 10, 0, 20, 1, 0 }, | 229 | { "+3.3V", 10, 0, 20, 1, 0 }, |
230 | { "5VSB", 11, 0, 30, 1, 0 }, | 230 | { "5VSB", 11, 0, 30, 1, 0 }, |
231 | { "CPU", 24, 1, 1, 1, 0 }, | 231 | { "CPU", 24, 1, 1, 1, 0 }, |
232 | { "System ", 25, 1, 1, 1, 0 }, | 232 | { "System", 25, 1, 1, 1, 0 }, |
233 | { "PWM", 26, 1, 1, 1, 0 }, | 233 | { "PWM", 26, 1, 1, 1, 0 }, |
234 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 234 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
235 | { "NB Fan", 33, 2, 60, 1, 0 }, | 235 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -250,7 +250,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
250 | { "+3.3V", 10, 0, 20, 1, 0 }, | 250 | { "+3.3V", 10, 0, 20, 1, 0 }, |
251 | { "5VSB", 11, 0, 30, 1, 0 }, | 251 | { "5VSB", 11, 0, 30, 1, 0 }, |
252 | { "CPU", 24, 1, 1, 1, 0 }, | 252 | { "CPU", 24, 1, 1, 1, 0 }, |
253 | { "System ", 25, 1, 1, 1, 0 }, | 253 | { "System", 25, 1, 1, 1, 0 }, |
254 | { "PWM", 26, 1, 1, 1, 0 }, | 254 | { "PWM", 26, 1, 1, 1, 0 }, |
255 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 255 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
256 | { "NB Fan", 33, 2, 60, 1, 0 }, | 256 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -342,7 +342,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
342 | { "+3.3V", 10, 0, 20, 1, 0 }, | 342 | { "+3.3V", 10, 0, 20, 1, 0 }, |
343 | { "5VSB", 11, 0, 30, 1, 0 }, | 343 | { "5VSB", 11, 0, 30, 1, 0 }, |
344 | { "CPU", 24, 1, 1, 1, 0 }, | 344 | { "CPU", 24, 1, 1, 1, 0 }, |
345 | { "System ", 25, 1, 1, 1, 0 }, | 345 | { "System", 25, 1, 1, 1, 0 }, |
346 | { "PWM1", 26, 1, 1, 1, 0 }, | 346 | { "PWM1", 26, 1, 1, 1, 0 }, |
347 | { "PWM2", 27, 1, 1, 1, 0 }, | 347 | { "PWM2", 27, 1, 1, 1, 0 }, |
348 | { "PWM3", 28, 1, 1, 1, 0 }, | 348 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -371,7 +371,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
371 | { "+3.3V", 10, 0, 20, 1, 0 }, | 371 | { "+3.3V", 10, 0, 20, 1, 0 }, |
372 | { "5VSB", 11, 0, 30, 1, 0 }, | 372 | { "5VSB", 11, 0, 30, 1, 0 }, |
373 | { "CPU", 24, 1, 1, 1, 0 }, | 373 | { "CPU", 24, 1, 1, 1, 0 }, |
374 | { "System ", 25, 1, 1, 1, 0 }, | 374 | { "System", 25, 1, 1, 1, 0 }, |
375 | { "PWM", 26, 1, 1, 1, 0 }, | 375 | { "PWM", 26, 1, 1, 1, 0 }, |
376 | { "CPU Fan", 32, 2, 60, 1, 0 }, | 376 | { "CPU Fan", 32, 2, 60, 1, 0 }, |
377 | { "NB Fan", 33, 2, 60, 1, 0 }, | 377 | { "NB Fan", 33, 2, 60, 1, 0 }, |
@@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, | 402 | { "AUX3 Fan", 36, 2, 60, 1, 0 }, |
403 | { NULL, 0, 0, 0, 0, 0 } } | 403 | { NULL, 0, 0, 0, 0, 0 } } |
404 | }, | 404 | }, |
405 | { 0x0016, NULL /* AW9D-MAX, need DMI string */, { | 405 | { 0x0016, "AW9D-MAX (Intel i975-ICH7)", { |
406 | { "CPU Core", 0, 0, 10, 1, 0 }, | 406 | { "CPU Core", 0, 0, 10, 1, 0 }, |
407 | { "DDR2", 1, 0, 20, 1, 0 }, | 407 | { "DDR2", 1, 0, 20, 1, 0 }, |
408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, | 408 | { "DDR2 VTT", 2, 0, 10, 1, 0 }, |
@@ -416,7 +416,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
416 | { "+3.3V", 10, 0, 20, 1, 0 }, | 416 | { "+3.3V", 10, 0, 20, 1, 0 }, |
417 | { "5VSB", 11, 0, 30, 1, 0 }, | 417 | { "5VSB", 11, 0, 30, 1, 0 }, |
418 | { "CPU", 24, 1, 1, 1, 0 }, | 418 | { "CPU", 24, 1, 1, 1, 0 }, |
419 | { "System ", 25, 1, 1, 1, 0 }, | 419 | { "System", 25, 1, 1, 1, 0 }, |
420 | { "PWM1", 26, 1, 1, 1, 0 }, | 420 | { "PWM1", 26, 1, 1, 1, 0 }, |
421 | { "PWM2", 27, 1, 1, 1, 0 }, | 421 | { "PWM2", 27, 1, 1, 1, 0 }, |
422 | { "PWM3", 28, 1, 1, 1, 0 }, | 422 | { "PWM3", 28, 1, 1, 1, 0 }, |
@@ -446,7 +446,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
446 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, | 446 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, |
447 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, | 447 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, |
448 | { "CPU", 24, 1, 1, 1, 0 }, | 448 | { "CPU", 24, 1, 1, 1, 0 }, |
449 | { "System ", 26, 1, 1, 1, 0 }, | 449 | { "System", 26, 1, 1, 1, 0 }, |
450 | { "PWM", 27, 1, 1, 1, 0 }, | 450 | { "PWM", 27, 1, 1, 1, 0 }, |
451 | { "CPU FAN", 32, 2, 60, 1, 0 }, | 451 | { "CPU FAN", 32, 2, 60, 1, 0 }, |
452 | { "SYS FAN", 34, 2, 60, 1, 0 }, | 452 | { "SYS FAN", 34, 2, 60, 1, 0 }, |
@@ -469,7 +469,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
469 | { "+3.3V", 10, 0, 20, 1, 0 }, | 469 | { "+3.3V", 10, 0, 20, 1, 0 }, |
470 | { "5VSB", 11, 0, 30, 1, 0 }, | 470 | { "5VSB", 11, 0, 30, 1, 0 }, |
471 | { "CPU", 24, 1, 1, 1, 0 }, | 471 | { "CPU", 24, 1, 1, 1, 0 }, |
472 | { "System ", 25, 1, 1, 1, 0 }, | 472 | { "System", 25, 1, 1, 1, 0 }, |
473 | { "PWM Phase1", 26, 1, 1, 1, 0 }, | 473 | { "PWM Phase1", 26, 1, 1, 1, 0 }, |
474 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 474 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
475 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 475 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
@@ -487,7 +487,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
487 | { "DDR2", 13, 0, 20, 1, 0 }, | 487 | { "DDR2", 13, 0, 20, 1, 0 }, |
488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, | 488 | { "DDR2 VTT", 14, 0, 10, 1, 0 }, |
489 | { "CPU VTT", 3, 0, 20, 1, 0 }, | 489 | { "CPU VTT", 3, 0, 20, 1, 0 }, |
490 | { "NB 1.2V ", 4, 0, 10, 1, 0 }, | 490 | { "NB 1.2V", 4, 0, 10, 1, 0 }, |
491 | { "SB 1.5V", 6, 0, 10, 1, 0 }, | 491 | { "SB 1.5V", 6, 0, 10, 1, 0 }, |
492 | { "HyperTransport", 5, 0, 10, 1, 0 }, | 492 | { "HyperTransport", 5, 0, 10, 1, 0 }, |
493 | { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, | 493 | { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, |
@@ -496,7 +496,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
496 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, | 496 | { "ATX +3.3V", 10, 0, 20, 1, 0 }, |
497 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, | 497 | { "ATX 5VSB", 11, 0, 30, 1, 0 }, |
498 | { "CPU", 24, 1, 1, 1, 0 }, | 498 | { "CPU", 24, 1, 1, 1, 0 }, |
499 | { "System ", 25, 1, 1, 1, 0 }, | 499 | { "System", 25, 1, 1, 1, 0 }, |
500 | { "PWM Phase1", 26, 1, 1, 1, 0 }, | 500 | { "PWM Phase1", 26, 1, 1, 1, 0 }, |
501 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 501 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
502 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 502 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
@@ -523,8 +523,8 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { | |||
523 | { "+3.3V", 10, 0, 20, 1, 0 }, | 523 | { "+3.3V", 10, 0, 20, 1, 0 }, |
524 | { "5VSB", 11, 0, 30, 1, 0 }, | 524 | { "5VSB", 11, 0, 30, 1, 0 }, |
525 | { "CPU", 24, 1, 1, 1, 0 }, | 525 | { "CPU", 24, 1, 1, 1, 0 }, |
526 | { "System ", 25, 1, 1, 1, 0 }, | 526 | { "System", 25, 1, 1, 1, 0 }, |
527 | { "PWM ", 26, 1, 1, 1, 0 }, | 527 | { "PWM", 26, 1, 1, 1, 0 }, |
528 | { "PWM Phase2", 27, 1, 1, 1, 0 }, | 528 | { "PWM Phase2", 27, 1, 1, 1, 0 }, |
529 | { "PWM Phase3", 28, 1, 1, 1, 0 }, | 529 | { "PWM Phase3", 28, 1, 1, 1, 0 }, |
530 | { "PWM Phase4", 29, 1, 1, 1, 0 }, | 530 | { "PWM Phase4", 29, 1, 1, 1, 0 }, |
@@ -947,7 +947,7 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) | |||
947 | if (!abituguru3_motherboards[i].dmi_name) { | 947 | if (!abituguru3_motherboards[i].dmi_name) { |
948 | printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " | 948 | printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " |
949 | "not detected using DMI. Please send the output of " | 949 | "not detected using DMI. Please send the output of " |
950 | "\"dmidecode\" to the abituguru3 maintainer" | 950 | "\"dmidecode\" to the abituguru3 maintainer " |
951 | "(see MAINTAINERS)\n"); | 951 | "(see MAINTAINERS)\n"); |
952 | } | 952 | } |
953 | #endif | 953 | #endif |
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 3a0b63136479..b9a8ea30c99c 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c | |||
@@ -319,35 +319,24 @@ out: | |||
319 | } | 319 | } |
320 | 320 | ||
321 | /* | 321 | /* |
322 | * On this chip, voltages are given as a count of steps between a minimum | 322 | * Conversions |
323 | * and maximum voltage, not a direct voltage. | ||
324 | */ | 323 | */ |
325 | static const int volt_convert_table[][2] = { | 324 | |
326 | {2997, 3}, | 325 | /* IN are scaled acording to built-in resistors */ |
327 | {4395, 4}, | 326 | static const int adt7473_scaling[] = { /* .001 Volts */ |
327 | 2250, 3300 | ||
328 | }; | 328 | }; |
329 | #define SCALE(val, from, to) (((val) * (to) + ((from) / 2)) / (from)) | ||
329 | 330 | ||
330 | static int decode_volt(int volt_index, u8 raw) | 331 | static int decode_volt(int volt_index, u8 raw) |
331 | { | 332 | { |
332 | int cmax = volt_convert_table[volt_index][0]; | 333 | return SCALE(raw, 192, adt7473_scaling[volt_index]); |
333 | int cmin = volt_convert_table[volt_index][1]; | ||
334 | return ((raw * (cmax - cmin)) / 255) + cmin; | ||
335 | } | 334 | } |
336 | 335 | ||
337 | static u8 encode_volt(int volt_index, int cooked) | 336 | static u8 encode_volt(int volt_index, int cooked) |
338 | { | 337 | { |
339 | int cmax = volt_convert_table[volt_index][0]; | 338 | int raw = SCALE(cooked, adt7473_scaling[volt_index], 192); |
340 | int cmin = volt_convert_table[volt_index][1]; | 339 | return SENSORS_LIMIT(raw, 0, 255); |
341 | u8 x; | ||
342 | |||
343 | if (cooked > cmax) | ||
344 | cooked = cmax; | ||
345 | else if (cooked < cmin) | ||
346 | cooked = cmin; | ||
347 | |||
348 | x = ((cooked - cmin) * 255) / (cmax - cmin); | ||
349 | |||
350 | return x; | ||
351 | } | 340 | } |
352 | 341 | ||
353 | static ssize_t show_volt_min(struct device *dev, | 342 | static ssize_t show_volt_min(struct device *dev, |
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index c54eff92be4a..bfc296145bba 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -180,6 +180,7 @@ static struct vrm_model vrm_models[] = { | |||
180 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ | 180 | {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ |
181 | {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ | 181 | {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ |
182 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ | 182 | {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ |
183 | {X86_VENDOR_AMD, 0x10, ANY, ANY, 25}, /* NPT family 10h */ | ||
183 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ | 184 | {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ |
184 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ | 185 | {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ |
185 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ | 186 | {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */ |
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 3edeebc0b835..96a701866726 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -12,9 +12,9 @@ | |||
12 | * made by National Semiconductor. Both have an increased remote | 12 | * made by National Semiconductor. Both have an increased remote |
13 | * temperature measurement accuracy (1 degree), and the LM99 | 13 | * temperature measurement accuracy (1 degree), and the LM99 |
14 | * additionally shifts remote temperatures (measured and limits) by 16 | 14 | * additionally shifts remote temperatures (measured and limits) by 16 |
15 | * degrees, which allows for higher temperatures measurement. The | 15 | * degrees, which allows for higher temperatures measurement. |
16 | * driver doesn't handle it since it can be done easily in user-space. | ||
17 | * Note that there is no way to differentiate between both chips. | 16 | * Note that there is no way to differentiate between both chips. |
17 | * When device is auto-detected, the driver will assume an LM99. | ||
18 | * | 18 | * |
19 | * This driver also supports the LM86, another sensor chip made by | 19 | * This driver also supports the LM86, another sensor chip made by |
20 | * National Semiconductor. It is exactly similar to the LM90 except it | 20 | * National Semiconductor. It is exactly similar to the LM90 except it |
@@ -169,8 +169,8 @@ static const struct i2c_device_id lm90_id[] = { | |||
169 | { "adt7461", adt7461 }, | 169 | { "adt7461", adt7461 }, |
170 | { "lm90", lm90 }, | 170 | { "lm90", lm90 }, |
171 | { "lm86", lm86 }, | 171 | { "lm86", lm86 }, |
172 | { "lm89", lm99 }, | 172 | { "lm89", lm86 }, |
173 | { "lm99", lm99 }, /* Missing temperature offset */ | 173 | { "lm99", lm99 }, |
174 | { "max6646", max6646 }, | 174 | { "max6646", max6646 }, |
175 | { "max6647", max6646 }, | 175 | { "max6647", max6646 }, |
176 | { "max6649", max6646 }, | 176 | { "max6649", max6646 }, |
@@ -366,6 +366,10 @@ static ssize_t show_temp8(struct device *dev, struct device_attribute *devattr, | |||
366 | else | 366 | else |
367 | temp = temp_from_s8(data->temp8[attr->index]); | 367 | temp = temp_from_s8(data->temp8[attr->index]); |
368 | 368 | ||
369 | /* +16 degrees offset for temp2 for the LM99 */ | ||
370 | if (data->kind == lm99 && attr->index == 3) | ||
371 | temp += 16000; | ||
372 | |||
369 | return sprintf(buf, "%d\n", temp); | 373 | return sprintf(buf, "%d\n", temp); |
370 | } | 374 | } |
371 | 375 | ||
@@ -385,6 +389,10 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr, | |||
385 | long val = simple_strtol(buf, NULL, 10); | 389 | long val = simple_strtol(buf, NULL, 10); |
386 | int nr = attr->index; | 390 | int nr = attr->index; |
387 | 391 | ||
392 | /* +16 degrees offset for temp2 for the LM99 */ | ||
393 | if (data->kind == lm99 && attr->index == 3) | ||
394 | val -= 16000; | ||
395 | |||
388 | mutex_lock(&data->update_lock); | 396 | mutex_lock(&data->update_lock); |
389 | if (data->kind == adt7461) | 397 | if (data->kind == adt7461) |
390 | data->temp8[nr] = temp_to_u8_adt7461(data, val); | 398 | data->temp8[nr] = temp_to_u8_adt7461(data, val); |
@@ -411,6 +419,10 @@ static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr, | |||
411 | else | 419 | else |
412 | temp = temp_from_s16(data->temp11[attr->index]); | 420 | temp = temp_from_s16(data->temp11[attr->index]); |
413 | 421 | ||
422 | /* +16 degrees offset for temp2 for the LM99 */ | ||
423 | if (data->kind == lm99 && attr->index <= 2) | ||
424 | temp += 16000; | ||
425 | |||
414 | return sprintf(buf, "%d\n", temp); | 426 | return sprintf(buf, "%d\n", temp); |
415 | } | 427 | } |
416 | 428 | ||
@@ -432,6 +444,10 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr, | |||
432 | long val = simple_strtol(buf, NULL, 10); | 444 | long val = simple_strtol(buf, NULL, 10); |
433 | int nr = attr->index; | 445 | int nr = attr->index; |
434 | 446 | ||
447 | /* +16 degrees offset for temp2 for the LM99 */ | ||
448 | if (data->kind == lm99 && attr->index <= 2) | ||
449 | val -= 16000; | ||
450 | |||
435 | mutex_lock(&data->update_lock); | 451 | mutex_lock(&data->update_lock); |
436 | if (data->kind == adt7461) | 452 | if (data->kind == adt7461) |
437 | data->temp11[nr] = temp_to_u16_adt7461(data, val); | 453 | data->temp11[nr] = temp_to_u16_adt7461(data, val); |
@@ -461,9 +477,15 @@ static ssize_t show_temphyst(struct device *dev, struct device_attribute *devatt | |||
461 | 477 | ||
462 | if (data->kind == adt7461) | 478 | if (data->kind == adt7461) |
463 | temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); | 479 | temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); |
480 | else if (data->kind == max6646) | ||
481 | temp = temp_from_u8(data->temp8[attr->index]); | ||
464 | else | 482 | else |
465 | temp = temp_from_s8(data->temp8[attr->index]); | 483 | temp = temp_from_s8(data->temp8[attr->index]); |
466 | 484 | ||
485 | /* +16 degrees offset for temp2 for the LM99 */ | ||
486 | if (data->kind == lm99 && attr->index == 3) | ||
487 | temp += 16000; | ||
488 | |||
467 | return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); | 489 | return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); |
468 | } | 490 | } |
469 | 491 | ||
@@ -473,12 +495,19 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy, | |||
473 | struct i2c_client *client = to_i2c_client(dev); | 495 | struct i2c_client *client = to_i2c_client(dev); |
474 | struct lm90_data *data = i2c_get_clientdata(client); | 496 | struct lm90_data *data = i2c_get_clientdata(client); |
475 | long val = simple_strtol(buf, NULL, 10); | 497 | long val = simple_strtol(buf, NULL, 10); |
476 | long hyst; | 498 | int temp; |
477 | 499 | ||
478 | mutex_lock(&data->update_lock); | 500 | mutex_lock(&data->update_lock); |
479 | hyst = temp_from_s8(data->temp8[2]) - val; | 501 | if (data->kind == adt7461) |
502 | temp = temp_from_u8_adt7461(data, data->temp8[2]); | ||
503 | else if (data->kind == max6646) | ||
504 | temp = temp_from_u8(data->temp8[2]); | ||
505 | else | ||
506 | temp = temp_from_s8(data->temp8[2]); | ||
507 | |||
508 | data->temp_hyst = hyst_to_reg(temp - val); | ||
480 | i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, | 509 | i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, |
481 | hyst_to_reg(hyst)); | 510 | data->temp_hyst); |
482 | mutex_unlock(&data->update_lock); | 511 | mutex_unlock(&data->update_lock); |
483 | return count; | 512 | return count; |
484 | } | 513 | } |
@@ -682,6 +711,15 @@ static int lm90_detect(struct i2c_client *new_client, int kind, | |||
682 | } else | 711 | } else |
683 | if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ | 712 | if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ |
684 | kind = lm99; | 713 | kind = lm99; |
714 | dev_info(&adapter->dev, | ||
715 | "Assuming LM99 chip at " | ||
716 | "0x%02x\n", address); | ||
717 | dev_info(&adapter->dev, | ||
718 | "If it is an LM89, pass " | ||
719 | "force_lm86=%d,0x%02x when " | ||
720 | "loading the lm90 driver\n", | ||
721 | i2c_adapter_id(adapter), | ||
722 | address); | ||
685 | } else | 723 | } else |
686 | if (address == 0x4C | 724 | if (address == 0x4C |
687 | && (chip_id & 0xF0) == 0x10) { /* LM86 */ | 725 | && (chip_id & 0xF0) == 0x10) { /* LM86 */ |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index d4d1b859d4f1..fc12bd412e3a 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -1968,7 +1968,7 @@ exit: | |||
1968 | return res; | 1968 | return res; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | static void __exit | 1971 | static void |
1972 | w83781d_isa_unregister(void) | 1972 | w83781d_isa_unregister(void) |
1973 | { | 1973 | { |
1974 | if (pdev) { | 1974 | if (pdev) { |
@@ -2017,7 +2017,7 @@ w83781d_isa_register(void) | |||
2017 | return 0; | 2017 | return 0; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | static void __exit | 2020 | static void |
2021 | w83781d_isa_unregister(void) | 2021 | w83781d_isa_unregister(void) |
2022 | { | 2022 | { |
2023 | } | 2023 | } |