diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/applesmc.c | 6 | ||||
-rw-r--r-- | drivers/hwmon/coretemp.c | 37 | ||||
-rw-r--r-- | drivers/hwmon/emc2103.c | 12 | ||||
-rw-r--r-- | drivers/hwmon/jc42.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/lineage-pem.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ltc4261.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/max16065.c | 2 |
7 files changed, 48 insertions, 15 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index f082e48ab113..2cde9ecf7731 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Based on hdaps.c driver: | 9 | * Based on hdaps.c driver: |
10 | * Copyright (C) 2005 Robert Love <rml@novell.com> | 10 | * Copyright (C) 2005 Robert Love <rml@novell.com> |
11 | * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> | 11 | * Copyright (C) 2005 Jesper Juhl <jj@chaosbits.net> |
12 | * | 12 | * |
13 | * Fan control based on smcFanControl: | 13 | * Fan control based on smcFanControl: |
14 | * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com> | 14 | * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com> |
@@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
215 | int i; | 215 | int i; |
216 | 216 | ||
217 | if (send_command(cmd) || send_argument(key)) { | 217 | if (send_command(cmd) || send_argument(key)) { |
218 | pr_warn("%s: read arg fail\n", key); | 218 | pr_warn("%.4s: read arg fail\n", key); |
219 | return -EIO; | 219 | return -EIO; |
220 | } | 220 | } |
221 | 221 | ||
@@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
223 | 223 | ||
224 | for (i = 0; i < len; i++) { | 224 | for (i = 0; i < len; i++) { |
225 | if (__wait_status(0x05)) { | 225 | if (__wait_status(0x05)) { |
226 | pr_warn("%s: read data fail\n", key); | 226 | pr_warn("%.4s: read data fail\n", key); |
227 | return -EIO; | 227 | return -EIO; |
228 | } | 228 | } |
229 | buffer[i] = inb(APPLESMC_DATA_PORT); | 229 | buffer[i] = inb(APPLESMC_DATA_PORT); |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index b9d512331ed4..637c51c11b44 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -191,6 +191,24 @@ static ssize_t show_temp(struct device *dev, | |||
191 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; | 191 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; |
192 | } | 192 | } |
193 | 193 | ||
194 | struct tjmax { | ||
195 | char const *id; | ||
196 | int tjmax; | ||
197 | }; | ||
198 | |||
199 | static struct tjmax __cpuinitconst tjmax_table[] = { | ||
200 | { "CPU D410", 100000 }, | ||
201 | { "CPU D425", 100000 }, | ||
202 | { "CPU D510", 100000 }, | ||
203 | { "CPU D525", 100000 }, | ||
204 | { "CPU N450", 100000 }, | ||
205 | { "CPU N455", 100000 }, | ||
206 | { "CPU N470", 100000 }, | ||
207 | { "CPU N475", 100000 }, | ||
208 | { "CPU 230", 100000 }, | ||
209 | { "CPU 330", 125000 }, | ||
210 | }; | ||
211 | |||
194 | static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | 212 | static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, |
195 | struct device *dev) | 213 | struct device *dev) |
196 | { | 214 | { |
@@ -202,6 +220,13 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
202 | int err; | 220 | int err; |
203 | u32 eax, edx; | 221 | u32 eax, edx; |
204 | struct pci_dev *host_bridge; | 222 | struct pci_dev *host_bridge; |
223 | int i; | ||
224 | |||
225 | /* explicit tjmax table entries override heuristics */ | ||
226 | for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) { | ||
227 | if (strstr(c->x86_model_id, tjmax_table[i].id)) | ||
228 | return tjmax_table[i].tjmax; | ||
229 | } | ||
205 | 230 | ||
206 | /* Early chips have no MSR for TjMax */ | 231 | /* Early chips have no MSR for TjMax */ |
207 | 232 | ||
@@ -210,7 +235,8 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
210 | 235 | ||
211 | /* Atom CPUs */ | 236 | /* Atom CPUs */ |
212 | 237 | ||
213 | if (c->x86_model == 0x1c) { | 238 | if (c->x86_model == 0x1c || c->x86_model == 0x26 |
239 | || c->x86_model == 0x27) { | ||
214 | usemsr_ee = 0; | 240 | usemsr_ee = 0; |
215 | 241 | ||
216 | host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); | 242 | host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); |
@@ -223,6 +249,9 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
223 | tjmax = 90000; | 249 | tjmax = 90000; |
224 | 250 | ||
225 | pci_dev_put(host_bridge); | 251 | pci_dev_put(host_bridge); |
252 | } else if (c->x86_model == 0x36) { | ||
253 | usemsr_ee = 0; | ||
254 | tjmax = 100000; | ||
226 | } | 255 | } |
227 | 256 | ||
228 | if (c->x86_model > 0xe && usemsr_ee) { | 257 | if (c->x86_model > 0xe && usemsr_ee) { |
@@ -664,7 +693,7 @@ static void __cpuinit get_core_online(unsigned int cpu) | |||
664 | * sensors. We check this bit only, all the early CPUs | 693 | * sensors. We check this bit only, all the early CPUs |
665 | * without thermal sensors will be filtered out. | 694 | * without thermal sensors will be filtered out. |
666 | */ | 695 | */ |
667 | if (!cpu_has(c, X86_FEATURE_DTS)) | 696 | if (!cpu_has(c, X86_FEATURE_DTHERM)) |
668 | return; | 697 | return; |
669 | 698 | ||
670 | if (!pdev) { | 699 | if (!pdev) { |
@@ -765,14 +794,14 @@ static struct notifier_block coretemp_cpu_notifier __refdata = { | |||
765 | }; | 794 | }; |
766 | 795 | ||
767 | static const struct x86_cpu_id coretemp_ids[] = { | 796 | static const struct x86_cpu_id coretemp_ids[] = { |
768 | { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTS }, | 797 | { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTHERM }, |
769 | {} | 798 | {} |
770 | }; | 799 | }; |
771 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); | 800 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); |
772 | 801 | ||
773 | static int __init coretemp_init(void) | 802 | static int __init coretemp_init(void) |
774 | { | 803 | { |
775 | int i, err = -ENODEV; | 804 | int i, err; |
776 | 805 | ||
777 | /* | 806 | /* |
778 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal | 807 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal |
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index 9691f664c76e..e7d234b59312 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
@@ -451,11 +451,15 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
451 | data->fan_rpm_control = true; | 451 | data->fan_rpm_control = true; |
452 | break; | 452 | break; |
453 | default: | 453 | default: |
454 | mutex_unlock(&data->update_lock); | 454 | count = -EINVAL; |
455 | return -EINVAL; | 455 | goto err; |
456 | } | 456 | } |
457 | 457 | ||
458 | read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); | 458 | result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); |
459 | if (result) { | ||
460 | count = result; | ||
461 | goto err; | ||
462 | } | ||
459 | 463 | ||
460 | if (data->fan_rpm_control) | 464 | if (data->fan_rpm_control) |
461 | conf_reg |= 0x80; | 465 | conf_reg |= 0x80; |
@@ -463,7 +467,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
463 | conf_reg &= ~0x80; | 467 | conf_reg &= ~0x80; |
464 | 468 | ||
465 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); | 469 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); |
466 | 470 | err: | |
467 | mutex_unlock(&data->update_lock); | 471 | mutex_unlock(&data->update_lock); |
468 | return count; | 472 | return count; |
469 | } | 473 | } |
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index a9bfd6736d9a..e72ba5d2a824 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c | |||
@@ -590,6 +590,6 @@ abort: | |||
590 | 590 | ||
591 | module_i2c_driver(jc42_driver); | 591 | module_i2c_driver(jc42_driver); |
592 | 592 | ||
593 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 593 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
594 | MODULE_DESCRIPTION("JC42 driver"); | 594 | MODULE_DESCRIPTION("JC42 driver"); |
595 | MODULE_LICENSE("GPL"); | 595 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c index d264937c7f5e..bd75d2415432 100644 --- a/drivers/hwmon/lineage-pem.c +++ b/drivers/hwmon/lineage-pem.c | |||
@@ -567,6 +567,6 @@ static struct i2c_driver pem_driver = { | |||
567 | 567 | ||
568 | module_i2c_driver(pem_driver); | 568 | module_i2c_driver(pem_driver); |
569 | 569 | ||
570 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 570 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
571 | MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver"); | 571 | MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver"); |
572 | MODULE_LICENSE("GPL"); | 572 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/ltc4261.c b/drivers/hwmon/ltc4261.c index 069b7d34d8f9..77476a575c4e 100644 --- a/drivers/hwmon/ltc4261.c +++ b/drivers/hwmon/ltc4261.c | |||
@@ -292,6 +292,6 @@ static struct i2c_driver ltc4261_driver = { | |||
292 | 292 | ||
293 | module_i2c_driver(ltc4261_driver); | 293 | module_i2c_driver(ltc4261_driver); |
294 | 294 | ||
295 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 295 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
296 | MODULE_DESCRIPTION("LTC4261 driver"); | 296 | MODULE_DESCRIPTION("LTC4261 driver"); |
297 | MODULE_LICENSE("GPL"); | 297 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c index 822261be84dd..019427d7a5fd 100644 --- a/drivers/hwmon/max16065.c +++ b/drivers/hwmon/max16065.c | |||
@@ -692,6 +692,6 @@ static struct i2c_driver max16065_driver = { | |||
692 | 692 | ||
693 | module_i2c_driver(max16065_driver); | 693 | module_i2c_driver(max16065_driver); |
694 | 694 | ||
695 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 695 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
696 | MODULE_DESCRIPTION("MAX16065 driver"); | 696 | MODULE_DESCRIPTION("MAX16065 driver"); |
697 | MODULE_LICENSE("GPL"); | 697 | MODULE_LICENSE("GPL"); |