aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-07-31 15:52:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-05 12:14:22 -0400
commit303760b44a7a142cb9f4c9df4609fb63bbda98db (patch)
tree8097f99cd993bc005b25e14a5690770b6e351195 /drivers/hwmon
parentf4b50261207c987913f076d867c2e154d71fd012 (diff)
[PATCH] hwmon: hwmon vs i2c, second round (07/11)
The only part left in i2c-sensor is the VRM/VRD/VID handling code. This is in no way related to i2c, so it doesn't belong there. Move the code to hwmon, where it belongs. Note that not all hardware monitoring drivers do VRM/VRD/VID operations, so less drivers depend on hwmon-vid than there were depending on i2c-sensor. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/Kconfig50
-rw-r--r--drivers/hwmon/Makefile1
-rw-r--r--drivers/hwmon/adm1025.c4
-rw-r--r--drivers/hwmon/adm1026.c6
-rw-r--r--drivers/hwmon/adm9240.c4
-rw-r--r--drivers/hwmon/asb100.c4
-rw-r--r--drivers/hwmon/atxp1.c4
-rw-r--r--drivers/hwmon/gl520sm.c4
-rw-r--r--drivers/hwmon/hwmon-vid.c103
-rw-r--r--drivers/hwmon/it87.c6
-rw-r--r--drivers/hwmon/lm85.c4
-rw-r--r--drivers/hwmon/lm87.c4
-rw-r--r--drivers/hwmon/pc87360.c2
-rw-r--r--drivers/hwmon/w83627hf.c4
-rw-r--r--drivers/hwmon/w83781d.c4
-rw-r--r--drivers/hwmon/w83792d.c1
16 files changed, 145 insertions, 60 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 6483ff696b5a..35fe7d1d4028 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -19,10 +19,13 @@ config HWMON
19 This support can also be built as a module. If so, the module 19 This support can also be built as a module. If so, the module
20 will be called hwmon. 20 will be called hwmon.
21 21
22config HWMON_VID
23 tristate
24 default n
25
22config SENSORS_ADM1021 26config SENSORS_ADM1021
23 tristate "Analog Devices ADM1021 and compatibles" 27 tristate "Analog Devices ADM1021 and compatibles"
24 depends on HWMON && I2C 28 depends on HWMON && I2C
25 select I2C_SENSOR
26 help 29 help
27 If you say yes here you get support for Analog Devices ADM1021 30 If you say yes here you get support for Analog Devices ADM1021
28 and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A, 31 and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
@@ -35,7 +38,7 @@ config SENSORS_ADM1021
35config SENSORS_ADM1025 38config SENSORS_ADM1025
36 tristate "Analog Devices ADM1025 and compatibles" 39 tristate "Analog Devices ADM1025 and compatibles"
37 depends on HWMON && I2C && EXPERIMENTAL 40 depends on HWMON && I2C && EXPERIMENTAL
38 select I2C_SENSOR 41 select HWMON_VID
39 help 42 help
40 If you say yes here you get support for Analog Devices ADM1025 43 If you say yes here you get support for Analog Devices ADM1025
41 and Philips NE1619 sensor chips. 44 and Philips NE1619 sensor chips.
@@ -46,7 +49,7 @@ config SENSORS_ADM1025
46config SENSORS_ADM1026 49config SENSORS_ADM1026
47 tristate "Analog Devices ADM1026 and compatibles" 50 tristate "Analog Devices ADM1026 and compatibles"
48 depends on HWMON && I2C && EXPERIMENTAL 51 depends on HWMON && I2C && EXPERIMENTAL
49 select I2C_SENSOR 52 select HWMON_VID
50 help 53 help
51 If you say yes here you get support for Analog Devices ADM1026 54 If you say yes here you get support for Analog Devices ADM1026
52 sensor chip. 55 sensor chip.
@@ -57,7 +60,6 @@ config SENSORS_ADM1026
57config SENSORS_ADM1031 60config SENSORS_ADM1031
58 tristate "Analog Devices ADM1031 and compatibles" 61 tristate "Analog Devices ADM1031 and compatibles"
59 depends on HWMON && I2C && EXPERIMENTAL 62 depends on HWMON && I2C && EXPERIMENTAL
60 select I2C_SENSOR
61 help 63 help
62 If you say yes here you get support for Analog Devices ADM1031 64 If you say yes here you get support for Analog Devices ADM1031
63 and ADM1030 sensor chips. 65 and ADM1030 sensor chips.
@@ -68,7 +70,7 @@ config SENSORS_ADM1031
68config SENSORS_ADM9240 70config SENSORS_ADM9240
69 tristate "Analog Devices ADM9240 and compatibles" 71 tristate "Analog Devices ADM9240 and compatibles"
70 depends on HWMON && I2C && EXPERIMENTAL 72 depends on HWMON && I2C && EXPERIMENTAL
71 select I2C_SENSOR 73 select HWMON_VID
72 help 74 help
73 If you say yes here you get support for Analog Devices ADM9240, 75 If you say yes here you get support for Analog Devices ADM9240,
74 Dallas DS1780, National Semiconductor LM81 sensor chips. 76 Dallas DS1780, National Semiconductor LM81 sensor chips.
@@ -79,7 +81,7 @@ config SENSORS_ADM9240
79config SENSORS_ASB100 81config SENSORS_ASB100
80 tristate "Asus ASB100 Bach" 82 tristate "Asus ASB100 Bach"
81 depends on HWMON && I2C && EXPERIMENTAL 83 depends on HWMON && I2C && EXPERIMENTAL
82 select I2C_SENSOR 84 select HWMON_VID
83 help 85 help
84 If you say yes here you get support for the ASB100 Bach sensor 86 If you say yes here you get support for the ASB100 Bach sensor
85 chip found on some Asus mainboards. 87 chip found on some Asus mainboards.
@@ -90,7 +92,7 @@ config SENSORS_ASB100
90config SENSORS_ATXP1 92config SENSORS_ATXP1
91 tristate "Attansic ATXP1 VID controller" 93 tristate "Attansic ATXP1 VID controller"
92 depends on HWMON && I2C && EXPERIMENTAL 94 depends on HWMON && I2C && EXPERIMENTAL
93 select I2C_SENSOR 95 select HWMON_VID
94 help 96 help
95 If you say yes here you get support for the Attansic ATXP1 VID 97 If you say yes here you get support for the Attansic ATXP1 VID
96 controller. 98 controller.
@@ -104,7 +106,6 @@ config SENSORS_ATXP1
104config SENSORS_DS1621 106config SENSORS_DS1621
105 tristate "Dallas Semiconductor DS1621 and DS1625" 107 tristate "Dallas Semiconductor DS1621 and DS1625"
106 depends on HWMON && I2C && EXPERIMENTAL 108 depends on HWMON && I2C && EXPERIMENTAL
107 select I2C_SENSOR
108 help 109 help
109 If you say yes here you get support for Dallas Semiconductor 110 If you say yes here you get support for Dallas Semiconductor
110 DS1621 and DS1625 sensor chips. 111 DS1621 and DS1625 sensor chips.
@@ -115,7 +116,6 @@ config SENSORS_DS1621
115config SENSORS_FSCHER 116config SENSORS_FSCHER
116 tristate "FSC Hermes" 117 tristate "FSC Hermes"
117 depends on HWMON && I2C && EXPERIMENTAL 118 depends on HWMON && I2C && EXPERIMENTAL
118 select I2C_SENSOR
119 help 119 help
120 If you say yes here you get support for Fujitsu Siemens 120 If you say yes here you get support for Fujitsu Siemens
121 Computers Hermes sensor chips. 121 Computers Hermes sensor chips.
@@ -126,7 +126,6 @@ config SENSORS_FSCHER
126config SENSORS_FSCPOS 126config SENSORS_FSCPOS
127 tristate "FSC Poseidon" 127 tristate "FSC Poseidon"
128 depends on HWMON && I2C && EXPERIMENTAL 128 depends on HWMON && I2C && EXPERIMENTAL
129 select I2C_SENSOR
130 help 129 help
131 If you say yes here you get support for Fujitsu Siemens 130 If you say yes here you get support for Fujitsu Siemens
132 Computers Poseidon sensor chips. 131 Computers Poseidon sensor chips.
@@ -137,7 +136,6 @@ config SENSORS_FSCPOS
137config SENSORS_GL518SM 136config SENSORS_GL518SM
138 tristate "Genesys Logic GL518SM" 137 tristate "Genesys Logic GL518SM"
139 depends on HWMON && I2C 138 depends on HWMON && I2C
140 select I2C_SENSOR
141 help 139 help
142 If you say yes here you get support for Genesys Logic GL518SM 140 If you say yes here you get support for Genesys Logic GL518SM
143 sensor chips. 141 sensor chips.
@@ -148,7 +146,7 @@ config SENSORS_GL518SM
148config SENSORS_GL520SM 146config SENSORS_GL520SM
149 tristate "Genesys Logic GL520SM" 147 tristate "Genesys Logic GL520SM"
150 depends on HWMON && I2C && EXPERIMENTAL 148 depends on HWMON && I2C && EXPERIMENTAL
151 select I2C_SENSOR 149 select HWMON_VID
152 help 150 help
153 If you say yes here you get support for Genesys Logic GL520SM 151 If you say yes here you get support for Genesys Logic GL520SM
154 sensor chips. 152 sensor chips.
@@ -159,8 +157,8 @@ config SENSORS_GL520SM
159config SENSORS_IT87 157config SENSORS_IT87
160 tristate "ITE IT87xx and compatibles" 158 tristate "ITE IT87xx and compatibles"
161 depends on HWMON && I2C 159 depends on HWMON && I2C
162 select I2C_SENSOR
163 select I2C_ISA 160 select I2C_ISA
161 select HWMON_VID
164 help 162 help
165 If you say yes here you get support for ITE IT87xx sensor chips 163 If you say yes here you get support for ITE IT87xx sensor chips
166 and clones: SiS960. 164 and clones: SiS960.
@@ -171,7 +169,6 @@ config SENSORS_IT87
171config SENSORS_LM63 169config SENSORS_LM63
172 tristate "National Semiconductor LM63" 170 tristate "National Semiconductor LM63"
173 depends on HWMON && I2C && EXPERIMENTAL 171 depends on HWMON && I2C && EXPERIMENTAL
174 select I2C_SENSOR
175 help 172 help
176 If you say yes here you get support for the National Semiconductor 173 If you say yes here you get support for the National Semiconductor
177 LM63 remote diode digital temperature sensor with integrated fan 174 LM63 remote diode digital temperature sensor with integrated fan
@@ -184,7 +181,6 @@ config SENSORS_LM63
184config SENSORS_LM75 181config SENSORS_LM75
185 tristate "National Semiconductor LM75 and compatibles" 182 tristate "National Semiconductor LM75 and compatibles"
186 depends on HWMON && I2C 183 depends on HWMON && I2C
187 select I2C_SENSOR
188 help 184 help
189 If you say yes here you get support for National Semiconductor LM75 185 If you say yes here you get support for National Semiconductor LM75
190 sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in 186 sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in
@@ -200,7 +196,6 @@ config SENSORS_LM75
200config SENSORS_LM77 196config SENSORS_LM77
201 tristate "National Semiconductor LM77" 197 tristate "National Semiconductor LM77"
202 depends on HWMON && I2C && EXPERIMENTAL 198 depends on HWMON && I2C && EXPERIMENTAL
203 select I2C_SENSOR
204 help 199 help
205 If you say yes here you get support for National Semiconductor LM77 200 If you say yes here you get support for National Semiconductor LM77
206 sensor chips. 201 sensor chips.
@@ -211,7 +206,6 @@ config SENSORS_LM77
211config SENSORS_LM78 206config SENSORS_LM78
212 tristate "National Semiconductor LM78 and compatibles" 207 tristate "National Semiconductor LM78 and compatibles"
213 depends on HWMON && I2C && EXPERIMENTAL 208 depends on HWMON && I2C && EXPERIMENTAL
214 select I2C_SENSOR
215 select I2C_ISA 209 select I2C_ISA
216 help 210 help
217 If you say yes here you get support for National Semiconductor LM78, 211 If you say yes here you get support for National Semiconductor LM78,
@@ -223,7 +217,6 @@ config SENSORS_LM78
223config SENSORS_LM80 217config SENSORS_LM80
224 tristate "National Semiconductor LM80" 218 tristate "National Semiconductor LM80"
225 depends on HWMON && I2C && EXPERIMENTAL 219 depends on HWMON && I2C && EXPERIMENTAL
226 select I2C_SENSOR
227 help 220 help
228 If you say yes here you get support for National Semiconductor 221 If you say yes here you get support for National Semiconductor
229 LM80 sensor chips. 222 LM80 sensor chips.
@@ -234,7 +227,6 @@ config SENSORS_LM80
234config SENSORS_LM83 227config SENSORS_LM83
235 tristate "National Semiconductor LM83" 228 tristate "National Semiconductor LM83"
236 depends on HWMON && I2C 229 depends on HWMON && I2C
237 select I2C_SENSOR
238 help 230 help
239 If you say yes here you get support for National Semiconductor 231 If you say yes here you get support for National Semiconductor
240 LM83 sensor chips. 232 LM83 sensor chips.
@@ -245,7 +237,7 @@ config SENSORS_LM83
245config SENSORS_LM85 237config SENSORS_LM85
246 tristate "National Semiconductor LM85 and compatibles" 238 tristate "National Semiconductor LM85 and compatibles"
247 depends on HWMON && I2C && EXPERIMENTAL 239 depends on HWMON && I2C && EXPERIMENTAL
248 select I2C_SENSOR 240 select HWMON_VID
249 help 241 help
250 If you say yes here you get support for National Semiconductor LM85 242 If you say yes here you get support for National Semiconductor LM85
251 sensor chips and clones: ADT7463, EMC6D100, EMC6D102 and ADM1027. 243 sensor chips and clones: ADT7463, EMC6D100, EMC6D102 and ADM1027.
@@ -256,7 +248,7 @@ config SENSORS_LM85
256config SENSORS_LM87 248config SENSORS_LM87
257 tristate "National Semiconductor LM87" 249 tristate "National Semiconductor LM87"
258 depends on HWMON && I2C && EXPERIMENTAL 250 depends on HWMON && I2C && EXPERIMENTAL
259 select I2C_SENSOR 251 select HWMON_VID
260 help 252 help
261 If you say yes here you get support for National Semiconductor LM87 253 If you say yes here you get support for National Semiconductor LM87
262 sensor chips. 254 sensor chips.
@@ -267,7 +259,6 @@ config SENSORS_LM87
267config SENSORS_LM90 259config SENSORS_LM90
268 tristate "National Semiconductor LM90 and compatibles" 260 tristate "National Semiconductor LM90 and compatibles"
269 depends on HWMON && I2C 261 depends on HWMON && I2C
270 select I2C_SENSOR
271 help 262 help
272 If you say yes here you get support for National Semiconductor LM90, 263 If you say yes here you get support for National Semiconductor LM90,
273 LM86, LM89 and LM99, Analog Devices ADM1032 and Maxim MAX6657 and 264 LM86, LM89 and LM99, Analog Devices ADM1032 and Maxim MAX6657 and
@@ -282,7 +273,6 @@ config SENSORS_LM90
282config SENSORS_LM92 273config SENSORS_LM92
283 tristate "National Semiconductor LM92 and compatibles" 274 tristate "National Semiconductor LM92 and compatibles"
284 depends on HWMON && I2C && EXPERIMENTAL 275 depends on HWMON && I2C && EXPERIMENTAL
285 select I2C_SENSOR
286 help 276 help
287 If you say yes here you get support for National Semiconductor LM92 277 If you say yes here you get support for National Semiconductor LM92
288 and Maxim MAX6635 sensor chips. 278 and Maxim MAX6635 sensor chips.
@@ -293,7 +283,6 @@ config SENSORS_LM92
293config SENSORS_MAX1619 283config SENSORS_MAX1619
294 tristate "Maxim MAX1619 sensor chip" 284 tristate "Maxim MAX1619 sensor chip"
295 depends on HWMON && I2C && EXPERIMENTAL 285 depends on HWMON && I2C && EXPERIMENTAL
296 select I2C_SENSOR
297 help 286 help
298 If you say yes here you get support for MAX1619 sensor chip. 287 If you say yes here you get support for MAX1619 sensor chip.
299 288
@@ -303,8 +292,8 @@ config SENSORS_MAX1619
303config SENSORS_PC87360 292config SENSORS_PC87360
304 tristate "National Semiconductor PC87360 family" 293 tristate "National Semiconductor PC87360 family"
305 depends on HWMON && I2C && EXPERIMENTAL 294 depends on HWMON && I2C && EXPERIMENTAL
306 select I2C_SENSOR
307 select I2C_ISA 295 select I2C_ISA
296 select HWMON_VID
308 help 297 help
309 If you say yes here you get access to the hardware monitoring 298 If you say yes here you get access to the hardware monitoring
310 functions of the National Semiconductor PC8736x Super-I/O chips. 299 functions of the National Semiconductor PC8736x Super-I/O chips.
@@ -318,7 +307,6 @@ config SENSORS_PC87360
318config SENSORS_SIS5595 307config SENSORS_SIS5595
319 tristate "Silicon Integrated Systems Corp. SiS5595" 308 tristate "Silicon Integrated Systems Corp. SiS5595"
320 depends on HWMON && I2C && PCI && EXPERIMENTAL 309 depends on HWMON && I2C && PCI && EXPERIMENTAL
321 select I2C_SENSOR
322 select I2C_ISA 310 select I2C_ISA
323 help 311 help
324 If you say yes here you get support for the integrated sensors in 312 If you say yes here you get support for the integrated sensors in
@@ -330,7 +318,6 @@ config SENSORS_SIS5595
330config SENSORS_SMSC47M1 318config SENSORS_SMSC47M1
331 tristate "SMSC LPC47M10x and compatibles" 319 tristate "SMSC LPC47M10x and compatibles"
332 depends on HWMON && I2C && EXPERIMENTAL 320 depends on HWMON && I2C && EXPERIMENTAL
333 select I2C_SENSOR
334 select I2C_ISA 321 select I2C_ISA
335 help 322 help
336 If you say yes here you get support for the integrated fan 323 If you say yes here you get support for the integrated fan
@@ -343,7 +330,6 @@ config SENSORS_SMSC47M1
343config SENSORS_SMSC47B397 330config SENSORS_SMSC47B397
344 tristate "SMSC LPC47B397-NC" 331 tristate "SMSC LPC47B397-NC"
345 depends on HWMON && I2C && EXPERIMENTAL 332 depends on HWMON && I2C && EXPERIMENTAL
346 select I2C_SENSOR
347 select I2C_ISA 333 select I2C_ISA
348 help 334 help
349 If you say yes here you get support for the SMSC LPC47B397-NC 335 If you say yes here you get support for the SMSC LPC47B397-NC
@@ -355,7 +341,6 @@ config SENSORS_SMSC47B397
355config SENSORS_VIA686A 341config SENSORS_VIA686A
356 tristate "VIA686A" 342 tristate "VIA686A"
357 depends on HWMON && I2C && PCI 343 depends on HWMON && I2C && PCI
358 select I2C_SENSOR
359 select I2C_ISA 344 select I2C_ISA
360 help 345 help
361 If you say yes here you get support for the integrated sensors in 346 If you say yes here you get support for the integrated sensors in
@@ -367,8 +352,8 @@ config SENSORS_VIA686A
367config SENSORS_W83781D 352config SENSORS_W83781D
368 tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F" 353 tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F"
369 depends on HWMON && I2C 354 depends on HWMON && I2C
370 select I2C_SENSOR
371 select I2C_ISA 355 select I2C_ISA
356 select HWMON_VID
372 help 357 help
373 If you say yes here you get support for the Winbond W8378x series 358 If you say yes here you get support for the Winbond W8378x series
374 of sensor chips: the W83781D, W83782D, W83783S and W83627HF, 359 of sensor chips: the W83781D, W83782D, W83783S and W83627HF,
@@ -380,7 +365,6 @@ config SENSORS_W83781D
380config SENSORS_W83792D 365config SENSORS_W83792D
381 tristate "Winbond W83792D" 366 tristate "Winbond W83792D"
382 depends on HWMON && I2C && EXPERIMENTAL 367 depends on HWMON && I2C && EXPERIMENTAL
383 select I2C_SENSOR
384 help 368 help
385 If you say yes here you get support for the Winbond W83792D chip. 369 If you say yes here you get support for the Winbond W83792D chip.
386 370
@@ -390,7 +374,6 @@ config SENSORS_W83792D
390config SENSORS_W83L785TS 374config SENSORS_W83L785TS
391 tristate "Winbond W83L785TS-S" 375 tristate "Winbond W83L785TS-S"
392 depends on HWMON && I2C && EXPERIMENTAL 376 depends on HWMON && I2C && EXPERIMENTAL
393 select I2C_SENSOR
394 help 377 help
395 If you say yes here you get support for the Winbond W83L785TS-S 378 If you say yes here you get support for the Winbond W83L785TS-S
396 sensor chip, which is used on the Asus A7N8X, among other 379 sensor chip, which is used on the Asus A7N8X, among other
@@ -402,8 +385,8 @@ config SENSORS_W83L785TS
402config SENSORS_W83627HF 385config SENSORS_W83627HF
403 tristate "Winbond W83627HF, W83627THF, W83637HF, W83697HF" 386 tristate "Winbond W83627HF, W83627THF, W83637HF, W83697HF"
404 depends on HWMON && I2C && EXPERIMENTAL 387 depends on HWMON && I2C && EXPERIMENTAL
405 select I2C_SENSOR
406 select I2C_ISA 388 select I2C_ISA
389 select HWMON_VID
407 help 390 help
408 If you say yes here you get support for the Winbond W836X7 series 391 If you say yes here you get support for the Winbond W836X7 series
409 of sensor chips: the W83627HF, W83627THF, W83637HF, and the W83697HF 392 of sensor chips: the W83627HF, W83627THF, W83637HF, and the W83697HF
@@ -414,7 +397,6 @@ config SENSORS_W83627HF
414config SENSORS_W83627EHF 397config SENSORS_W83627EHF
415 tristate "Winbond W83627EHF" 398 tristate "Winbond W83627EHF"
416 depends on HWMON && I2C && EXPERIMENTAL 399 depends on HWMON && I2C && EXPERIMENTAL
417 select I2C_SENSOR
418 select I2C_ISA 400 select I2C_ISA
419 help 401 help
420 If you say yes here you get preliminary support for the hardware 402 If you say yes here you get preliminary support for the hardware
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 187b89d47f83..381f1bf04cc5 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -3,6 +3,7 @@
3# 3#
4 4
5obj-$(CONFIG_HWMON) += hwmon.o 5obj-$(CONFIG_HWMON) += hwmon.o
6obj-$(CONFIG_HWMON_VID) += hwmon-vid.o
6 7
7# asb100, then w83781d go first, as they can override other drivers' addresses. 8# asb100, then w83781d go first, as they can override other drivers' addresses.
8obj-$(CONFIG_SENSORS_ASB100) += asb100.o 9obj-$(CONFIG_SENSORS_ASB100) += asb100.o
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
index 229fd0de6f9e..526b7ff179eb 100644
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -50,8 +50,8 @@
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <linux/jiffies.h> 51#include <linux/jiffies.h>
52#include <linux/i2c.h> 52#include <linux/i2c.h>
53#include <linux/i2c-vid.h>
54#include <linux/hwmon.h> 53#include <linux/hwmon.h>
54#include <linux/hwmon-vid.h>
55#include <linux/err.h> 55#include <linux/err.h>
56 56
57/* 57/*
@@ -473,7 +473,7 @@ static void adm1025_init_client(struct i2c_client *client)
473 struct adm1025_data *data = i2c_get_clientdata(client); 473 struct adm1025_data *data = i2c_get_clientdata(client);
474 int i; 474 int i;
475 475
476 data->vrm = i2c_which_vrm(); 476 data->vrm = vid_which_vrm();
477 477
478 /* 478 /*
479 * Set high limits 479 * Set high limits
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index f32f819efcfc..625158110fd4 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -28,9 +28,9 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/jiffies.h> 29#include <linux/jiffies.h>
30#include <linux/i2c.h> 30#include <linux/i2c.h>
31#include <linux/i2c-vid.h>
32#include <linux/hwmon-sysfs.h>
33#include <linux/hwmon.h> 31#include <linux/hwmon.h>
32#include <linux/hwmon-sysfs.h>
33#include <linux/hwmon-vid.h>
34#include <linux/err.h> 34#include <linux/err.h>
35 35
36/* Addresses to scan */ 36/* Addresses to scan */
@@ -1552,7 +1552,7 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,
1552 goto exitfree; 1552 goto exitfree;
1553 1553
1554 /* Set the VRM version */ 1554 /* Set the VRM version */
1555 data->vrm = i2c_which_vrm(); 1555 data->vrm = vid_which_vrm();
1556 1556
1557 /* Initialize the ADM1026 chip */ 1557 /* Initialize the ADM1026 chip */
1558 adm1026_init_client(new_client); 1558 adm1026_init_client(new_client);
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 0a742cb88f4c..bc7faef162f7 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -45,8 +45,8 @@
45#include <linux/module.h> 45#include <linux/module.h>
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/i2c.h> 47#include <linux/i2c.h>
48#include <linux/i2c-vid.h>
49#include <linux/hwmon.h> 48#include <linux/hwmon.h>
49#include <linux/hwmon-vid.h>
50#include <linux/err.h> 50#include <linux/err.h>
51 51
52/* Addresses to scan */ 52/* Addresses to scan */
@@ -657,7 +657,7 @@ static void adm9240_init_client(struct i2c_client *client)
657 u8 conf = adm9240_read_value(client, ADM9240_REG_CONFIG); 657 u8 conf = adm9240_read_value(client, ADM9240_REG_CONFIG);
658 u8 mode = adm9240_read_value(client, ADM9240_REG_TEMP_CONF) & 3; 658 u8 mode = adm9240_read_value(client, ADM9240_REG_TEMP_CONF) & 3;
659 659
660 data->vrm = i2c_which_vrm(); /* need this to report vid as mV */ 660 data->vrm = vid_which_vrm(); /* need this to report vid as mV */
661 661
662 dev_info(&client->dev, "Using VRM: %d.%d\n", data->vrm / 10, 662 dev_info(&client->dev, "Using VRM: %d.%d\n", data->vrm / 10,
663 data->vrm % 10); 663 data->vrm % 10);
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 66b0dbd1af0e..8e34855a6274 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -39,8 +39,8 @@
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/i2c.h> 41#include <linux/i2c.h>
42#include <linux/i2c-vid.h>
43#include <linux/hwmon.h> 42#include <linux/hwmon.h>
43#include <linux/hwmon-vid.h>
44#include <linux/err.h> 44#include <linux/err.h>
45#include <linux/init.h> 45#include <linux/init.h>
46#include <linux/jiffies.h> 46#include <linux/jiffies.h>
@@ -973,7 +973,7 @@ static void asb100_init_client(struct i2c_client *client)
973 973
974 vid = asb100_read_value(client, ASB100_REG_VID_FANDIV) & 0x0f; 974 vid = asb100_read_value(client, ASB100_REG_VID_FANDIV) & 0x0f;
975 vid |= (asb100_read_value(client, ASB100_REG_CHIPID) & 0x01) << 4; 975 vid |= (asb100_read_value(client, ASB100_REG_CHIPID) & 0x01) << 4;
976 data->vrm = i2c_which_vrm(); 976 data->vrm = vid_which_vrm();
977 vid = vid_from_reg(vid, data->vrm); 977 vid = vid_from_reg(vid, data->vrm);
978 978
979 /* Start monitoring */ 979 /* Start monitoring */
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index 5cf77e67a2ed..deb4d34c9539 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -23,8 +23,8 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/jiffies.h> 24#include <linux/jiffies.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c-vid.h>
27#include <linux/hwmon.h> 26#include <linux/hwmon.h>
27#include <linux/hwmon-vid.h>
28#include <linux/err.h> 28#include <linux/err.h>
29 29
30MODULE_LICENSE("GPL"); 30MODULE_LICENSE("GPL");
@@ -296,7 +296,7 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind)
296 } 296 }
297 297
298 /* Get VRM */ 298 /* Get VRM */
299 data->vrm = i2c_which_vrm(); 299 data->vrm = vid_which_vrm();
300 300
301 if ((data->vrm != 90) && (data->vrm != 91)) { 301 if ((data->vrm != 90) && (data->vrm != 91)) {
302 dev_err(&new_client->dev, "Not supporting VRM %d.%d\n", 302 dev_err(&new_client->dev, "Not supporting VRM %d.%d\n",
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index de6608a159c3..12fd757066fc 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -26,8 +26,8 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/jiffies.h> 27#include <linux/jiffies.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c-vid.h>
30#include <linux/hwmon.h> 29#include <linux/hwmon.h>
30#include <linux/hwmon-vid.h>
31#include <linux/err.h> 31#include <linux/err.h>
32 32
33/* Type of the extra sensor */ 33/* Type of the extra sensor */
@@ -617,7 +617,7 @@ static void gl520_init_client(struct i2c_client *client)
617 conf = oldconf = gl520_read_value(client, GL520_REG_CONF); 617 conf = oldconf = gl520_read_value(client, GL520_REG_CONF);
618 618
619 data->alarm_mask = 0xff; 619 data->alarm_mask = 0xff;
620 data->vrm = i2c_which_vrm(); 620 data->vrm = vid_which_vrm();
621 621
622 if (extra_sensor_type == 1) 622 if (extra_sensor_type == 1)
623 conf &= ~0x10; 623 conf &= ~0x10;
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
new file mode 100644
index 000000000000..ce475c93f836
--- /dev/null
+++ b/drivers/hwmon/hwmon-vid.c
@@ -0,0 +1,103 @@
1/*
2 hwmon-vid.c - VID/VRM/VRD voltage conversions
3
4 Copyright (c) 2004 Rudolf Marek <r.marek@sh.cvut.cz>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include <linux/config.h>
22#include <linux/module.h>
23#include <linux/kernel.h>
24#include <linux/hwmon-vid.h>
25
26struct vrm_model {
27 u8 vendor;
28 u8 eff_family;
29 u8 eff_model;
30 int vrm_type;
31};
32
33#define ANY 0xFF
34
35#ifdef CONFIG_X86
36
37static struct vrm_model vrm_models[] = {
38 {X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */
39 {X86_VENDOR_AMD, 0xF, ANY, 24}, /* Athlon 64, Opteron */
40 {X86_VENDOR_INTEL, 0x6, 0x9, 85}, /* 0.13um too */
41 {X86_VENDOR_INTEL, 0x6, 0xB, 85}, /* 0xB Tualatin */
42 {X86_VENDOR_INTEL, 0x6, ANY, 82}, /* any P6 */
43 {X86_VENDOR_INTEL, 0x7, ANY, 0}, /* Itanium */
44 {X86_VENDOR_INTEL, 0xF, 0x3, 100}, /* P4 Prescott */
45 {X86_VENDOR_INTEL, 0xF, ANY, 90}, /* P4 before Prescott */
46 {X86_VENDOR_INTEL, 0x10,ANY, 0}, /* Itanium 2 */
47 {X86_VENDOR_UNKNOWN, ANY, ANY, 0} /* stop here */
48 };
49
50static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor)
51{
52 int i = 0;
53
54 while (vrm_models[i].vendor!=X86_VENDOR_UNKNOWN) {
55 if (vrm_models[i].vendor==vendor)
56 if ((vrm_models[i].eff_family==eff_family)&& \
57 ((vrm_models[i].eff_model==eff_model)|| \
58 (vrm_models[i].eff_model==ANY)))
59 return vrm_models[i].vrm_type;
60 i++;
61 }
62
63 return 0;
64}
65
66int vid_which_vrm(void)
67{
68 struct cpuinfo_x86 *c = cpu_data;
69 u32 eax;
70 u8 eff_family, eff_model;
71 int vrm_ret;
72
73 if (c->x86 < 6) return 0; /* any CPU with familly lower than 6
74 dont have VID and/or CPUID */
75 eax = cpuid_eax(1);
76 eff_family = ((eax & 0x00000F00)>>8);
77 eff_model = ((eax & 0x000000F0)>>4);
78 if (eff_family == 0xF) { /* use extended model & family */
79 eff_family += ((eax & 0x00F00000)>>20);
80 eff_model += ((eax & 0x000F0000)>>16)<<4;
81 }
82 vrm_ret = find_vrm(eff_family,eff_model,c->x86_vendor);
83 if (vrm_ret == 0)
84 printk(KERN_INFO "hwmon-vid: Unknown VRM version of your"
85 " x86 CPU\n");
86 return vrm_ret;
87}
88
89/* and now for something completely different for Non-x86 world*/
90#else
91int vid_which_vrm(void)
92{
93 printk(KERN_INFO "hwmon-vid: Unknown VRM version of your CPU\n");
94 return 0;
95}
96#endif
97
98EXPORT_SYMBOL(vid_which_vrm);
99
100MODULE_AUTHOR("Rudolf Marek <r.marek@sh.cvut.cz>");
101
102MODULE_DESCRIPTION("hwmon-vid driver");
103MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 84877665b66e..53cc2b6d6385 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -37,9 +37,9 @@
37#include <linux/jiffies.h> 37#include <linux/jiffies.h>
38#include <linux/i2c.h> 38#include <linux/i2c.h>
39#include <linux/i2c-isa.h> 39#include <linux/i2c-isa.h>
40#include <linux/i2c-vid.h>
41#include <linux/hwmon-sysfs.h>
42#include <linux/hwmon.h> 40#include <linux/hwmon.h>
41#include <linux/hwmon-sysfs.h>
42#include <linux/hwmon-vid.h>
43#include <linux/err.h> 43#include <linux/err.h>
44#include <asm/io.h> 44#include <asm/io.h>
45 45
@@ -919,7 +919,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
919 } 919 }
920 920
921 if (data->type == it8712) { 921 if (data->type == it8712) {
922 data->vrm = i2c_which_vrm(); 922 data->vrm = vid_which_vrm();
923 device_create_file_vrm(new_client); 923 device_create_file_vrm(new_client);
924 device_create_file_vid(new_client); 924 device_create_file_vid(new_client);
925 } 925 }
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index aeb478815f72..ab214df9624b 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -28,8 +28,8 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/jiffies.h> 29#include <linux/jiffies.h>
30#include <linux/i2c.h> 30#include <linux/i2c.h>
31#include <linux/i2c-vid.h>
32#include <linux/hwmon.h> 31#include <linux/hwmon.h>
32#include <linux/hwmon-vid.h>
33#include <linux/err.h> 33#include <linux/err.h>
34 34
35/* Addresses to scan */ 35/* Addresses to scan */
@@ -1147,7 +1147,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
1147 goto ERROR1; 1147 goto ERROR1;
1148 1148
1149 /* Set the VRM version */ 1149 /* Set the VRM version */
1150 data->vrm = i2c_which_vrm(); 1150 data->vrm = vid_which_vrm();
1151 1151
1152 /* Initialize the LM85 chip */ 1152 /* Initialize the LM85 chip */
1153 lm85_init_client(new_client); 1153 lm85_init_client(new_client);
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index d0d2464c1b73..dca996de4c33 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -57,8 +57,8 @@
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/jiffies.h> 58#include <linux/jiffies.h>
59#include <linux/i2c.h> 59#include <linux/i2c.h>
60#include <linux/i2c-vid.h>
61#include <linux/hwmon.h> 60#include <linux/hwmon.h>
61#include <linux/hwmon-vid.h>
62#include <linux/err.h> 62#include <linux/err.h>
63 63
64/* 64/*
@@ -694,7 +694,7 @@ static void lm87_init_client(struct i2c_client *client)
694 u8 config; 694 u8 config;
695 695
696 data->channel = lm87_read_value(client, LM87_REG_CHANNEL_MODE); 696 data->channel = lm87_read_value(client, LM87_REG_CHANNEL_MODE);
697 data->vrm = i2c_which_vrm(); 697 data->vrm = vid_which_vrm();
698 698
699 config = lm87_read_value(client, LM87_REG_CONFIG); 699 config = lm87_read_value(client, LM87_REG_CONFIG);
700 if (!(config & 0x01)) { 700 if (!(config & 0x01)) {
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index c66ae4f6e802..08fcb5aea764 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -39,8 +39,8 @@
39#include <linux/jiffies.h> 39#include <linux/jiffies.h>
40#include <linux/i2c.h> 40#include <linux/i2c.h>
41#include <linux/i2c-isa.h> 41#include <linux/i2c-isa.h>
42#include <linux/i2c-vid.h>
43#include <linux/hwmon.h> 42#include <linux/hwmon.h>
43#include <linux/hwmon-vid.h>
44#include <linux/err.h> 44#include <linux/err.h>
45#include <asm/io.h> 45#include <asm/io.h>
46 46
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index 2d2fcfb706d7..02bd5c0239a2 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -43,8 +43,8 @@
43#include <linux/jiffies.h> 43#include <linux/jiffies.h>
44#include <linux/i2c.h> 44#include <linux/i2c.h>
45#include <linux/i2c-isa.h> 45#include <linux/i2c-isa.h>
46#include <linux/i2c-vid.h>
47#include <linux/hwmon.h> 46#include <linux/hwmon.h>
47#include <linux/hwmon-vid.h>
48#include <linux/err.h> 48#include <linux/err.h>
49#include <asm/io.h> 49#include <asm/io.h>
50#include "lm75.h" 50#include "lm75.h"
@@ -1316,7 +1316,7 @@ static void w83627hf_init_client(struct i2c_client *client)
1316 data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82; 1316 data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82;
1317 } else { 1317 } else {
1318 /* Convert VID to voltage based on default VRM */ 1318 /* Convert VID to voltage based on default VRM */
1319 data->vrm = i2c_which_vrm(); 1319 data->vrm = vid_which_vrm();
1320 } 1320 }
1321 1321
1322 tmp = w83627hf_read_value(client, W83781D_REG_SCFG1); 1322 tmp = w83627hf_read_value(client, W83781D_REG_SCFG1);
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 47607983acfd..4c43337ca780 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -39,8 +39,8 @@
39#include <linux/jiffies.h> 39#include <linux/jiffies.h>
40#include <linux/i2c.h> 40#include <linux/i2c.h>
41#include <linux/i2c-isa.h> 41#include <linux/i2c-isa.h>
42#include <linux/i2c-vid.h>
43#include <linux/hwmon.h> 42#include <linux/hwmon.h>
43#include <linux/hwmon-vid.h>
44#include <linux/err.h> 44#include <linux/err.h>
45#include <asm/io.h> 45#include <asm/io.h>
46#include "lm75.h" 46#include "lm75.h"
@@ -1478,7 +1478,7 @@ w83781d_init_client(struct i2c_client *client)
1478 w83781d_write_value(client, W83781D_REG_BEEP_INTS2, 0); 1478 w83781d_write_value(client, W83781D_REG_BEEP_INTS2, 0);
1479 } 1479 }
1480 1480
1481 data->vrm = i2c_which_vrm(); 1481 data->vrm = vid_which_vrm();
1482 1482
1483 if ((type != w83781d) && (type != as99127f)) { 1483 if ((type != w83781d) && (type != as99127f)) {
1484 tmp = w83781d_read_value(client, W83781D_REG_SCFG1); 1484 tmp = w83781d_read_value(client, W83781D_REG_SCFG1);
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index d6d8c0f04e32..ba0c28015f6a 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -40,7 +40,6 @@
40#include <linux/init.h> 40#include <linux/init.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/i2c.h> 42#include <linux/i2c.h>
43#include <linux/i2c-vid.h>
44#include <linux/hwmon.h> 43#include <linux/hwmon.h>
45#include <linux/hwmon-sysfs.h> 44#include <linux/hwmon-sysfs.h>
46#include <linux/err.h> 45#include <linux/err.h>