diff options
| -rw-r--r-- | drivers/hwmon/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/hwmon/applesmc.c | 7 | ||||
| -rw-r--r-- | drivers/hwmon/coretemp.c | 32 | ||||
| -rw-r--r-- | drivers/hwmon/ds1621.c | 8 | ||||
| -rw-r--r-- | drivers/hwmon/hwmon-vid.c | 4 | ||||
| -rw-r--r-- | drivers/hwmon/w83627hf.c | 4 |
6 files changed, 46 insertions, 11 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4d1cb5b855d1..13eea47dceb3 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
| @@ -620,7 +620,7 @@ config SENSORS_HDAPS | |||
| 620 | 620 | ||
| 621 | config SENSORS_APPLESMC | 621 | config SENSORS_APPLESMC |
| 622 | tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" | 622 | tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" |
| 623 | depends on HWMON && INPUT && X86 | 623 | depends on INPUT && X86 |
| 624 | select NEW_LEDS | 624 | select NEW_LEDS |
| 625 | select LEDS_CLASS | 625 | select LEDS_CLASS |
| 626 | default n | 626 | default n |
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 366f4a1a2cb8..fd1281f42209 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
| @@ -1206,11 +1206,13 @@ static int __init applesmc_init(void) | |||
| 1206 | } | 1206 | } |
| 1207 | 1207 | ||
| 1208 | ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr); | 1208 | ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr); |
| 1209 | if (ret) | ||
| 1210 | goto out_device; | ||
| 1209 | 1211 | ||
| 1210 | /* Create key enumeration sysfs files */ | 1212 | /* Create key enumeration sysfs files */ |
| 1211 | ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); | 1213 | ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); |
| 1212 | if (ret) | 1214 | if (ret) |
| 1213 | goto out_device; | 1215 | goto out_name; |
| 1214 | 1216 | ||
| 1215 | /* create fan files */ | 1217 | /* create fan files */ |
| 1216 | count = applesmc_get_fan_count(); | 1218 | count = applesmc_get_fan_count(); |
| @@ -1310,6 +1312,8 @@ out_fan_1: | |||
| 1310 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); | 1312 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); |
| 1311 | out_key_enumeration: | 1313 | out_key_enumeration: |
| 1312 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); | 1314 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); |
| 1315 | out_name: | ||
| 1316 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); | ||
| 1313 | out_device: | 1317 | out_device: |
| 1314 | platform_device_unregister(pdev); | 1318 | platform_device_unregister(pdev); |
| 1315 | out_driver: | 1319 | out_driver: |
| @@ -1335,6 +1339,7 @@ static void __exit applesmc_exit(void) | |||
| 1335 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); | 1339 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); |
| 1336 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); | 1340 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); |
| 1337 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); | 1341 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); |
| 1342 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); | ||
| 1338 | platform_device_unregister(pdev); | 1343 | platform_device_unregister(pdev); |
| 1339 | platform_driver_unregister(&applesmc_driver); | 1344 | platform_driver_unregister(&applesmc_driver); |
| 1340 | release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); | 1345 | release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 75e3911810a3..0328382df8fa 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
| @@ -176,6 +176,22 @@ static int __devinit coretemp_probe(struct platform_device *pdev) | |||
| 176 | goto exit_free; | 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 | /* Some processors have Tjmax 85 following magic should detect it | 195 | /* Some processors have Tjmax 85 following magic should detect it |
| 180 | Intel won't disclose the information without signed NDA, but | 196 | Intel won't disclose the information without signed NDA, but |
| 181 | individuals cannot sign it. Catch(ed) 22. | 197 | individuals cannot sign it. Catch(ed) 22. |
| @@ -193,6 +209,19 @@ static int __devinit coretemp_probe(struct platform_device *pdev) | |||
| 193 | } | 209 | } |
| 194 | } | 210 | } |
| 195 | 211 | ||
| 212 | /* Intel says that above should not work for desktop Core2 processors, | ||
| 213 | but it seems to work. There is no other way how get the absolute | ||
| 214 | readings. Warn the user about this. First check if are desktop, | ||
| 215 | bit 50 of MSR_IA32_PLATFORM_ID should be 0. | ||
| 216 | */ | ||
| 217 | |||
| 218 | rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx); | ||
| 219 | |||
| 220 | if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) { | ||
| 221 | dev_warn(&pdev->dev, "Using undocumented features, absolute " | ||
| 222 | "temperature might be wrong!\n"); | ||
| 223 | } | ||
| 224 | |||
| 196 | platform_set_drvdata(pdev, data); | 225 | platform_set_drvdata(pdev, data); |
| 197 | 226 | ||
| 198 | if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) | 227 | if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) |
| @@ -330,9 +359,6 @@ static int __init coretemp_init(void) | |||
| 330 | int i, err = -ENODEV; | 359 | int i, err = -ENODEV; |
| 331 | struct pdev_entry *p, *n; | 360 | struct pdev_entry *p, *n; |
| 332 | 361 | ||
| 333 | printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features " | ||
| 334 | "of Core CPU. Temperature might be wrong!\n"); | ||
| 335 | |||
| 336 | /* quick check if we run Intel */ | 362 | /* quick check if we run Intel */ |
| 337 | if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL) | 363 | if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL) |
| 338 | goto exit; | 364 | goto exit; |
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c index c849c0c6ee9c..d5ac422d73b2 100644 --- a/drivers/hwmon/ds1621.c +++ b/drivers/hwmon/ds1621.c | |||
| @@ -53,8 +53,8 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low") | |||
| 53 | 53 | ||
| 54 | /* The DS1621 registers */ | 54 | /* The DS1621 registers */ |
| 55 | #define DS1621_REG_TEMP 0xAA /* word, RO */ | 55 | #define DS1621_REG_TEMP 0xAA /* word, RO */ |
| 56 | #define DS1621_REG_TEMP_MIN 0xA1 /* word, RW */ | 56 | #define DS1621_REG_TEMP_MIN 0xA2 /* word, RW */ |
| 57 | #define DS1621_REG_TEMP_MAX 0xA2 /* word, RW */ | 57 | #define DS1621_REG_TEMP_MAX 0xA1 /* word, RW */ |
| 58 | #define DS1621_REG_CONF 0xAC /* byte, RW */ | 58 | #define DS1621_REG_CONF 0xAC /* byte, RW */ |
| 59 | #define DS1621_COM_START 0xEE /* no data */ | 59 | #define DS1621_COM_START 0xEE /* no data */ |
| 60 | #define DS1621_COM_STOP 0x22 /* no data */ | 60 | #define DS1621_COM_STOP 0x22 /* no data */ |
| @@ -328,9 +328,9 @@ static struct ds1621_data *ds1621_update_client(struct device *dev) | |||
| 328 | 328 | ||
| 329 | /* reset alarms if necessary */ | 329 | /* reset alarms if necessary */ |
| 330 | new_conf = data->conf; | 330 | new_conf = data->conf; |
| 331 | if (data->temp < data->temp_min) | 331 | if (data->temp > data->temp_min) |
| 332 | new_conf &= ~DS1621_ALARM_TEMP_LOW; | 332 | new_conf &= ~DS1621_ALARM_TEMP_LOW; |
| 333 | if (data->temp > data->temp_max) | 333 | if (data->temp < data->temp_max) |
| 334 | new_conf &= ~DS1621_ALARM_TEMP_HIGH; | 334 | new_conf &= ~DS1621_ALARM_TEMP_HIGH; |
| 335 | if (data->conf != new_conf) | 335 | if (data->conf != new_conf) |
| 336 | ds1621_write_value(client, DS1621_REG_CONF, | 336 | ds1621_write_value(client, DS1621_REG_CONF, |
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index 5aab23b93e24..f17e771e42f8 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
| @@ -132,7 +132,9 @@ int vid_from_reg(int val, u8 vrm) | |||
| 132 | val &= 0x7f; | 132 | val &= 0x7f; |
| 133 | return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); | 133 | return(val > 0x77 ? 0 : (1500000 - (val * 12500) + 500) / 1000); |
| 134 | default: /* report 0 for unknown */ | 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 | return 0; | 138 | return 0; |
| 137 | } | 139 | } |
| 138 | } | 140 | } |
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c index a5b774b07cbd..12cb40a975de 100644 --- a/drivers/hwmon/w83627hf.c +++ b/drivers/hwmon/w83627hf.c | |||
| @@ -965,8 +965,10 @@ static int __init w83627hf_find(int sioaddr, unsigned short *addr, | |||
| 965 | case W687THF_DEVID: | 965 | case W687THF_DEVID: |
| 966 | sio_data->type = w83687thf; | 966 | sio_data->type = w83687thf; |
| 967 | break; | 967 | break; |
| 968 | case 0xff: /* No device at all */ | ||
| 969 | goto exit; | ||
| 968 | default: | 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 | goto exit; | 972 | goto exit; |
| 971 | } | 973 | } |
| 972 | 974 | ||
