diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-11 16:35:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-11 16:35:34 -0400 |
commit | 589643be6693c46fbc54bae77745f336c8ed4bcc (patch) | |
tree | 03c855e34cc86d5e0dc914321698a1d2dfc11f04 /drivers | |
parent | 80519bc77b52729ca49b278b67d58715e38b85e9 (diff) | |
parent | faabd47f7e3a36574abcdff0b3506abb092bbe24 (diff) |
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: Fix autoloading of fschmd on recent Fujitsu machines
hwmon: (coretemp) Properly label the sensors
hwmon: (coretemp) Skip duplicate CPU entries
hwmon: (it87) Fix in7 on IT8720F
hwmon: (k8temp) Fix temperature reporting for ASB1 processor revisions
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/coretemp.c | 32 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 22 | ||||
-rw-r--r-- | drivers/hwmon/k8temp.c | 10 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 8 |
4 files changed, 60 insertions, 12 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 2988da150ed6..05344af50734 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -53,6 +53,7 @@ struct coretemp_data { | |||
53 | struct mutex update_lock; | 53 | struct mutex update_lock; |
54 | const char *name; | 54 | const char *name; |
55 | u32 id; | 55 | u32 id; |
56 | u16 core_id; | ||
56 | char valid; /* zero until following fields are valid */ | 57 | char valid; /* zero until following fields are valid */ |
57 | unsigned long last_updated; /* in jiffies */ | 58 | unsigned long last_updated; /* in jiffies */ |
58 | int temp; | 59 | int temp; |
@@ -75,7 +76,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute | |||
75 | if (attr->index == SHOW_NAME) | 76 | if (attr->index == SHOW_NAME) |
76 | ret = sprintf(buf, "%s\n", data->name); | 77 | ret = sprintf(buf, "%s\n", data->name); |
77 | else /* show label */ | 78 | else /* show label */ |
78 | ret = sprintf(buf, "Core %d\n", data->id); | 79 | ret = sprintf(buf, "Core %d\n", data->core_id); |
79 | return ret; | 80 | return ret; |
80 | } | 81 | } |
81 | 82 | ||
@@ -304,6 +305,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev) | |||
304 | } | 305 | } |
305 | 306 | ||
306 | data->id = pdev->id; | 307 | data->id = pdev->id; |
308 | #ifdef CONFIG_SMP | ||
309 | data->core_id = c->cpu_core_id; | ||
310 | #endif | ||
307 | data->name = "coretemp"; | 311 | data->name = "coretemp"; |
308 | mutex_init(&data->update_lock); | 312 | mutex_init(&data->update_lock); |
309 | 313 | ||
@@ -405,6 +409,10 @@ struct pdev_entry { | |||
405 | struct list_head list; | 409 | struct list_head list; |
406 | struct platform_device *pdev; | 410 | struct platform_device *pdev; |
407 | unsigned int cpu; | 411 | unsigned int cpu; |
412 | #ifdef CONFIG_SMP | ||
413 | u16 phys_proc_id; | ||
414 | u16 cpu_core_id; | ||
415 | #endif | ||
408 | }; | 416 | }; |
409 | 417 | ||
410 | static LIST_HEAD(pdev_list); | 418 | static LIST_HEAD(pdev_list); |
@@ -415,6 +423,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) | |||
415 | int err; | 423 | int err; |
416 | struct platform_device *pdev; | 424 | struct platform_device *pdev; |
417 | struct pdev_entry *pdev_entry; | 425 | struct pdev_entry *pdev_entry; |
426 | #ifdef CONFIG_SMP | ||
427 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
428 | #endif | ||
429 | |||
430 | mutex_lock(&pdev_list_mutex); | ||
431 | |||
432 | #ifdef CONFIG_SMP | ||
433 | /* Skip second HT entry of each core */ | ||
434 | list_for_each_entry(pdev_entry, &pdev_list, list) { | ||
435 | if (c->phys_proc_id == pdev_entry->phys_proc_id && | ||
436 | c->cpu_core_id == pdev_entry->cpu_core_id) { | ||
437 | err = 0; /* Not an error */ | ||
438 | goto exit; | ||
439 | } | ||
440 | } | ||
441 | #endif | ||
418 | 442 | ||
419 | pdev = platform_device_alloc(DRVNAME, cpu); | 443 | pdev = platform_device_alloc(DRVNAME, cpu); |
420 | if (!pdev) { | 444 | if (!pdev) { |
@@ -438,7 +462,10 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) | |||
438 | 462 | ||
439 | pdev_entry->pdev = pdev; | 463 | pdev_entry->pdev = pdev; |
440 | pdev_entry->cpu = cpu; | 464 | pdev_entry->cpu = cpu; |
441 | mutex_lock(&pdev_list_mutex); | 465 | #ifdef CONFIG_SMP |
466 | pdev_entry->phys_proc_id = c->phys_proc_id; | ||
467 | pdev_entry->cpu_core_id = c->cpu_core_id; | ||
468 | #endif | ||
442 | list_add_tail(&pdev_entry->list, &pdev_list); | 469 | list_add_tail(&pdev_entry->list, &pdev_list); |
443 | mutex_unlock(&pdev_list_mutex); | 470 | mutex_unlock(&pdev_list_mutex); |
444 | 471 | ||
@@ -449,6 +476,7 @@ exit_device_free: | |||
449 | exit_device_put: | 476 | exit_device_put: |
450 | platform_device_put(pdev); | 477 | platform_device_put(pdev); |
451 | exit: | 478 | exit: |
479 | mutex_unlock(&pdev_list_mutex); | ||
452 | return err; | 480 | return err; |
453 | } | 481 | } |
454 | 482 | ||
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 5be09c048c5f..25763d2223b6 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -80,6 +80,13 @@ superio_inb(int reg) | |||
80 | return inb(VAL); | 80 | return inb(VAL); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline void | ||
84 | superio_outb(int reg, int val) | ||
85 | { | ||
86 | outb(reg, REG); | ||
87 | outb(val, VAL); | ||
88 | } | ||
89 | |||
83 | static int superio_inw(int reg) | 90 | static int superio_inw(int reg) |
84 | { | 91 | { |
85 | int val; | 92 | int val; |
@@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address, | |||
1517 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); | 1524 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); |
1518 | 1525 | ||
1519 | reg = superio_inb(IT87_SIO_PINX2_REG); | 1526 | reg = superio_inb(IT87_SIO_PINX2_REG); |
1527 | /* | ||
1528 | * The IT8720F has no VIN7 pin, so VCCH should always be | ||
1529 | * routed internally to VIN7 with an internal divider. | ||
1530 | * Curiously, there still is a configuration bit to control | ||
1531 | * this, which means it can be set incorrectly. And even | ||
1532 | * more curiously, many boards out there are improperly | ||
1533 | * configured, even though the IT8720F datasheet claims | ||
1534 | * that the internal routing of VCCH to VIN7 is the default | ||
1535 | * setting. So we force the internal routing in this case. | ||
1536 | */ | ||
1537 | if (sio_data->type == it8720 && !(reg & (1 << 1))) { | ||
1538 | reg |= (1 << 1); | ||
1539 | superio_outb(IT87_SIO_PINX2_REG, reg); | ||
1540 | pr_notice("it87: Routing internal VCCH to in7\n"); | ||
1541 | } | ||
1520 | if (reg & (1 << 0)) | 1542 | if (reg & (1 << 0)) |
1521 | pr_info("it87: in3 is VCC (+5V)\n"); | 1543 | pr_info("it87: in3 is VCC (+5V)\n"); |
1522 | if (reg & (1 << 1)) | 1544 | if (reg & (1 << 1)) |
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index f26acdb11681..8bdf80d91598 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
@@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, | |||
180 | } | 180 | } |
181 | 181 | ||
182 | if ((model >= 0x69) && | 182 | if ((model >= 0x69) && |
183 | !(model == 0xc1 || model == 0x6c || model == 0x7c)) { | 183 | !(model == 0xc1 || model == 0x6c || model == 0x7c || |
184 | model == 0x6b || model == 0x6f || model == 0x7f)) { | ||
184 | /* | 185 | /* |
185 | * RevG desktop CPUs (i.e. no socket S1G1 parts) | 186 | * RevG desktop CPUs (i.e. no socket S1G1 or |
186 | * need additional offset, otherwise reported | 187 | * ASB1 parts) need additional offset, |
187 | * temperature is below ambient temperature | 188 | * otherwise reported temperature is below |
189 | * ambient temperature | ||
188 | */ | 190 | */ |
189 | data->temp_offset = 21000; | 191 | data->temp_offset = 21000; |
190 | } | 192 | } |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index f4b21f2bb8ed..c60081169cc3 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_device(u8 type, const char *name, | |||
655 | /* & ~0x80, ignore enabled/disabled bit */ | 655 | /* & ~0x80, ignore enabled/disabled bit */ |
656 | if ((type & ~0x80) != dmi_devices[i].type) | 656 | if ((type & ~0x80) != dmi_devices[i].type) |
657 | continue; | 657 | continue; |
658 | if (strcmp(name, dmi_devices[i].name)) | 658 | if (strcasecmp(name, dmi_devices[i].name)) |
659 | continue; | 659 | continue; |
660 | 660 | ||
661 | memset(&info, 0, sizeof(struct i2c_board_info)); | 661 | memset(&info, 0, sizeof(struct i2c_board_info)); |
@@ -704,9 +704,6 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
704 | { | 704 | { |
705 | unsigned char temp; | 705 | unsigned char temp; |
706 | int err, i; | 706 | int err, i; |
707 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | ||
708 | const char *vendor; | ||
709 | #endif | ||
710 | 707 | ||
711 | I801_dev = dev; | 708 | I801_dev = dev; |
712 | i801_features = 0; | 709 | i801_features = 0; |
@@ -808,8 +805,7 @@ static int __devinit i801_probe(struct pci_dev *dev, | |||
808 | } | 805 | } |
809 | #endif | 806 | #endif |
810 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE | 807 | #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE |
811 | vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | 808 | if (dmi_name_in_vendors("FUJITSU")) |
812 | if (vendor && !strcmp(vendor, "FUJITSU SIEMENS")) | ||
813 | dmi_walk(dmi_check_onboard_devices, &i801_adapter); | 809 | dmi_walk(dmi_check_onboard_devices, &i801_adapter); |
814 | #endif | 810 | #endif |
815 | 811 | ||