Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (asus_atk0110) Fix upper limit readings
hwmon: (smsc47m1) Differentiate between LPC47M233 and LPC47M292

+16 -1
+5 -1
drivers/hwmon/asus_atk0110.c
··· 593 593 sensor->data = data; 594 594 sensor->id = flags->integer.value; 595 595 sensor->limit1 = limit1->integer.value; 596 - sensor->limit2 = limit2->integer.value; 596 + if (data->old_interface) 597 + sensor->limit2 = limit2->integer.value; 598 + else 599 + /* The upper limit is expressed as delta from lower limit */ 600 + sensor->limit2 = sensor->limit1 + limit2->integer.value; 597 601 598 602 snprintf(sensor->input_attr_name, ATTR_NAME_SIZE, 599 603 "%s%d_input", base_name, start + *num);
+11
drivers/hwmon/smsc47m1.c
··· 86 86 #define SUPERIO_REG_ACT 0x30 87 87 #define SUPERIO_REG_BASE 0x60 88 88 #define SUPERIO_REG_DEVID 0x20 89 + #define SUPERIO_REG_DEVREV 0x21 89 90 90 91 /* Logical device registers */ 91 92 ··· 430 429 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it 431 430 * supports a 3rd fan, and the pin configuration registers are 432 431 * unfortunately different. 432 + * The LPC47M233 has the same device id (0x6B) but is not compatible. 433 + * We check the high bit of the device revision register to 434 + * differentiate them. 433 435 */ 434 436 switch (val) { 435 437 case 0x51: ··· 452 448 sio_data->type = smsc47m1; 453 449 break; 454 450 case 0x6B: 451 + if (superio_inb(SUPERIO_REG_DEVREV) & 0x80) { 452 + pr_debug(DRVNAME ": " 453 + "Found SMSC LPC47M233, unsupported\n"); 454 + superio_exit(); 455 + return -ENODEV; 456 + } 457 + 455 458 pr_info(DRVNAME ": Found SMSC LPC47M292\n"); 456 459 sio_data->type = smsc47m2; 457 460 break;