27 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
29 #include <linux/module.h>
31 #include <linux/slab.h>
43 #define ABIT_UGURU3_SETTINGS_BANK 0x01
44 #define ABIT_UGURU3_SENSORS_BANK 0x08
45 #define ABIT_UGURU3_MISC_BANK 0x09
46 #define ABIT_UGURU3_ALARMS_START 0x1E
47 #define ABIT_UGURU3_SETTINGS_START 0x24
48 #define ABIT_UGURU3_VALUES_START 0x80
49 #define ABIT_UGURU3_BOARD_ID 0x0A
51 #define ABIT_UGURU3_TEMP_HIGH_ALARM_ENABLE 0x01
52 #define ABIT_UGURU3_VOLT_HIGH_ALARM_ENABLE 0x02
53 #define ABIT_UGURU3_VOLT_LOW_ALARM_ENABLE 0x04
54 #define ABIT_UGURU3_TEMP_HIGH_ALARM_FLAG 0x10
55 #define ABIT_UGURU3_VOLT_HIGH_ALARM_FLAG 0x20
56 #define ABIT_UGURU3_VOLT_LOW_ALARM_FLAG 0x40
57 #define ABIT_UGURU3_FAN_LOW_ALARM_ENABLE 0x01
58 #define ABIT_UGURU3_BEEP_ENABLE 0x08
59 #define ABIT_UGURU3_SHUTDOWN_ENABLE 0x80
61 #define ABIT_UGURU3_IN_SENSOR 0
62 #define ABIT_UGURU3_TEMP_SENSOR 1
63 #define ABIT_UGURU3_FAN_SENSOR 2
71 #define ABIT_UGURU3_WAIT_TIMEOUT 250
76 #define ABIT_UGURU3_SYNCHRONIZE_TIMEOUT 5
78 #define ABIT_UGURU3_NAME "abituguru3"
79 #define ABIT_UGURU3_DEBUG(format, arg...) \
81 printk(KERN_DEBUG ABIT_UGURU3_NAME ": " format , ## arg)
84 #define ABIT_UGURU3_MAX_NO_SENSORS 26
89 #define ABIT_UGURU3_IN_NAMES_LENGTH \
90 (11 + 2 * 9 + 2 * 15 + 2 * 22 + 10 + 14 + 11)
96 #define ABIT_UGURU3_TEMP_NAMES_LENGTH (13 + 11 + 12 + 13 + 20 + 12 + 16 + 13)
101 #define ABIT_UGURU3_FAN_NAMES_LENGTH (12 + 10 + 12 + 19 + 11 + 15 + 12)
106 #define ABIT_UGURU3_SYSFS_NAMES_LENGTH (16 * ABIT_UGURU3_IN_NAMES_LENGTH + \
107 (ABIT_UGURU3_MAX_NO_SENSORS - 16) * ABIT_UGURU3_TEMP_NAMES_LENGTH)
116 #define ABIT_UGURU3_BASE 0x00E0
117 #define ABIT_UGURU3_CMD 0x00
118 #define ABIT_UGURU3_DATA 0x04
119 #define ABIT_UGURU3_REGION_LENGTH 5
124 #define ABIT_UGURU3_SUCCESS -1
126 #define ABIT_UGURU3_STATUS_READY_FOR_READ 0x01
127 #define ABIT_UGURU3_STATUS_BUSY 0x02
141 #define ABIT_UGURU3_MAX_DMI_NAMES 2
198 { 0x000C, {
NULL } , {
199 {
"CPU Core", 0, 0, 10, 1, 0 },
200 {
"DDR", 1, 0, 10, 1, 0 },
201 {
"DDR VTT", 2, 0, 10, 1, 0 },
202 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
203 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
204 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
205 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
206 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
207 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
208 {
"ATX +5V", 9, 0, 30, 1, 0 },
209 {
"+3.3V", 10, 0, 20, 1, 0 },
210 {
"5VSB", 11, 0, 30, 1, 0 },
211 {
"CPU", 24, 1, 1, 1, 0 },
212 {
"System", 25, 1, 1, 1, 0 },
213 {
"PWM", 26, 1, 1, 1, 0 },
214 {
"CPU Fan", 32, 2, 60, 1, 0 },
215 {
"NB Fan", 33, 2, 60, 1, 0 },
216 {
"SYS FAN", 34, 2, 60, 1, 0 },
217 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
218 {
NULL, 0, 0, 0, 0, 0 } }
220 { 0x000D, {
NULL } , {
221 {
"CPU Core", 0, 0, 10, 1, 0 },
222 {
"DDR", 1, 0, 10, 1, 0 },
223 {
"DDR VTT", 2, 0, 10, 1, 0 },
224 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
225 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
226 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
227 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
228 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
229 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
230 {
"ATX +5V", 9, 0, 30, 1, 0 },
231 {
"+3.3V", 10, 0, 20, 1, 0 },
232 {
"5VSB", 11, 0, 30, 1, 0 },
233 {
"CPU", 24, 1, 1, 1, 0 },
234 {
"System", 25, 1, 1, 1, 0 },
235 {
"PWM1", 26, 1, 1, 1, 0 },
236 {
"PWM2", 27, 1, 1, 1, 0 },
237 {
"PWM3", 28, 1, 1, 1, 0 },
238 {
"PWM4", 29, 1, 1, 1, 0 },
239 {
"CPU Fan", 32, 2, 60, 1, 0 },
240 {
"NB Fan", 33, 2, 60, 1, 0 },
241 {
"SYS Fan", 34, 2, 60, 1, 0 },
242 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
243 {
"AUX2 Fan", 36, 2, 60, 1, 0 },
244 {
"AUX3 Fan", 37, 2, 60, 1, 0 },
245 {
"AUX4 Fan", 38, 2, 60, 1, 0 },
246 {
"AUX5 Fan", 39, 2, 60, 1, 0 },
247 {
NULL, 0, 0, 0, 0, 0 } }
249 { 0x000E, {
NULL } , {
250 {
"CPU Core", 0, 0, 10, 1, 0 },
251 {
"DDR", 1, 0, 10, 1, 0 },
252 {
"DDR VTT", 2, 0, 10, 1, 0 },
253 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
254 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
255 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
256 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
257 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
258 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
259 {
"ATX +5V", 9, 0, 30, 1, 0 },
260 {
"+3.3V", 10, 0, 20, 1, 0 },
261 {
"5VSB", 11, 0, 30, 1, 0 },
262 {
"CPU", 24, 1, 1, 1, 0 },
263 {
"System", 25, 1, 1, 1, 0 },
264 {
"PWM", 26, 1, 1, 1, 0 },
265 {
"CPU Fan", 32, 2, 60, 1, 0 },
266 {
"NB Fan", 33, 2, 60, 1, 0 },
267 {
"SYS Fan", 34, 2, 60, 1, 0 },
268 {
NULL, 0, 0, 0, 0, 0 } }
270 { 0x000F, {
NULL } , {
272 {
"CPU Core", 0, 0, 10, 1, 0 },
273 {
"DDR", 1, 0, 10, 1, 0 },
274 {
"DDR VTT", 2, 0, 10, 1, 0 },
275 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
276 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
277 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
278 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
279 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
280 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
281 {
"ATX +5V", 9, 0, 30, 1, 0 },
282 {
"+3.3V", 10, 0, 20, 1, 0 },
283 {
"5VSB", 11, 0, 30, 1, 0 },
284 {
"CPU", 24, 1, 1, 1, 0 },
285 {
"System", 25, 1, 1, 1, 0 },
286 {
"PWM", 26, 1, 1, 1, 0 },
287 {
"CPU Fan", 32, 2, 60, 1, 0 },
288 {
"NB Fan", 33, 2, 60, 1, 0 },
289 {
"SYS Fan", 34, 2, 60, 1, 0 },
290 {
NULL, 0, 0, 0, 0, 0 } }
292 { 0x0010, {
NULL } , {
293 {
"CPU Core", 0, 0, 10, 1, 0 },
294 {
"DDR", 1, 0, 10, 1, 0 },
295 {
"DDR VTT", 2, 0, 10, 1, 0 },
296 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
297 {
"NB 1.4V", 4, 0, 10, 1, 0 },
298 {
"SB 1.5V", 6, 0, 10, 1, 0 },
299 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
300 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
301 {
"ATX +5V", 9, 0, 30, 1, 0 },
302 {
"+3.3V", 10, 0, 20, 1, 0 },
303 {
"5VSB", 11, 0, 30, 1, 0 },
304 {
"CPU", 24, 1, 1, 1, 0 },
305 {
"SYS", 25, 1, 1, 1, 0 },
306 {
"PWM", 26, 1, 1, 1, 0 },
307 {
"CPU Fan", 32, 2, 60, 1, 0 },
308 {
"NB Fan", 33, 2, 60, 1, 0 },
309 {
"SYS Fan", 34, 2, 60, 1, 0 },
310 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
311 {
"OTES1 Fan", 36, 2, 60, 1, 0 },
312 {
NULL, 0, 0, 0, 0, 0 } }
314 { 0x0011, {
"AT8 32X",
NULL }, {
315 {
"CPU Core", 0, 0, 10, 1, 0 },
316 {
"DDR", 1, 0, 20, 1, 0 },
317 {
"DDR VTT", 2, 0, 10, 1, 0 },
318 {
"CPU VDDA 2.5V", 6, 0, 20, 1, 0 },
319 {
"NB 1.8V", 4, 0, 10, 1, 0 },
320 {
"NB 1.8V Dual", 5, 0, 10, 1, 0 },
321 {
"HTV 1.2", 3, 0, 10, 1, 0 },
322 {
"PCIE 1.2V", 12, 0, 10, 1, 0 },
323 {
"NB 1.2V", 13, 0, 10, 1, 0 },
324 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
325 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
326 {
"ATX +5V", 9, 0, 30, 1, 0 },
327 {
"+3.3V", 10, 0, 20, 1, 0 },
328 {
"5VSB", 11, 0, 30, 1, 0 },
329 {
"CPU", 24, 1, 1, 1, 0 },
330 {
"NB", 25, 1, 1, 1, 0 },
331 {
"System", 26, 1, 1, 1, 0 },
332 {
"PWM", 27, 1, 1, 1, 0 },
333 {
"CPU Fan", 32, 2, 60, 1, 0 },
334 {
"NB Fan", 33, 2, 60, 1, 0 },
335 {
"SYS Fan", 34, 2, 60, 1, 0 },
336 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
337 {
"AUX2 Fan", 36, 2, 60, 1, 0 },
338 {
"AUX3 Fan", 37, 2, 60, 1, 0 },
339 {
NULL, 0, 0, 0, 0, 0 } }
341 { 0x0012, {
NULL } , {
342 {
"CPU Core", 0, 0, 10, 1, 0 },
343 {
"DDR", 1, 0, 20, 1, 0 },
344 {
"DDR VTT", 2, 0, 10, 1, 0 },
345 {
"HyperTransport", 3, 0, 10, 1, 0 },
346 {
"CPU VDDA 2.5V", 5, 0, 20, 1, 0 },
347 {
"NB", 4, 0, 10, 1, 0 },
348 {
"SB", 6, 0, 10, 1, 0 },
349 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
350 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
351 {
"ATX +5V", 9, 0, 30, 1, 0 },
352 {
"+3.3V", 10, 0, 20, 1, 0 },
353 {
"5VSB", 11, 0, 30, 1, 0 },
354 {
"CPU", 24, 1, 1, 1, 0 },
355 {
"SYS", 25, 1, 1, 1, 0 },
356 {
"PWM", 26, 1, 1, 1, 0 },
357 {
"CPU Fan", 32, 2, 60, 1, 0 },
358 {
"NB Fan", 33, 2, 60, 1, 0 },
359 {
"SYS Fan", 34, 2, 60, 1, 0 },
360 {
"AUX1 Fan", 36, 2, 60, 1, 0 },
361 {
NULL, 0, 0, 0, 0, 0 } }
363 { 0x0013, {
NULL } , {
364 {
"CPU Core", 0, 0, 10, 1, 0 },
365 {
"DDR", 1, 0, 10, 1, 0 },
366 {
"DDR VTT", 2, 0, 10, 1, 0 },
367 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
368 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
369 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
370 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
371 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
372 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
373 {
"ATX +5V", 9, 0, 30, 1, 0 },
374 {
"+3.3V", 10, 0, 20, 1, 0 },
375 {
"5VSB", 11, 0, 30, 1, 0 },
376 {
"CPU", 24, 1, 1, 1, 0 },
377 {
"System", 25, 1, 1, 1, 0 },
378 {
"PWM1", 26, 1, 1, 1, 0 },
379 {
"PWM2", 27, 1, 1, 1, 0 },
380 {
"PWM3", 28, 1, 1, 1, 0 },
381 {
"PWM4", 29, 1, 1, 1, 0 },
382 {
"CPU Fan", 32, 2, 60, 1, 0 },
383 {
"NB Fan", 33, 2, 60, 1, 0 },
384 {
"SYS Fan", 34, 2, 60, 1, 0 },
385 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
386 {
"AUX2 Fan", 36, 2, 60, 1, 0 },
387 {
"AUX3 Fan", 37, 2, 60, 1, 0 },
388 {
"AUX4 Fan", 38, 2, 60, 1, 0 },
389 {
"AUX5 Fan", 39, 2, 60, 1, 0 },
390 {
NULL, 0, 0, 0, 0, 0 } }
392 { 0x0014, {
"AB9",
"AB9 Pro",
NULL }, {
393 {
"CPU Core", 0, 0, 10, 1, 0 },
394 {
"DDR", 1, 0, 10, 1, 0 },
395 {
"DDR VTT", 2, 0, 10, 1, 0 },
396 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
397 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
398 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
399 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
400 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
401 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
402 {
"ATX +5V", 9, 0, 30, 1, 0 },
403 {
"+3.3V", 10, 0, 20, 1, 0 },
404 {
"5VSB", 11, 0, 30, 1, 0 },
405 {
"CPU", 24, 1, 1, 1, 0 },
406 {
"System", 25, 1, 1, 1, 0 },
407 {
"PWM", 26, 1, 1, 1, 0 },
408 {
"CPU Fan", 32, 2, 60, 1, 0 },
409 {
"NB Fan", 33, 2, 60, 1, 0 },
410 {
"SYS Fan", 34, 2, 60, 1, 0 },
411 {
NULL, 0, 0, 0, 0, 0 } }
413 { 0x0015, {
NULL } , {
414 {
"CPU Core", 0, 0, 10, 1, 0 },
415 {
"DDR", 1, 0, 20, 1, 0 },
416 {
"DDR VTT", 2, 0, 10, 1, 0 },
417 {
"HyperTransport", 3, 0, 10, 1, 0 },
418 {
"CPU VDDA 2.5V", 5, 0, 20, 1, 0 },
419 {
"NB", 4, 0, 10, 1, 0 },
420 {
"SB", 6, 0, 10, 1, 0 },
421 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
422 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
423 {
"ATX +5V", 9, 0, 30, 1, 0 },
424 {
"+3.3V", 10, 0, 20, 1, 0 },
425 {
"5VSB", 11, 0, 30, 1, 0 },
426 {
"CPU", 24, 1, 1, 1, 0 },
427 {
"SYS", 25, 1, 1, 1, 0 },
428 {
"PWM", 26, 1, 1, 1, 0 },
429 {
"CPU Fan", 32, 2, 60, 1, 0 },
430 {
"NB Fan", 33, 2, 60, 1, 0 },
431 {
"SYS Fan", 34, 2, 60, 1, 0 },
432 {
"AUX1 Fan", 33, 2, 60, 1, 0 },
433 {
"AUX2 Fan", 35, 2, 60, 1, 0 },
434 {
"AUX3 Fan", 36, 2, 60, 1, 0 },
435 {
NULL, 0, 0, 0, 0, 0 } }
437 { 0x0016, {
"AW9D-MAX",
NULL }, {
438 {
"CPU Core", 0, 0, 10, 1, 0 },
439 {
"DDR2", 1, 0, 20, 1, 0 },
440 {
"DDR2 VTT", 2, 0, 10, 1, 0 },
441 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
442 {
"MCH & PCIE 1.5V", 4, 0, 10, 1, 0 },
443 {
"MCH 2.5V", 5, 0, 20, 1, 0 },
444 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
445 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
446 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
447 {
"ATX +5V", 9, 0, 30, 1, 0 },
448 {
"+3.3V", 10, 0, 20, 1, 0 },
449 {
"5VSB", 11, 0, 30, 1, 0 },
450 {
"CPU", 24, 1, 1, 1, 0 },
451 {
"System", 25, 1, 1, 1, 0 },
452 {
"PWM1", 26, 1, 1, 1, 0 },
453 {
"PWM2", 27, 1, 1, 1, 0 },
454 {
"PWM3", 28, 1, 1, 1, 0 },
455 {
"PWM4", 29, 1, 1, 1, 0 },
456 {
"CPU Fan", 32, 2, 60, 1, 0 },
457 {
"NB Fan", 33, 2, 60, 1, 0 },
458 {
"SYS Fan", 34, 2, 60, 1, 0 },
459 {
"AUX1 Fan", 35, 2, 60, 1, 0 },
460 {
"AUX2 Fan", 36, 2, 60, 1, 0 },
461 {
"AUX3 Fan", 37, 2, 60, 1, 0 },
462 {
"OTES1 Fan", 38, 2, 60, 1, 0 },
463 {
NULL, 0, 0, 0, 0, 0 } }
465 { 0x0017, {
NULL } , {
466 {
"CPU Core", 0, 0, 10, 1, 0 },
467 {
"DDR2", 1, 0, 20, 1, 0 },
468 {
"DDR2 VTT", 2, 0, 10, 1, 0 },
469 {
"HyperTransport", 3, 0, 10, 1, 0 },
470 {
"CPU VDDA 2.5V", 6, 0, 20, 1, 0 },
471 {
"NB 1.8V", 4, 0, 10, 1, 0 },
472 {
"NB 1.2V ", 13, 0, 10, 1, 0 },
473 {
"SB 1.2V", 5, 0, 10, 1, 0 },
474 {
"PCIE 1.2V", 12, 0, 10, 1, 0 },
475 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
476 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
477 {
"ATX +5V", 9, 0, 30, 1, 0 },
478 {
"ATX +3.3V", 10, 0, 20, 1, 0 },
479 {
"ATX 5VSB", 11, 0, 30, 1, 0 },
480 {
"CPU", 24, 1, 1, 1, 0 },
481 {
"System", 26, 1, 1, 1, 0 },
482 {
"PWM", 27, 1, 1, 1, 0 },
483 {
"CPU FAN", 32, 2, 60, 1, 0 },
484 {
"SYS FAN", 34, 2, 60, 1, 0 },
485 {
"AUX1 FAN", 35, 2, 60, 1, 0 },
486 {
"AUX2 FAN", 36, 2, 60, 1, 0 },
487 {
"AUX3 FAN", 37, 2, 60, 1, 0 },
488 {
NULL, 0, 0, 0, 0, 0 } }
490 { 0x0018, {
"AB9 QuadGT",
NULL }, {
491 {
"CPU Core", 0, 0, 10, 1, 0 },
492 {
"DDR2", 1, 0, 20, 1, 0 },
493 {
"DDR2 VTT", 2, 0, 10, 1, 0 },
494 {
"CPU VTT", 3, 0, 10, 1, 0 },
495 {
"MCH 1.25V", 4, 0, 10, 1, 0 },
496 {
"ICHIO 1.5V", 5, 0, 10, 1, 0 },
497 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
498 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
499 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
500 {
"ATX +5V", 9, 0, 30, 1, 0 },
501 {
"+3.3V", 10, 0, 20, 1, 0 },
502 {
"5VSB", 11, 0, 30, 1, 0 },
503 {
"CPU", 24, 1, 1, 1, 0 },
504 {
"System", 25, 1, 1, 1, 0 },
505 {
"PWM Phase1", 26, 1, 1, 1, 0 },
506 {
"PWM Phase2", 27, 1, 1, 1, 0 },
507 {
"PWM Phase3", 28, 1, 1, 1, 0 },
508 {
"PWM Phase4", 29, 1, 1, 1, 0 },
509 {
"PWM Phase5", 30, 1, 1, 1, 0 },
510 {
"CPU Fan", 32, 2, 60, 1, 0 },
511 {
"SYS Fan", 34, 2, 60, 1, 0 },
512 {
"AUX1 Fan", 33, 2, 60, 1, 0 },
513 {
"AUX2 Fan", 35, 2, 60, 1, 0 },
514 {
"AUX3 Fan", 36, 2, 60, 1, 0 },
515 {
NULL, 0, 0, 0, 0, 0 } }
517 { 0x0019, {
"IN9 32X MAX",
NULL }, {
518 {
"CPU Core", 7, 0, 10, 1, 0 },
519 {
"DDR2", 13, 0, 20, 1, 0 },
520 {
"DDR2 VTT", 14, 0, 10, 1, 0 },
521 {
"CPU VTT", 3, 0, 20, 1, 0 },
522 {
"NB 1.2V", 4, 0, 10, 1, 0 },
523 {
"SB 1.5V", 6, 0, 10, 1, 0 },
524 {
"HyperTransport", 5, 0, 10, 1, 0 },
525 {
"ATX +12V (24-Pin)", 12, 0, 60, 1, 0 },
526 {
"ATX +12V (4-pin)", 8, 0, 60, 1, 0 },
527 {
"ATX +5V", 9, 0, 30, 1, 0 },
528 {
"ATX +3.3V", 10, 0, 20, 1, 0 },
529 {
"ATX 5VSB", 11, 0, 30, 1, 0 },
530 {
"CPU", 24, 1, 1, 1, 0 },
531 {
"System", 25, 1, 1, 1, 0 },
532 {
"PWM Phase1", 26, 1, 1, 1, 0 },
533 {
"PWM Phase2", 27, 1, 1, 1, 0 },
534 {
"PWM Phase3", 28, 1, 1, 1, 0 },
535 {
"PWM Phase4", 29, 1, 1, 1, 0 },
536 {
"PWM Phase5", 30, 1, 1, 1, 0 },
537 {
"CPU FAN", 32, 2, 60, 1, 0 },
538 {
"SYS FAN", 34, 2, 60, 1, 0 },
539 {
"AUX1 FAN", 33, 2, 60, 1, 0 },
540 {
"AUX2 FAN", 35, 2, 60, 1, 0 },
541 {
"AUX3 FAN", 36, 2, 60, 1, 0 },
542 {
NULL, 0, 0, 0, 0, 0 } }
544 { 0x001A, {
"IP35 Pro",
"IP35 Pro XE",
NULL }, {
545 {
"CPU Core", 0, 0, 10, 1, 0 },
546 {
"DDR2", 1, 0, 20, 1, 0 },
547 {
"DDR2 VTT", 2, 0, 10, 1, 0 },
548 {
"CPU VTT 1.2V", 3, 0, 10, 1, 0 },
549 {
"MCH 1.25V", 4, 0, 10, 1, 0 },
550 {
"ICHIO 1.5V", 5, 0, 10, 1, 0 },
551 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
552 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
553 {
"ATX +12V (8-pin)", 8, 0, 60, 1, 0 },
554 {
"ATX +5V", 9, 0, 30, 1, 0 },
555 {
"+3.3V", 10, 0, 20, 1, 0 },
556 {
"5VSB", 11, 0, 30, 1, 0 },
557 {
"CPU", 24, 1, 1, 1, 0 },
558 {
"System", 25, 1, 1, 1, 0 },
559 {
"PWM", 26, 1, 1, 1, 0 },
560 {
"PWM Phase2", 27, 1, 1, 1, 0 },
561 {
"PWM Phase3", 28, 1, 1, 1, 0 },
562 {
"PWM Phase4", 29, 1, 1, 1, 0 },
563 {
"PWM Phase5", 30, 1, 1, 1, 0 },
564 {
"CPU Fan", 32, 2, 60, 1, 0 },
565 {
"SYS Fan", 34, 2, 60, 1, 0 },
566 {
"AUX1 Fan", 33, 2, 60, 1, 0 },
567 {
"AUX2 Fan", 35, 2, 60, 1, 0 },
568 {
"AUX3 Fan", 36, 2, 60, 1, 0 },
569 {
"AUX4 Fan", 37, 2, 60, 1, 0 },
570 {
NULL, 0, 0, 0, 0, 0 } }
572 { 0x001B, {
NULL } , {
573 {
"CPU Core", 0, 0, 10, 1, 0 },
574 {
"DDR3", 1, 0, 20, 1, 0 },
575 {
"DDR3 VTT", 2, 0, 10, 1, 0 },
576 {
"CPU VTT", 3, 0, 10, 1, 0 },
577 {
"MCH 1.25V", 4, 0, 10, 1, 0 },
578 {
"ICHIO 1.5V", 5, 0, 10, 1, 0 },
579 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
580 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
581 {
"ATX +12V (8-pin)", 8, 0, 60, 1, 0 },
582 {
"ATX +5V", 9, 0, 30, 1, 0 },
583 {
"+3.3V", 10, 0, 20, 1, 0 },
584 {
"5VSB", 11, 0, 30, 1, 0 },
585 {
"CPU", 24, 1, 1, 1, 0 },
586 {
"System", 25, 1, 1, 1, 0 },
587 {
"PWM Phase1", 26, 1, 1, 1, 0 },
588 {
"PWM Phase2", 27, 1, 1, 1, 0 },
589 {
"PWM Phase3", 28, 1, 1, 1, 0 },
590 {
"PWM Phase4", 29, 1, 1, 1, 0 },
591 {
"PWM Phase5", 30, 1, 1, 1, 0 },
592 {
"CPU Fan", 32, 2, 60, 1, 0 },
593 {
"SYS Fan", 34, 2, 60, 1, 0 },
594 {
"AUX1 Fan", 33, 2, 60, 1, 0 },
595 {
"AUX2 Fan", 35, 2, 60, 1, 0 },
596 {
"AUX3 Fan", 36, 2, 60, 1, 0 },
597 {
NULL, 0, 0, 0, 0, 0 } }
599 { 0x001C, {
"IX38 QuadGT",
NULL }, {
600 {
"CPU Core", 0, 0, 10, 1, 0 },
601 {
"DDR2", 1, 0, 20, 1, 0 },
602 {
"DDR2 VTT", 2, 0, 10, 1, 0 },
603 {
"CPU VTT", 3, 0, 10, 1, 0 },
604 {
"MCH 1.25V", 4, 0, 10, 1, 0 },
605 {
"ICHIO 1.5V", 5, 0, 10, 1, 0 },
606 {
"ICH 1.05V", 6, 0, 10, 1, 0 },
607 {
"ATX +12V (24-Pin)", 7, 0, 60, 1, 0 },
608 {
"ATX +12V (8-pin)", 8, 0, 60, 1, 0 },
609 {
"ATX +5V", 9, 0, 30, 1, 0 },
610 {
"+3.3V", 10, 0, 20, 1, 0 },
611 {
"5VSB", 11, 0, 30, 1, 0 },
612 {
"CPU", 24, 1, 1, 1, 0 },
613 {
"System", 25, 1, 1, 1, 0 },
614 {
"PWM Phase1", 26, 1, 1, 1, 0 },
615 {
"PWM Phase2", 27, 1, 1, 1, 0 },
616 {
"PWM Phase3", 28, 1, 1, 1, 0 },
617 {
"PWM Phase4", 29, 1, 1, 1, 0 },
618 {
"PWM Phase5", 30, 1, 1, 1, 0 },
619 {
"CPU Fan", 32, 2, 60, 1, 0 },
620 {
"SYS Fan", 34, 2, 60, 1, 0 },
621 {
"AUX1 Fan", 33, 2, 60, 1, 0 },
622 {
"AUX2 Fan", 35, 2, 60, 1, 0 },
623 {
"AUX3 Fan", 36, 2, 60, 1, 0 },
624 {
NULL, 0, 0, 0, 0, 0 } }
626 { 0x0000, {
NULL }, { {
NULL, 0, 0, 0, 0, 0 } } }
639 static const char *never_happen =
"This should never happen.";
640 static const char *report_this =
641 "Please report this to the abituguru3 maintainer (see MAINTAINERS)";
693 x = abituguru3_wait_while_busy(data);
696 "wait, status: 0x%02x\n", x);
701 x = abituguru3_wait_while_busy(data);
704 "status: 0x%02x\n", x);
709 x = abituguru3_wait_while_busy(data);
712 "status: 0x%02x\n", x);
717 x = abituguru3_wait_while_busy(data);
720 "status: 0x%02x\n", x);
724 x = abituguru3_wait_for_read(data);
727 "status: 0x%02x\n", x);
735 "hold 0xAC after synchronize, cmd: 0x%02x\n",
753 x = abituguru3_synchronize(data);
758 x = abituguru3_wait_while_busy(data);
761 "sending 0x1A, status: 0x%02x\n", (
unsigned int)bank,
762 (
unsigned int)offset, x);
767 x = abituguru3_wait_while_busy(data);
770 "sending the bank, status: 0x%02x\n",
771 (
unsigned int)bank, (
unsigned int)offset, x);
776 x = abituguru3_wait_while_busy(data);
779 "sending the offset, status: 0x%02x\n",
780 (
unsigned int)bank, (
unsigned int)offset, x);
785 x = abituguru3_wait_while_busy(data);
788 "sending the count, status: 0x%02x\n",
789 (
unsigned int)bank, (
unsigned int)offset, x);
793 for (i = 0; i <
count; i++) {
794 x = abituguru3_wait_for_read(data);
797 "0x%02x:0x%02x, status: 0x%02x\n", i,
798 (
unsigned int)bank, (
unsigned int)offset, x);
810 static int abituguru3_read_increment_offset(
struct abituguru3_data *data,
811 u8 bank,
u8 offset,
u8 count,
812 u8 *buf,
int offset_count)
816 for (i = 0; i < offset_count; i++) {
817 x = abituguru3_read(data, bank, offset + i, count,
822 return i * count +
x;
866 return sprintf(buf,
"%d\n", value);
887 if ((data->
alarms[port / 8] & (0x01 << (port % 8))) &&
971 const int no_sysfs_attr[3] = { 10, 8, 7 };
972 int sensor_index[3] = { 0, 1, 1 };
975 char *sysfs_filename;
986 platform_set_drvdata(pdev, data);
992 goto abituguru3_probe_error;
995 if (!abituguru3_update_device(&pdev->
dev))
996 goto abituguru3_probe_error;
999 id = ((
u16)buf[0] << 8) | (
u16)buf[1];
1000 for (i = 0; abituguru3_motherboards[
i].
id; i++)
1001 if (abituguru3_motherboards[i].
id ==
id)
1003 if (!abituguru3_motherboards[i].
id) {
1004 pr_err(
"error unknown motherboard ID: %04X. %s\n",
1005 (
unsigned int)
id, report_this);
1006 goto abituguru3_probe_error;
1010 pr_info(
"found Abit uGuru3, motherboard ID: %04X\n", (
unsigned int)
id);
1016 for (i = 0; data->
sensors[
i].name; i++) {
1019 pr_err(
"Fatal error motherboard has more sensors then ABIT_UGURU3_MAX_NO_SENSORS. %s %s\n",
1020 never_happen, report_this);
1022 goto abituguru3_probe_error;
1025 for (j = 0; j < no_sysfs_attr[
type]; j++) {
1026 used =
snprintf(sysfs_filename, sysfs_names_free,
1027 abituguru3_sysfs_templ[type][j].
dev_attr.attr.
1028 name, sensor_index[type]) + 1;
1030 abituguru3_sysfs_templ[
type][
j];
1031 data->
sysfs_attr[sysfs_attr_i].dev_attr.attr.name =
1034 sysfs_filename +=
used;
1035 sysfs_names_free -=
used;
1038 sensor_index[
type]++;
1041 if (sysfs_names_free < 0) {
1042 pr_err(
"Fatal error ran out of space for sysfs attr names. %s %s\n",
1043 never_happen, report_this);
1045 goto abituguru3_probe_error;
1049 for (i = 0; i < sysfs_attr_i; i++)
1052 goto abituguru3_probe_error;
1053 for (i = 0; i <
ARRAY_SIZE(abituguru3_sysfs_attr); i++)
1055 &abituguru3_sysfs_attr[i].
dev_attr))
1056 goto abituguru3_probe_error;
1061 goto abituguru3_probe_error;
1066 abituguru3_probe_error:
1067 for (i = 0; data->
sysfs_attr[
i].dev_attr.attr.name; i++)
1069 for (i = 0; i <
ARRAY_SIZE(abituguru3_sysfs_attr); i++)
1071 &abituguru3_sysfs_attr[i].
dev_attr);
1080 platform_set_drvdata(pdev,
NULL);
1082 for (i = 0; data->
sysfs_attr[
i].dev_attr.attr.name; i++)
1084 for (i = 0; i <
ARRAY_SIZE(abituguru3_sysfs_attr); i++)
1086 &abituguru3_sysfs_attr[i].
dev_attr);
1100 if (abituguru3_read_increment_offset(data,
1103 1, data->
alarms, 48/8) != (48/8))
1106 for (i = 0; i < 32; i++) {
1109 1, &data->
value[i]) != 1)
1111 if (abituguru3_read_increment_offset(data,
1119 for (i = 0; i < 16; i++) {
1122 1, &data->
value[32 + i]) != 1)
1124 if (abituguru3_read_increment_offset(data,
1142 #ifdef CONFIG_PM_SLEEP
1143 static int abituguru3_suspend(
struct device *dev)
1154 static int abituguru3_resume(
struct device *dev)
1162 #define ABIT_UGURU3_PM &abituguru3_pm
1164 #define ABIT_UGURU3_PM NULL
1173 .probe = abituguru3_probe,
1177 static int __init abituguru3_dmi_detect(
void)
1179 const char *board_vendor, *board_name;
1181 const char *
const *dmi_name;
1185 if (!board_vendor ||
strcmp(board_vendor,
"http://www.abit.com.tw/"))
1198 sublen =
strcspn(board_name,
"(");
1199 while (sublen > 0 && board_name[sublen - 1] ==
' ')
1202 for (i = 0; abituguru3_motherboards[
i].
id; i++) {
1203 dmi_name = abituguru3_motherboards[
i].
dmi_name;
1204 for ( ; *dmi_name; dmi_name++) {
1205 if (
strlen(*dmi_name) != sublen)
1221 static int __init abituguru3_detect(
void)
1230 if (((data_val == 0x00) || (data_val == 0x08)) &&
1231 ((cmd_val == 0xAC) || (cmd_val == 0x05) ||
1236 "0x%02X\n", (
unsigned int)data_val, (
unsigned int)cmd_val);
1239 pr_info(
"Assuming Abit uGuru3 is present because of \"force\" parameter\n");
1249 static int __init abituguru3_init(
void)
1255 err = abituguru3_dmi_detect();
1264 err = abituguru3_detect();
1268 pr_warn(
"this motherboard was not detected using DMI. "
1269 "Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n");
1278 if (!abituguru3_pdev) {
1279 pr_err(
"Device allocation failed\n");
1281 goto exit_driver_unregister;
1290 pr_err(
"Device resource addition failed (%d)\n", err);
1291 goto exit_device_put;
1296 pr_err(
"Device addition failed (%d)\n", err);
1297 goto exit_device_put;
1304 exit_driver_unregister:
1310 static void __exit abituguru3_exit(
void)