diff options
Diffstat (limited to 'drivers/hwmon/hwmon-vid.c')
-rw-r--r-- | drivers/hwmon/hwmon-vid.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index 3330667280b9..7b0a32c4dcfb 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -1,76 +1,74 @@ | |||
1 | /* | 1 | /* |
2 | hwmon-vid.c - VID/VRM/VRD voltage conversions | 2 | * hwmon-vid.c - VID/VRM/VRD voltage conversions |
3 | 3 | * | |
4 | Copyright (c) 2004 Rudolf Marek <r.marek@assembler.cz> | 4 | * Copyright (c) 2004 Rudolf Marek <r.marek@assembler.cz> |
5 | 5 | * | |
6 | Partly imported from i2c-vid.h of the lm_sensors project | 6 | * Partly imported from i2c-vid.h of the lm_sensors project |
7 | Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> | 7 | * Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> |
8 | With assistance from Trent Piepho <xyzzy@speakeasy.org> | 8 | * With assistance from Trent Piepho <xyzzy@speakeasy.org> |
9 | 9 | * | |
10 | This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
12 | the Free Software Foundation; either version 2 of the License, or | 12 | * the Free Software Foundation; either version 2 of the License, or |
13 | (at your option) any later version. | 13 | * (at your option) any later version. |
14 | 14 | * | |
15 | This program is distributed in the hope that it will be useful, | 15 | * This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | GNU General Public License for more details. | 18 | * GNU General Public License for more details. |
19 | 19 | * | |
20 | You should have received a copy of the GNU General Public License | 20 | * You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software | 21 | * along with this program; if not, write to the Free Software |
22 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/hwmon-vid.h> | 27 | #include <linux/hwmon-vid.h> |
28 | 28 | ||
29 | /* | 29 | /* |
30 | Common code for decoding VID pins. | 30 | * Common code for decoding VID pins. |
31 | 31 | * | |
32 | References: | 32 | * References: |
33 | 33 | * | |
34 | For VRM 8.4 to 9.1, "VRM x.y DC-DC Converter Design Guidelines", | 34 | * For VRM 8.4 to 9.1, "VRM x.y DC-DC Converter Design Guidelines", |
35 | available at http://developer.intel.com/. | 35 | * available at http://developer.intel.com/. |
36 | 36 | * | |
37 | For VRD 10.0 and up, "VRD x.y Design Guide", | 37 | * For VRD 10.0 and up, "VRD x.y Design Guide", |
38 | available at http://developer.intel.com/. | 38 | * available at http://developer.intel.com/. |
39 | 39 | * | |
40 | AMD Opteron processors don't follow the Intel specifications. | 40 | * AMD NPT 0Fh (Athlon64 & Opteron), AMD Publication 32559, |
41 | I'm going to "make up" 2.4 as the spec number for the Opterons. | 41 | * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf |
42 | No good reason just a mnemonic for the 24x Opteron processor | 42 | * Table 71. VID Code Voltages |
43 | series. | 43 | * AMD Opteron processors don't follow the Intel specifications. |
44 | 44 | * I'm going to "make up" 2.4 as the spec number for the Opterons. | |
45 | Opteron VID encoding is: | 45 | * No good reason just a mnemonic for the 24x Opteron processor |
46 | 00000 = 1.550 V | 46 | * series. |
47 | 00001 = 1.525 V | 47 | * |
48 | . . . . | 48 | * The 17 specification is in fact Intel Mobile Voltage Positioning - |
49 | 11110 = 0.800 V | 49 | * (IMVP-II). You can find more information in the datasheet of Max1718 |
50 | 11111 = 0.000 V (off) | 50 | * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452 |
51 | 51 | * | |
52 | The 17 specification is in fact Intel Mobile Voltage Positioning - | 52 | * The 13 specification corresponds to the Intel Pentium M series. There |
53 | (IMVP-II). You can find more information in the datasheet of Max1718 | 53 | * doesn't seem to be any named specification for these. The conversion |
54 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452 | 54 | * tables are detailed directly in the various Pentium M datasheets: |
55 | 55 | * http://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm | |
56 | The 13 specification corresponds to the Intel Pentium M series. There | 56 | * |
57 | doesn't seem to be any named specification for these. The conversion | 57 | * The 14 specification corresponds to Intel Core series. There |
58 | tables are detailed directly in the various Pentium M datasheets: | 58 | * doesn't seem to be any named specification for these. The conversion |
59 | http://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm | 59 | * tables are detailed directly in the various Pentium Core datasheets: |
60 | 60 | * http://www.intel.com/design/mobile/datashts/309221.htm | |
61 | The 14 specification corresponds to Intel Core series. There | 61 | * |
62 | doesn't seem to be any named specification for these. The conversion | 62 | * The 110 (VRM 11) specification corresponds to Intel Conroe based series. |
63 | tables are detailed directly in the various Pentium Core datasheets: | 63 | * http://www.intel.com/design/processor/applnots/313214.htm |
64 | http://www.intel.com/design/mobile/datashts/309221.htm | 64 | */ |
65 | 65 | ||
66 | The 110 (VRM 11) specification corresponds to Intel Conroe based series. | 66 | /* |
67 | http://www.intel.com/design/processor/applnots/313214.htm | 67 | * vrm is the VRM/VRD document version multiplied by 10. |
68 | */ | 68 | * val is the 4-bit or more VID code. |
69 | 69 | * Returned value is in mV to avoid floating point in the kernel. | |
70 | /* vrm is the VRM/VRD document version multiplied by 10. | 70 | * Some VID have some bits in uV scale, this is rounded to mV. |
71 | val is the 4-bit or more VID code. | 71 | */ |
72 | Returned value is in mV to avoid floating point in the kernel. | ||
73 | Some VID have some bits in uV scale, this is rounded to mV */ | ||
74 | int vid_from_reg(int val, u8 vrm) | 72 | int vid_from_reg(int val, u8 vrm) |
75 | { | 73 | { |
76 | int vid; | 74 | int vid; |
@@ -96,9 +94,11 @@ int vid_from_reg(int val, u8 vrm) | |||
96 | if (val < 0x02 || val > 0xb2) | 94 | if (val < 0x02 || val > 0xb2) |
97 | return 0; | 95 | return 0; |
98 | return((1600000 - (val - 2) * 6250 + 500) / 1000); | 96 | return((1600000 - (val - 2) * 6250 + 500) / 1000); |
99 | case 24: /* Opteron processor */ | 97 | |
100 | val &= 0x1f; | 98 | case 24: /* AMD NPT 0Fh (Athlon64 & Opteron) */ |
101 | return(val == 0x1f ? 0 : 1550 - val * 25); | 99 | val &= 0x3f; |
100 | return (val < 32) ? 1550 - 25 * val | ||
101 | : 775 - (25 * (val - 31)) / 2; | ||
102 | 102 | ||
103 | case 91: /* VRM 9.1 */ | 103 | case 91: /* VRM 9.1 */ |
104 | case 90: /* VRM 9.0 */ | 104 | case 90: /* VRM 9.0 */ |
@@ -141,9 +141,9 @@ int vid_from_reg(int val, u8 vrm) | |||
141 | 141 | ||
142 | 142 | ||
143 | /* | 143 | /* |
144 | After this point is the code to automatically determine which | 144 | * After this point is the code to automatically determine which |
145 | VRM/VRD specification should be used depending on the CPU. | 145 | * VRM/VRD specification should be used depending on the CPU. |
146 | */ | 146 | */ |
147 | 147 | ||
148 | struct vrm_model { | 148 | struct vrm_model { |
149 | u8 vendor; | 149 | u8 vendor; |