diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-04-27 18:13:08 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-02-06 12:58:06 -0500 |
commit | 50115ac9b6f35ce6bbb61e5ae21fc3bbd01d490c (patch) | |
tree | ebc8caad7885c9a7270f90935a5c0a7b8be36112 /drivers/hwmon | |
parent | 16c6d01f3b21bd35526cccbe37010a906072a590 (diff) |
hwmon: (pmbus/max34440) Add support for MAX34460 and MAX34461
MAX34460 is a PMBus 12-Channel Voltage Monitor & Sequencer.
MAX34461 is a PMBus 16-Channel Voltage Monitor & Sequencer.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus/Kconfig | 2 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/max34440.c | 75 |
2 files changed, 74 insertions, 3 deletions
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 60745a535821..4f9eb0af5229 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig | |||
@@ -72,7 +72,7 @@ config SENSORS_MAX34440 | |||
72 | default n | 72 | default n |
73 | help | 73 | help |
74 | If you say yes here you get hardware monitoring support for Maxim | 74 | If you say yes here you get hardware monitoring support for Maxim |
75 | MAX34440, MAX34441, and MAX34446. | 75 | MAX34440, MAX34441, MAX34446, MAX34460, and MAX34461. |
76 | 76 | ||
77 | This driver can also be built as a module. If so, the module will | 77 | This driver can also be built as a module. If so, the module will |
78 | be called max34440. | 78 | be called max34440. |
diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c index 2ada7b021fbe..7e930c3ce1ab 100644 --- a/drivers/hwmon/pmbus/max34440.c +++ b/drivers/hwmon/pmbus/max34440.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * Hardware monitoring driver for Maxim MAX34440/MAX34441 | 2 | * Hardware monitoring driver for Maxim MAX34440/MAX34441 |
3 | * | 3 | * |
4 | * Copyright (c) 2011 Ericsson AB. | 4 | * Copyright (c) 2011 Ericsson AB. |
5 | * Copyright (c) 2012 Guenter Roeck | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * 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 | * it under the terms of the GNU General Public License as published by |
@@ -25,7 +26,7 @@ | |||
25 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
26 | #include "pmbus.h" | 27 | #include "pmbus.h" |
27 | 28 | ||
28 | enum chips { max34440, max34441, max34446 }; | 29 | enum chips { max34440, max34441, max34446, max34460, max34461 }; |
29 | 30 | ||
30 | #define MAX34440_MFR_VOUT_PEAK 0xd4 | 31 | #define MAX34440_MFR_VOUT_PEAK 0xd4 |
31 | #define MAX34440_MFR_IOUT_PEAK 0xd5 | 32 | #define MAX34440_MFR_IOUT_PEAK 0xd5 |
@@ -87,7 +88,8 @@ static int max34440_read_word_data(struct i2c_client *client, int page, int reg) | |||
87 | MAX34446_MFR_POUT_PEAK); | 88 | MAX34446_MFR_POUT_PEAK); |
88 | break; | 89 | break; |
89 | case PMBUS_VIRT_READ_TEMP_AVG: | 90 | case PMBUS_VIRT_READ_TEMP_AVG: |
90 | if (data->id != max34446) | 91 | if (data->id != max34446 && data->id != max34460 && |
92 | data->id != max34461) | ||
91 | return -ENXIO; | 93 | return -ENXIO; |
92 | ret = pmbus_read_word_data(client, page, | 94 | ret = pmbus_read_word_data(client, page, |
93 | MAX34446_MFR_TEMPERATURE_AVG); | 95 | MAX34446_MFR_TEMPERATURE_AVG); |
@@ -322,6 +324,73 @@ static struct pmbus_driver_info max34440_info[] = { | |||
322 | .read_word_data = max34440_read_word_data, | 324 | .read_word_data = max34440_read_word_data, |
323 | .write_word_data = max34440_write_word_data, | 325 | .write_word_data = max34440_write_word_data, |
324 | }, | 326 | }, |
327 | [max34460] = { | ||
328 | .pages = 18, | ||
329 | .format[PSC_VOLTAGE_OUT] = direct, | ||
330 | .format[PSC_TEMPERATURE] = direct, | ||
331 | .m[PSC_VOLTAGE_OUT] = 1, | ||
332 | .b[PSC_VOLTAGE_OUT] = 0, | ||
333 | .R[PSC_VOLTAGE_OUT] = 3, | ||
334 | .m[PSC_TEMPERATURE] = 1, | ||
335 | .b[PSC_TEMPERATURE] = 0, | ||
336 | .R[PSC_TEMPERATURE] = 2, | ||
337 | .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
338 | .func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
339 | .func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
340 | .func[3] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
341 | .func[4] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
342 | .func[5] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
343 | .func[6] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
344 | .func[7] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
345 | .func[8] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
346 | .func[9] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
347 | .func[10] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
348 | .func[11] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
349 | .func[13] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
350 | .func[14] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
351 | .func[15] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
352 | .func[16] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
353 | .func[17] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
354 | .read_byte_data = max34440_read_byte_data, | ||
355 | .read_word_data = max34440_read_word_data, | ||
356 | .write_word_data = max34440_write_word_data, | ||
357 | }, | ||
358 | [max34461] = { | ||
359 | .pages = 23, | ||
360 | .format[PSC_VOLTAGE_OUT] = direct, | ||
361 | .format[PSC_TEMPERATURE] = direct, | ||
362 | .m[PSC_VOLTAGE_OUT] = 1, | ||
363 | .b[PSC_VOLTAGE_OUT] = 0, | ||
364 | .R[PSC_VOLTAGE_OUT] = 3, | ||
365 | .m[PSC_TEMPERATURE] = 1, | ||
366 | .b[PSC_TEMPERATURE] = 0, | ||
367 | .R[PSC_TEMPERATURE] = 2, | ||
368 | .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
369 | .func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
370 | .func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
371 | .func[3] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
372 | .func[4] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
373 | .func[5] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
374 | .func[6] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
375 | .func[7] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
376 | .func[8] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
377 | .func[9] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
378 | .func[10] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
379 | .func[11] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
380 | .func[12] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
381 | .func[13] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
382 | .func[14] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
383 | .func[15] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT, | ||
384 | /* page 16 is reserved */ | ||
385 | .func[17] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
386 | .func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
387 | .func[19] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
388 | .func[20] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
389 | .func[21] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, | ||
390 | .read_byte_data = max34440_read_byte_data, | ||
391 | .read_word_data = max34440_read_word_data, | ||
392 | .write_word_data = max34440_write_word_data, | ||
393 | }, | ||
325 | }; | 394 | }; |
326 | 395 | ||
327 | static int max34440_probe(struct i2c_client *client, | 396 | static int max34440_probe(struct i2c_client *client, |
@@ -343,6 +412,8 @@ static const struct i2c_device_id max34440_id[] = { | |||
343 | {"max34440", max34440}, | 412 | {"max34440", max34440}, |
344 | {"max34441", max34441}, | 413 | {"max34441", max34441}, |
345 | {"max34446", max34446}, | 414 | {"max34446", max34446}, |
415 | {"max34460", max34460}, | ||
416 | {"max34461", max34461}, | ||
346 | {} | 417 | {} |
347 | }; | 418 | }; |
348 | MODULE_DEVICE_TABLE(i2c, max34440_id); | 419 | MODULE_DEVICE_TABLE(i2c, max34440_id); |