提交 41e58a1f 编写于 作者: G Guenter Roeck 提交者: Jean Delvare

hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs

Atom CPUs don't have a register to retrieve TjMax. Detection so far was
incomplete. Use the X86 model ID to improve it.
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 5592906f
...@@ -191,6 +191,24 @@ static ssize_t show_temp(struct device *dev, ...@@ -191,6 +191,24 @@ static ssize_t show_temp(struct device *dev,
return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN;
} }
struct tjmax {
char const *id;
int tjmax;
};
static struct tjmax __cpuinitconst tjmax_table[] = {
{ "CPU D410", 100000 },
{ "CPU D425", 100000 },
{ "CPU D510", 100000 },
{ "CPU D525", 100000 },
{ "CPU N450", 100000 },
{ "CPU N455", 100000 },
{ "CPU N470", 100000 },
{ "CPU N475", 100000 },
{ "CPU 230", 100000 },
{ "CPU 330", 125000 },
};
static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
struct device *dev) struct device *dev)
{ {
...@@ -202,6 +220,13 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, ...@@ -202,6 +220,13 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
int err; int err;
u32 eax, edx; u32 eax, edx;
struct pci_dev *host_bridge; struct pci_dev *host_bridge;
int i;
/* explicit tjmax table entries override heuristics */
for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) {
if (strstr(c->x86_model_id, tjmax_table[i].id))
return tjmax_table[i].tjmax;
}
/* Early chips have no MSR for TjMax */ /* Early chips have no MSR for TjMax */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册