Added kernel patch to support temp readings for some atom processors.
[people/pmueller/ipfire-2.x.git] / src / patches / linux-2.6.27-atom-coretemp.patch
1 diff -Naur linux-2.6.27.42.org/drivers/hwmon/coretemp.c linux-2.6.27.42/drivers/hwmon/coretemp.c
2 --- linux-2.6.27.42.org/drivers/hwmon/coretemp.c 2009-12-18 22:31:34.000000000 +0100
3 +++ linux-2.6.27.42/drivers/hwmon/coretemp.c 2010-02-07 12:36:39.000000000 +0100
4 @@ -1,7 +1,7 @@
5 /*
6 * coretemp.c - Linux kernel module for hardware monitoring
7 *
8 - * Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz>
9 + * Copyright (C) 2007, 2008 Rudolf Marek <r.marek@assembler.cz>
10 *
11 * Inspired from many hwmon drivers
12 *
13 @@ -244,8 +244,14 @@
14 }
15 }
16
17 - data->tjmax = adjust_tjmax(c, data->id, &pdev->dev);
18 - platform_set_drvdata(pdev, data);
19 + /* Intel Atom has only fixed TjMax at 95C */
20 +
21 + if (c->x86_model == 0x1c) {
22 + data->tjmax = 95000;
23 + } else {
24 + /* Adjust the TjMax for the rest of Core2 family */
25 + data->tjmax = adjust_tjmax(c, data->id, &pdev->dev);
26 + }
27
28 /* read the still undocumented IA32_TEMPERATURE_TARGET it exists
29 on older CPUs but not in this register */
30 @@ -265,6 +271,8 @@
31 }
32 }
33
34 + platform_set_drvdata(pdev, data);
35 +
36 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
37 goto exit_dev;
38
39 @@ -409,15 +417,15 @@
40 err = platform_driver_register(&coretemp_driver);
41 if (err)
42 goto exit;
43 -
44 +
45 for_each_online_cpu(i) {
46 struct cpuinfo_x86 *c = &cpu_data(i);
47
48 - /* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A */
49 + /* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A, 0x1c */
50 if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
51 !((c->x86_model == 0xe) || (c->x86_model == 0xf) ||
52 - (c->x86_model == 0x16) || (c->x86_model == 0x17) ||
53 - (c->x86_model == 0x1A))) {
54 + (c->x86_model == 0x16) || (c->x86_model == 0x17) ||
55 + (c->x86_model == 0x1c) || (c->x86_model == 0x1A))) {
56
57 /* supported CPU not found, but report the unknown
58 family 6 CPU */