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/applesmc: Handle name file creation error and deletion
hwmon/applesmc: Simplify dependencies
hwmon-vid: Don't spam the logs when VRM version is missing
hwmon/w83627hf: Be quiet when no chip is found
hwmon/coretemp: Add more safety checks
hwmon/ds1621: Fix swapped temperature limits

+46 -11
+1 -1
drivers/hwmon/Kconfig
··· 620 620 621 621 config SENSORS_APPLESMC 622 622 tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" 623 - depends on HWMON && INPUT && X86 623 + depends on INPUT && X86 624 624 select NEW_LEDS 625 625 select LEDS_CLASS 626 626 default n
+6 -1
drivers/hwmon/applesmc.c
··· 1206 1206 } 1207 1207 1208 1208 ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr); 1209 + if (ret) 1210 + goto out_device; 1209 1211 1210 1212 /* Create key enumeration sysfs files */ 1211 1213 ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); 1212 1214 if (ret) 1213 - goto out_device; 1215 + goto out_name; 1214 1216 1215 1217 /* create fan files */ 1216 1218 count = applesmc_get_fan_count(); ··· 1312 1310 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); 1313 1311 out_key_enumeration: 1314 1312 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); 1313 + out_name: 1314 + sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); 1315 1315 out_device: 1316 1316 platform_device_unregister(pdev); 1317 1317 out_driver: ··· 1339 1335 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); 1340 1336 sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); 1341 1337 sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); 1338 + sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); 1342 1339 platform_device_unregister(pdev); 1343 1340 platform_driver_unregister(&applesmc_driver); 1344 1341 release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
+29 -3
drivers/hwmon/coretemp.c
··· 176 176 goto exit_free; 177 177 } 178 178 179 + /* Check if we have problem with errata AE18 of Core processors: 180 + Readings might stop update when processor visited too deep sleep, 181 + fixed for stepping D0 (6EC). 182 + */ 183 + 184 + if ((c->x86_model == 0xe) && (c->x86_mask < 0xc)) { 185 + /* check for microcode update */ 186 + rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx); 187 + if (edx < 0x39) { 188 + dev_err(&pdev->dev, 189 + "Errata AE18 not fixed, update BIOS or " 190 + "microcode of the CPU!\n"); 191 + goto exit_free; 192 + } 193 + } 194 + 179 195 /* Some processors have Tjmax 85 following magic should detect it 180 196 Intel won't disclose the information without signed NDA, but 181 197 individuals cannot sign it. Catch(ed) 22. ··· 207 191 } else if (eax & 0x40000000) { 208 192 data->tjmax = 85000; 209 193 } 194 + } 195 + 196 + /* Intel says that above should not work for desktop Core2 processors, 197 + but it seems to work. There is no other way how get the absolute 198 + readings. Warn the user about this. First check if are desktop, 199 + bit 50 of MSR_IA32_PLATFORM_ID should be 0. 200 + */ 201 + 202 + rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx); 203 + 204 + if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) { 205 + dev_warn(&pdev->dev, "Using undocumented features, absolute " 206 + "temperature might be wrong!\n"); 210 207 } 211 208 212 209 platform_set_drvdata(pdev, data); ··· 358 329 { 359 330 int i, err = -ENODEV; 360 331 struct pdev_entry *p, *n; 361 - 362 - printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features " 363 - "of Core CPU. Temperature might be wrong!\n"); 364 332 365 333 /* quick check if we run Intel */ 366 334 if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL)
+4 -4
drivers/hwmon/ds1621.c
··· 53 53 54 54 /* The DS1621 registers */ 55 55 #define DS1621_REG_TEMP 0xAA /* word, RO */ 56 - #define DS1621_REG_TEMP_MIN 0xA1 /* word, RW */ 57 - #define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */ 56 + #define DS1621_REG_TEMP_MIN 0xA2 /* word, RW */ 57 + #define DS1621_REG_TEMP_MAX 0xA1 /* word, RW */ 58 58 #define DS1621_REG_CONF 0xAC /* byte, RW */ 59 59 #define DS1621_COM_START 0xEE /* no data */ 60 60 #define DS1621_COM_STOP 0x22 /* no data */ ··· 328 328 329 329 /* reset alarms if necessary */ 330 330 new_conf = data->conf; 331 - if (data->temp < data->temp_min) 331 + if (data->temp > data->temp_min) 332 332 new_conf &= ~DS1621_ALARM_TEMP_LOW; 333 - if (data->temp > data->temp_max) 333 + if (data->temp < data->temp_max) 334 334 new_conf &= ~DS1621_ALARM_TEMP_HIGH; 335 335 if (data->conf != new_conf) 336 336 ds1621_write_value(client, DS1621_REG_CONF,
+3 -1
drivers/hwmon/hwmon-vid.c
··· 132 132 val &= 0x7f; 133 133 return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); 134 134 default: /* report 0 for unknown */ 135 - printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); 135 + if (vrm) 136 + printk(KERN_WARNING "hwmon-vid: Requested unsupported " 137 + "VRM version (%u)\n", (unsigned int)vrm); 136 138 return 0; 137 139 } 138 140 }
+3 -1
drivers/hwmon/w83627hf.c
··· 965 965 case W687THF_DEVID: 966 966 sio_data->type = w83687thf; 967 967 break; 968 + case 0xff: /* No device at all */ 969 + goto exit; 968 970 default: 969 - pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%x)\n", val); 971 + pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%02x)\n", val); 970 972 goto exit; 971 973 } 972 974