Skip to content

Commit 589643b

Browse files
committed
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
2 parents 80519bc + faabd47 commit 589643b

File tree

4 files changed

+60
-12
lines changed

4 files changed

+60
-12
lines changed

drivers/hwmon/coretemp.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct coretemp_data {
5353
struct mutex update_lock;
5454
const char *name;
5555
u32 id;
56+
u16 core_id;
5657
char valid; /* zero until following fields are valid */
5758
unsigned long last_updated; /* in jiffies */
5859
int temp;
@@ -75,7 +76,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute
7576
if (attr->index == SHOW_NAME)
7677
ret = sprintf(buf, "%s\n", data->name);
7778
else /* show label */
78-
ret = sprintf(buf, "Core %d\n", data->id);
79+
ret = sprintf(buf, "Core %d\n", data->core_id);
7980
return ret;
8081
}
8182

@@ -304,6 +305,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
304305
}
305306

306307
data->id = pdev->id;
308+
#ifdef CONFIG_SMP
309+
data->core_id = c->cpu_core_id;
310+
#endif
307311
data->name = "coretemp";
308312
mutex_init(&data->update_lock);
309313

@@ -405,6 +409,10 @@ struct pdev_entry {
405409
struct list_head list;
406410
struct platform_device *pdev;
407411
unsigned int cpu;
412+
#ifdef CONFIG_SMP
413+
u16 phys_proc_id;
414+
u16 cpu_core_id;
415+
#endif
408416
};
409417

410418
static LIST_HEAD(pdev_list);
@@ -415,6 +423,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
415423
int err;
416424
struct platform_device *pdev;
417425
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
418442

419443
pdev = platform_device_alloc(DRVNAME, cpu);
420444
if (!pdev) {
@@ -438,7 +462,10 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
438462

439463
pdev_entry->pdev = pdev;
440464
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
442469
list_add_tail(&pdev_entry->list, &pdev_list);
443470
mutex_unlock(&pdev_list_mutex);
444471

@@ -449,6 +476,7 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
449476
exit_device_put:
450477
platform_device_put(pdev);
451478
exit:
479+
mutex_unlock(&pdev_list_mutex);
452480
return err;
453481
}
454482

drivers/hwmon/it87.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ superio_inb(int reg)
8080
return inb(VAL);
8181
}
8282

83+
static inline void
84+
superio_outb(int reg, int val)
85+
{
86+
outb(reg, REG);
87+
outb(val, VAL);
88+
}
89+
8390
static int superio_inw(int reg)
8491
{
8592
int val;
@@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address,
15171524
sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
15181525

15191526
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+
}
15201542
if (reg & (1 << 0))
15211543
pr_info("it87: in3 is VCC (+5V)\n");
15221544
if (reg & (1 << 1))

drivers/hwmon/k8temp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
180180
}
181181

182182
if ((model >= 0x69) &&
183-
!(model == 0xc1 || model == 0x6c || model == 0x7c)) {
183+
!(model == 0xc1 || model == 0x6c || model == 0x7c ||
184+
model == 0x6b || model == 0x6f || model == 0x7f)) {
184185
/*
185-
* RevG desktop CPUs (i.e. no socket S1G1 parts)
186-
* need additional offset, otherwise reported
187-
* temperature is below ambient temperature
186+
* RevG desktop CPUs (i.e. no socket S1G1 or
187+
* ASB1 parts) need additional offset,
188+
* otherwise reported temperature is below
189+
* ambient temperature
188190
*/
189191
data->temp_offset = 21000;
190192
}

drivers/i2c/busses/i2c-i801.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_device(u8 type, const char *name,
655655
/* & ~0x80, ignore enabled/disabled bit */
656656
if ((type & ~0x80) != dmi_devices[i].type)
657657
continue;
658-
if (strcmp(name, dmi_devices[i].name))
658+
if (strcasecmp(name, dmi_devices[i].name))
659659
continue;
660660

661661
memset(&info, 0, sizeof(struct i2c_board_info));
@@ -704,9 +704,6 @@ static int __devinit i801_probe(struct pci_dev *dev,
704704
{
705705
unsigned char temp;
706706
int err, i;
707-
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
708-
const char *vendor;
709-
#endif
710707

711708
I801_dev = dev;
712709
i801_features = 0;
@@ -808,8 +805,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
808805
}
809806
#endif
810807
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
811-
vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
812-
if (vendor && !strcmp(vendor, "FUJITSU SIEMENS"))
808+
if (dmi_name_in_vendors("FUJITSU"))
813809
dmi_walk(dmi_check_onboard_devices, &i801_adapter);
814810
#endif
815811

0 commit comments

Comments
 (0)