Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+73 -45
+1 -1
Documentation/hwmon/lm90
··· 8 8 Datasheet: Publicly available at the National Semiconductor website 9 9 http://www.national.com/pf/LM/LM90.html 10 10 * National Semiconductor LM89 11 - Prefix: 'lm99' 11 + Prefix: 'lm89' (no auto-detection) 12 12 Addresses scanned: I2C 0x4c and 0x4d 13 13 Datasheet: Publicly available at the National Semiconductor website 14 14 http://www.national.com/mpf/LM/LM89.html
+15 -15
drivers/hwmon/abituguru3.c
··· 178 178 { "+3.3V", 10, 0, 20, 1, 0 }, 179 179 { "5VSB", 11, 0, 30, 1, 0 }, 180 180 { "CPU", 24, 1, 1, 1, 0 }, 181 - { "System ", 25, 1, 1, 1, 0 }, 181 + { "System", 25, 1, 1, 1, 0 }, 182 182 { "PWM", 26, 1, 1, 1, 0 }, 183 183 { "CPU Fan", 32, 2, 60, 1, 0 }, 184 184 { "NB Fan", 33, 2, 60, 1, 0 }, ··· 200 200 { "+3.3V", 10, 0, 20, 1, 0 }, 201 201 { "5VSB", 11, 0, 30, 1, 0 }, 202 202 { "CPU", 24, 1, 1, 1, 0 }, 203 - { "System ", 25, 1, 1, 1, 0 }, 203 + { "System", 25, 1, 1, 1, 0 }, 204 204 { "PWM1", 26, 1, 1, 1, 0 }, 205 205 { "PWM2", 27, 1, 1, 1, 0 }, 206 206 { "PWM3", 28, 1, 1, 1, 0 }, ··· 229 229 { "+3.3V", 10, 0, 20, 1, 0 }, 230 230 { "5VSB", 11, 0, 30, 1, 0 }, 231 231 { "CPU", 24, 1, 1, 1, 0 }, 232 - { "System ", 25, 1, 1, 1, 0 }, 232 + { "System", 25, 1, 1, 1, 0 }, 233 233 { "PWM", 26, 1, 1, 1, 0 }, 234 234 { "CPU Fan", 32, 2, 60, 1, 0 }, 235 235 { "NB Fan", 33, 2, 60, 1, 0 }, ··· 250 250 { "+3.3V", 10, 0, 20, 1, 0 }, 251 251 { "5VSB", 11, 0, 30, 1, 0 }, 252 252 { "CPU", 24, 1, 1, 1, 0 }, 253 - { "System ", 25, 1, 1, 1, 0 }, 253 + { "System", 25, 1, 1, 1, 0 }, 254 254 { "PWM", 26, 1, 1, 1, 0 }, 255 255 { "CPU Fan", 32, 2, 60, 1, 0 }, 256 256 { "NB Fan", 33, 2, 60, 1, 0 }, ··· 342 342 { "+3.3V", 10, 0, 20, 1, 0 }, 343 343 { "5VSB", 11, 0, 30, 1, 0 }, 344 344 { "CPU", 24, 1, 1, 1, 0 }, 345 - { "System ", 25, 1, 1, 1, 0 }, 345 + { "System", 25, 1, 1, 1, 0 }, 346 346 { "PWM1", 26, 1, 1, 1, 0 }, 347 347 { "PWM2", 27, 1, 1, 1, 0 }, 348 348 { "PWM3", 28, 1, 1, 1, 0 }, ··· 371 371 { "+3.3V", 10, 0, 20, 1, 0 }, 372 372 { "5VSB", 11, 0, 30, 1, 0 }, 373 373 { "CPU", 24, 1, 1, 1, 0 }, 374 - { "System ", 25, 1, 1, 1, 0 }, 374 + { "System", 25, 1, 1, 1, 0 }, 375 375 { "PWM", 26, 1, 1, 1, 0 }, 376 376 { "CPU Fan", 32, 2, 60, 1, 0 }, 377 377 { "NB Fan", 33, 2, 60, 1, 0 }, ··· 402 402 { "AUX3 Fan", 36, 2, 60, 1, 0 }, 403 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 406 { "CPU Core", 0, 0, 10, 1, 0 }, 407 407 { "DDR2", 1, 0, 20, 1, 0 }, 408 408 { "DDR2 VTT", 2, 0, 10, 1, 0 }, ··· 416 416 { "+3.3V", 10, 0, 20, 1, 0 }, 417 417 { "5VSB", 11, 0, 30, 1, 0 }, 418 418 { "CPU", 24, 1, 1, 1, 0 }, 419 - { "System ", 25, 1, 1, 1, 0 }, 419 + { "System", 25, 1, 1, 1, 0 }, 420 420 { "PWM1", 26, 1, 1, 1, 0 }, 421 421 { "PWM2", 27, 1, 1, 1, 0 }, 422 422 { "PWM3", 28, 1, 1, 1, 0 }, ··· 446 446 { "ATX +3.3V", 10, 0, 20, 1, 0 }, 447 447 { "ATX 5VSB", 11, 0, 30, 1, 0 }, 448 448 { "CPU", 24, 1, 1, 1, 0 }, 449 - { "System ", 26, 1, 1, 1, 0 }, 449 + { "System", 26, 1, 1, 1, 0 }, 450 450 { "PWM", 27, 1, 1, 1, 0 }, 451 451 { "CPU FAN", 32, 2, 60, 1, 0 }, 452 452 { "SYS FAN", 34, 2, 60, 1, 0 }, ··· 469 469 { "+3.3V", 10, 0, 20, 1, 0 }, 470 470 { "5VSB", 11, 0, 30, 1, 0 }, 471 471 { "CPU", 24, 1, 1, 1, 0 }, 472 - { "System ", 25, 1, 1, 1, 0 }, 472 + { "System", 25, 1, 1, 1, 0 }, 473 473 { "PWM Phase1", 26, 1, 1, 1, 0 }, 474 474 { "PWM Phase2", 27, 1, 1, 1, 0 }, 475 475 { "PWM Phase3", 28, 1, 1, 1, 0 }, ··· 487 487 { "DDR2", 13, 0, 20, 1, 0 }, 488 488 { "DDR2 VTT", 14, 0, 10, 1, 0 }, 489 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 491 { "SB 1.5V", 6, 0, 10, 1, 0 }, 492 492 { "HyperTransport", 5, 0, 10, 1, 0 }, 493 493 { "ATX +12V (24-Pin)", 12, 0, 60, 1, 0 }, ··· 496 496 { "ATX +3.3V", 10, 0, 20, 1, 0 }, 497 497 { "ATX 5VSB", 11, 0, 30, 1, 0 }, 498 498 { "CPU", 24, 1, 1, 1, 0 }, 499 - { "System ", 25, 1, 1, 1, 0 }, 499 + { "System", 25, 1, 1, 1, 0 }, 500 500 { "PWM Phase1", 26, 1, 1, 1, 0 }, 501 501 { "PWM Phase2", 27, 1, 1, 1, 0 }, 502 502 { "PWM Phase3", 28, 1, 1, 1, 0 }, ··· 523 523 { "+3.3V", 10, 0, 20, 1, 0 }, 524 524 { "5VSB", 11, 0, 30, 1, 0 }, 525 525 { "CPU", 24, 1, 1, 1, 0 }, 526 - { "System ", 25, 1, 1, 1, 0 }, 527 - { "PWM ", 26, 1, 1, 1, 0 }, 526 + { "System", 25, 1, 1, 1, 0 }, 527 + { "PWM", 26, 1, 1, 1, 0 }, 528 528 { "PWM Phase2", 27, 1, 1, 1, 0 }, 529 529 { "PWM Phase3", 28, 1, 1, 1, 0 }, 530 530 { "PWM Phase4", 29, 1, 1, 1, 0 }, ··· 947 947 if (!abituguru3_motherboards[i].dmi_name) { 948 948 printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " 949 949 "not detected using DMI. Please send the output of " 950 - "\"dmidecode\" to the abituguru3 maintainer" 950 + "\"dmidecode\" to the abituguru3 maintainer " 951 951 "(see MAINTAINERS)\n"); 952 952 } 953 953 #endif
+9 -20
drivers/hwmon/adt7473.c
··· 319 319 } 320 320 321 321 /* 322 - * On this chip, voltages are given as a count of steps between a minimum 323 - * and maximum voltage, not a direct voltage. 322 + * Conversions 324 323 */ 325 - static const int volt_convert_table[][2] = { 326 - {2997, 3}, 327 - {4395, 4}, 324 + 325 + /* IN are scaled acording to built-in resistors */ 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 331 static int decode_volt(int volt_index, u8 raw) 331 332 { 332 - int cmax = volt_convert_table[volt_index][0]; 333 - int cmin = volt_convert_table[volt_index][1]; 334 - return ((raw * (cmax - cmin)) / 255) + cmin; 333 + return SCALE(raw, 192, adt7473_scaling[volt_index]); 335 334 } 336 335 337 336 static u8 encode_volt(int volt_index, int cooked) 338 337 { 339 - int cmax = volt_convert_table[volt_index][0]; 340 - int cmin = volt_convert_table[volt_index][1]; 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; 338 + int raw = SCALE(cooked, adt7473_scaling[volt_index], 192); 339 + return SENSORS_LIMIT(raw, 0, 255); 351 340 } 352 341 353 342 static ssize_t show_volt_min(struct device *dev,
+1
drivers/hwmon/hwmon-vid.c
··· 180 180 {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ 181 181 {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24}, /* Athlon 64, Opteron */ 182 182 {X86_VENDOR_AMD, 0xF, ANY, ANY, 25}, /* NPT family 0Fh */ 183 + {X86_VENDOR_AMD, 0x10, ANY, ANY, 25}, /* NPT family 10h */ 183 184 {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */ 184 185 {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ 185 186 {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */
+45 -7
drivers/hwmon/lm90.c
··· 12 12 * made by National Semiconductor. Both have an increased remote 13 13 * temperature measurement accuracy (1 degree), and the LM99 14 14 * additionally shifts remote temperatures (measured and limits) by 16 15 - * degrees, which allows for higher temperatures measurement. The 16 - * driver doesn't handle it since it can be done easily in user-space. 15 + * degrees, which allows for higher temperatures measurement. 17 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 19 * This driver also supports the LM86, another sensor chip made by 20 20 * National Semiconductor. It is exactly similar to the LM90 except it ··· 169 169 { "adt7461", adt7461 }, 170 170 { "lm90", lm90 }, 171 171 { "lm86", lm86 }, 172 - { "lm89", lm99 }, 173 - { "lm99", lm99 }, /* Missing temperature offset */ 172 + { "lm89", lm86 }, 173 + { "lm99", lm99 }, 174 174 { "max6646", max6646 }, 175 175 { "max6647", max6646 }, 176 176 { "max6649", max6646 }, ··· 366 366 else 367 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 373 return sprintf(buf, "%d\n", temp); 370 374 } 371 375 ··· 388 384 struct lm90_data *data = i2c_get_clientdata(client); 389 385 long val = simple_strtol(buf, NULL, 10); 390 386 int nr = attr->index; 387 + 388 + /* +16 degrees offset for temp2 for the LM99 */ 389 + if (data->kind == lm99 && attr->index == 3) 390 + val -= 16000; 391 391 392 392 mutex_lock(&data->update_lock); 393 393 if (data->kind == adt7461) ··· 419 411 else 420 412 temp = temp_from_s16(data->temp11[attr->index]); 421 413 414 + /* +16 degrees offset for temp2 for the LM99 */ 415 + if (data->kind == lm99 && attr->index <= 2) 416 + temp += 16000; 417 + 422 418 return sprintf(buf, "%d\n", temp); 423 419 } 424 420 ··· 443 431 struct lm90_data *data = i2c_get_clientdata(client); 444 432 long val = simple_strtol(buf, NULL, 10); 445 433 int nr = attr->index; 434 + 435 + /* +16 degrees offset for temp2 for the LM99 */ 436 + if (data->kind == lm99 && attr->index <= 2) 437 + val -= 16000; 446 438 447 439 mutex_lock(&data->update_lock); 448 440 if (data->kind == adt7461) ··· 477 461 478 462 if (data->kind == adt7461) 479 463 temp = temp_from_u8_adt7461(data, data->temp8[attr->index]); 464 + else if (data->kind == max6646) 465 + temp = temp_from_u8(data->temp8[attr->index]); 480 466 else 481 467 temp = temp_from_s8(data->temp8[attr->index]); 468 + 469 + /* +16 degrees offset for temp2 for the LM99 */ 470 + if (data->kind == lm99 && attr->index == 3) 471 + temp += 16000; 482 472 483 473 return sprintf(buf, "%d\n", temp - temp_from_s8(data->temp_hyst)); 484 474 } ··· 495 473 struct i2c_client *client = to_i2c_client(dev); 496 474 struct lm90_data *data = i2c_get_clientdata(client); 497 475 long val = simple_strtol(buf, NULL, 10); 498 - long hyst; 476 + int temp; 499 477 500 478 mutex_lock(&data->update_lock); 501 - hyst = temp_from_s8(data->temp8[2]) - val; 479 + if (data->kind == adt7461) 480 + temp = temp_from_u8_adt7461(data, data->temp8[2]); 481 + else if (data->kind == max6646) 482 + temp = temp_from_u8(data->temp8[2]); 483 + else 484 + temp = temp_from_s8(data->temp8[2]); 485 + 486 + data->temp_hyst = hyst_to_reg(temp - val); 502 487 i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST, 503 - hyst_to_reg(hyst)); 488 + data->temp_hyst); 504 489 mutex_unlock(&data->update_lock); 505 490 return count; 506 491 } ··· 711 682 } else 712 683 if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */ 713 684 kind = lm99; 685 + dev_info(&adapter->dev, 686 + "Assuming LM99 chip at " 687 + "0x%02x\n", address); 688 + dev_info(&adapter->dev, 689 + "If it is an LM89, pass " 690 + "force_lm86=%d,0x%02x when " 691 + "loading the lm90 driver\n", 692 + i2c_adapter_id(adapter), 693 + address); 714 694 } else 715 695 if (address == 0x4C 716 696 && (chip_id & 0xF0) == 0x10) { /* LM86 */
+2 -2
drivers/hwmon/w83781d.c
··· 1968 1968 return res; 1969 1969 } 1970 1970 1971 - static void __exit 1971 + static void 1972 1972 w83781d_isa_unregister(void) 1973 1973 { 1974 1974 if (pdev) { ··· 2017 2017 return 0; 2018 2018 } 2019 2019 2020 - static void __exit 2020 + static void 2021 2021 w83781d_isa_unregister(void) 2022 2022 { 2023 2023 }