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
This commit is contained in:
Linus Torvalds 2010-07-11 13:35:34 -07:00
commit 589643be66
4 changed files with 60 additions and 12 deletions

View File

@ -53,6 +53,7 @@ struct coretemp_data {
struct mutex update_lock; struct mutex update_lock;
const char *name; const char *name;
u32 id; u32 id;
u16 core_id;
char valid; /* zero until following fields are valid */ char valid; /* zero until following fields are valid */
unsigned long last_updated; /* in jiffies */ unsigned long last_updated; /* in jiffies */
int temp; int temp;
@ -75,7 +76,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute
if (attr->index == SHOW_NAME) if (attr->index == SHOW_NAME)
ret = sprintf(buf, "%s\n", data->name); ret = sprintf(buf, "%s\n", data->name);
else /* show label */ else /* show label */
ret = sprintf(buf, "Core %d\n", data->id); ret = sprintf(buf, "Core %d\n", data->core_id);
return ret; return ret;
} }
@ -304,6 +305,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
} }
data->id = pdev->id; data->id = pdev->id;
#ifdef CONFIG_SMP
data->core_id = c->cpu_core_id;
#endif
data->name = "coretemp"; data->name = "coretemp";
mutex_init(&data->update_lock); mutex_init(&data->update_lock);
@ -405,6 +409,10 @@ struct pdev_entry {
struct list_head list; struct list_head list;
struct platform_device *pdev; struct platform_device *pdev;
unsigned int cpu; unsigned int cpu;
#ifdef CONFIG_SMP
u16 phys_proc_id;
u16 cpu_core_id;
#endif
}; };
static LIST_HEAD(pdev_list); static LIST_HEAD(pdev_list);
@ -415,6 +423,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
int err; int err;
struct platform_device *pdev; struct platform_device *pdev;
struct pdev_entry *pdev_entry; struct pdev_entry *pdev_entry;
#ifdef CONFIG_SMP
struct cpuinfo_x86 *c = &cpu_data(cpu);
#endif
mutex_lock(&pdev_list_mutex);
#ifdef CONFIG_SMP
/* Skip second HT entry of each core */
list_for_each_entry(pdev_entry, &pdev_list, list) {
if (c->phys_proc_id == pdev_entry->phys_proc_id &&
c->cpu_core_id == pdev_entry->cpu_core_id) {
err = 0; /* Not an error */
goto exit;
}
}
#endif
pdev = platform_device_alloc(DRVNAME, cpu); pdev = platform_device_alloc(DRVNAME, cpu);
if (!pdev) { if (!pdev) {
@ -438,7 +462,10 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
pdev_entry->pdev = pdev; pdev_entry->pdev = pdev;
pdev_entry->cpu = cpu; pdev_entry->cpu = cpu;
mutex_lock(&pdev_list_mutex); #ifdef CONFIG_SMP
pdev_entry->phys_proc_id = c->phys_proc_id;
pdev_entry->cpu_core_id = c->cpu_core_id;
#endif
list_add_tail(&pdev_entry->list, &pdev_list); list_add_tail(&pdev_entry->list, &pdev_list);
mutex_unlock(&pdev_list_mutex); mutex_unlock(&pdev_list_mutex);
@ -449,6 +476,7 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
exit_device_put: exit_device_put:
platform_device_put(pdev); platform_device_put(pdev);
exit: exit:
mutex_unlock(&pdev_list_mutex);
return err; return err;
} }

View File

@ -80,6 +80,13 @@ superio_inb(int reg)
return inb(VAL); return inb(VAL);
} }
static inline void
superio_outb(int reg, int val)
{
outb(reg, REG);
outb(val, VAL);
}
static int superio_inw(int reg) static int superio_inw(int reg)
{ {
int val; int val;
@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address,
sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
reg = superio_inb(IT87_SIO_PINX2_REG); reg = superio_inb(IT87_SIO_PINX2_REG);
/*
* The IT8720F has no VIN7 pin, so VCCH should always be
* routed internally to VIN7 with an internal divider.
* Curiously, there still is a configuration bit to control
* this, which means it can be set incorrectly. And even
* more curiously, many boards out there are improperly
* configured, even though the IT8720F datasheet claims
* that the internal routing of VCCH to VIN7 is the default
* setting. So we force the internal routing in this case.
*/
if (sio_data->type == it8720 && !(reg & (1 << 1))) {
reg |= (1 << 1);
superio_outb(IT87_SIO_PINX2_REG, reg);
pr_notice("it87: Routing internal VCCH to in7\n");
}
if (reg & (1 << 0)) if (reg & (1 << 0))
pr_info("it87: in3 is VCC (+5V)\n"); pr_info("it87: in3 is VCC (+5V)\n");
if (reg & (1 << 1)) if (reg & (1 << 1))

View File

@ -180,11 +180,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
} }
if ((model >= 0x69) && if ((model >= 0x69) &&
!(model == 0xc1 || model == 0x6c || model == 0x7c)) { !(model == 0xc1 || model == 0x6c || model == 0x7c ||
model == 0x6b || model == 0x6f || model == 0x7f)) {
/* /*
* RevG desktop CPUs (i.e. no socket S1G1 parts) * RevG desktop CPUs (i.e. no socket S1G1 or
* need additional offset, otherwise reported * ASB1 parts) need additional offset,
* temperature is below ambient temperature * otherwise reported temperature is below
* ambient temperature
*/ */
data->temp_offset = 21000; data->temp_offset = 21000;
} }

View File

@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_device(u8 type, const char *name,
/* & ~0x80, ignore enabled/disabled bit */ /* & ~0x80, ignore enabled/disabled bit */
if ((type & ~0x80) != dmi_devices[i].type) if ((type & ~0x80) != dmi_devices[i].type)
continue; continue;
if (strcmp(name, dmi_devices[i].name)) if (strcasecmp(name, dmi_devices[i].name))
continue; continue;
memset(&info, 0, sizeof(struct i2c_board_info)); memset(&info, 0, sizeof(struct i2c_board_info));
@ -704,9 +704,6 @@ static int __devinit i801_probe(struct pci_dev *dev,
{ {
unsigned char temp; unsigned char temp;
int err, i; int err, i;
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
const char *vendor;
#endif
I801_dev = dev; I801_dev = dev;
i801_features = 0; i801_features = 0;
@ -808,8 +805,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
} }
#endif #endif
#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
vendor = dmi_get_system_info(DMI_BOARD_VENDOR); if (dmi_name_in_vendors("FUJITSU"))
if (vendor && !strcmp(vendor, "FUJITSU SIEMENS"))
dmi_walk(dmi_check_onboard_devices, &i801_adapter); dmi_walk(dmi_check_onboard_devices, &i801_adapter);
#endif #endif