aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/coretemp.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-06-17 12:05:05 -0400
committerJean Delvare <khali@endymion.delvare>2012-06-17 12:05:05 -0400
commit41e58a1f2b90c88d94b4bd84beb9927a4c2704e9 (patch)
treeffcdba071407da9b5f7029534829b4f3d8744ad9 /drivers/hwmon/coretemp.c
parent5592906f8b01282ea3c2acaf641fd067ad4bb3dc (diff)
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: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r--drivers/hwmon/coretemp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 42c2f431ea51..22716833739a 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
194struct tjmax {
195 char const *id;
196 int tjmax;
197};
198
199static 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
194static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, 212static 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