aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-04-27 18:13:08 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-02-06 12:58:06 -0500
commit50115ac9b6f35ce6bbb61e5ae21fc3bbd01d490c (patch)
treeebc8caad7885c9a7270f90935a5c0a7b8be36112
parent16c6d01f3b21bd35526cccbe37010a906072a590 (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>
-rw-r--r--Documentation/hwmon/max3444016
-rw-r--r--drivers/hwmon/pmbus/Kconfig2
-rw-r--r--drivers/hwmon/pmbus/max34440.c75
3 files changed, 90 insertions, 3 deletions
diff --git a/Documentation/hwmon/max34440 b/Documentation/hwmon/max34440
index 04482226db20..47651ff341ae 100644
--- a/Documentation/hwmon/max34440
+++ b/Documentation/hwmon/max34440
@@ -16,6 +16,16 @@ Supported chips:
16 Prefixes: 'max34446' 16 Prefixes: 'max34446'
17 Addresses scanned: - 17 Addresses scanned: -
18 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34446.pdf 18 Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34446.pdf
19 * Maxim MAX34460
20 PMBus 12-Channel Voltage Monitor & Sequencer
21 Prefix: 'max34460'
22 Addresses scanned: -
23 Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34460.pdf
24 * Maxim MAX34461
25 PMBus 16-Channel Voltage Monitor & Sequencer
26 Prefix: 'max34461'
27 Addresses scanned: -
28 Datasheet: http://datasheets.maximintegrated.com/en/ds/MAX34461.pdf
19 29
20Author: Guenter Roeck <guenter.roeck@ericsson.com> 30Author: Guenter Roeck <guenter.roeck@ericsson.com>
21 31
@@ -26,6 +36,9 @@ Description
26This driver supports hardware montoring for Maxim MAX34440 PMBus 6-Channel 36This driver supports hardware montoring for Maxim MAX34440 PMBus 6-Channel
27Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply Manager 37Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply Manager
28and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data Logger. 38and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data Logger.
39It also supports the MAX34460 and MAX34461 PMBus Voltage Monitor & Sequencers.
40The MAX34460 supports 12 voltage channels, and the MAX34461 supports 16 voltage
41channels.
29 42
30The driver is a client driver to the core PMBus driver. Please see 43The driver is a client driver to the core PMBus driver. Please see
31Documentation/hwmon/pmbus for details on PMBus client drivers. 44Documentation/hwmon/pmbus for details on PMBus client drivers.
@@ -109,3 +122,6 @@ temp[1-8]_reset_history Write any value to reset history.
109 122
110 temp7 and temp8 attributes only exist for MAX34440. 123 temp7 and temp8 attributes only exist for MAX34440.
111 MAX34446 only supports temp[1-3]. 124 MAX34446 only supports temp[1-3].
125
126MAX34460 supports attribute groups in[1-12] and temp[1-5].
127MAX34461 supports attribute groups in[1-16] and temp[1-5].
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
28enum chips { max34440, max34441, max34446 }; 29enum 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
327static int max34440_probe(struct i2c_client *client, 396static 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};
348MODULE_DEVICE_TABLE(i2c, max34440_id); 419MODULE_DEVICE_TABLE(i2c, max34440_id);