Skip to content

Commit 21ef46a

Browse files
committed
hwmon: (pmbus/max34440): add support adpm12100, adpm12130, adpm12200
ADPM12100, ADPM12130, and ADPM12200 are all quarter brick DC/DC Power Module. They are high power non-isolated converter capable of delivering regulated 12V with continuous power level of 1000W, 1300W, and 2000W respectively. Uses PMBus. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
1 parent 278191f commit 21ef46a

File tree

3 files changed

+152
-10
lines changed

3 files changed

+152
-10
lines changed

Documentation/hwmon/max34440.rst

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ Kernel driver max34440
33

44
Supported chips:
55

6+
* ADI ADPM12100
7+
8+
Prefixes: 'adpm12100'
9+
10+
Addresses scanned: -
11+
12+
Datasheet: -
13+
14+
* ADI ADPM12130
15+
16+
Prefixes: 'adpm12130'
17+
18+
Addresses scanned: -
19+
20+
Datasheet: -
21+
622
* ADI ADPM12160
723

824
Prefixes: 'adpm12160'
@@ -11,6 +27,14 @@ Supported chips:
1127

1228
Datasheet: -
1329

30+
* ADI ADPM12200
31+
32+
Prefixes: 'adpm12200'
33+
34+
Addresses scanned: -
35+
36+
Datasheet: -
37+
1438
* Maxim MAX34440
1539

1640
Prefixes: 'max34440'
@@ -79,9 +103,10 @@ This driver supports multiple devices: hardware monitoring for Maxim MAX34440
79103
PMBus 6-Channel Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply
80104
Manager and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data
81105
Logger; PMBus Voltage Monitor and Sequencers for MAX34451, MAX34460, and
82-
MAX34461; PMBus DC/DC Power Module ADPM12160. The MAX34451 supports monitoring
83-
voltage or current of 12 channels based on GIN pins. The MAX34460 supports 12
84-
voltage channels, and the MAX34461 supports 16 voltage channels. The ADPM1260
106+
MAX34461; PMBus DC/DC Power Module ADPM12100, ADPM12130, ADPM12160 and
107+
ADPM12200. The MAX34451 supports monitoring voltage or current of 12 channels
108+
based on GIN pins. The MAX34460 supports 12 voltage channels, and the MAX34461
109+
supports 16 voltage channels. The ADPM12100, ADPM12130, ADPM12160, and ADPM12200
85110
also monitors both input and output of voltage and current.
86111

87112
The driver is a client driver to the core PMBus driver. Please see
@@ -140,7 +165,8 @@ in[1-6]_reset_history Write any value to reset history.
140165
.. note::
141166

142167
- MAX34446 only supports in[1-4].
143-
- ADPM12160 only supports in[1-2]. Label is "vin1" and "vout1" respectively.
168+
- ADPM12100, ADPM12130, ADPM12160, and ADPM12200 only supports in[1-2].
169+
Label is "vin1" and "vout1" respectively.
144170

145171
Curr
146172
~~~~
@@ -162,7 +188,8 @@ curr[1-6]_reset_history Write any value to reset history.
162188

163189
- in6 and curr6 attributes only exist for MAX34440.
164190
- MAX34446 only supports curr[1-4].
165-
- For ADPM12160, curr[1] is "iin1" and curr[2-6] are "iout[1-5].
191+
- For ADPM12100, ADPM12130, ADPM12160, and ADPM12200, curr[1] is "iin1" and
192+
curr[2-6] are "iout[1-5].
166193

167194
Power
168195
~~~~~
@@ -198,7 +225,7 @@ temp[1-8]_reset_history Write any value to reset history.
198225
.. note::
199226
- temp7 and temp8 attributes only exist for MAX34440.
200227
- MAX34446 only supports temp[1-3].
201-
- ADPM12160 only supports temp[1].
228+
- ADPM12100, ADPM12130, ADPM12160, and ADPM12200 only supports temp[1].
202229

203230

204231
.. note::

drivers/hwmon/pmbus/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ config SENSORS_MAX34440
324324
help
325325
If you say yes here you get hardware monitoring support for Maxim
326326
MAX34440, MAX34441, MAX34446, MAX34451, MAX34460, and MAX34461.
327-
Other compatible includes ADPM12160.
327+
Other compatible are ADPM12100, ADPM12130, ADPM12160, and ADPM12200.
328328

329329
This driver can also be built as a module. If so, the module will
330330
be called max34440.

drivers/hwmon/pmbus/max34440.c

Lines changed: 118 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
#include "pmbus.h"
1616

1717
enum chips {
18+
adpm12100,
19+
adpm12130,
1820
adpm12160,
21+
adpm12200,
1922
max34440,
2023
max34441,
2124
max34446,
@@ -89,7 +92,8 @@ static int max34440_read_word_data(struct i2c_client *client, int page,
8992
break;
9093
case PMBUS_VIRT_READ_IOUT_AVG:
9194
if (data->id != max34446 && data->id != max34451 &&
92-
data->id != adpm12160)
95+
data->id != adpm12100 && data->id != adpm12130 &&
96+
data->id != adpm12160 && data->id != adpm12200)
9397
return -ENXIO;
9498
ret = pmbus_read_word_data(client, page, phase,
9599
MAX34446_MFR_IOUT_AVG);
@@ -174,7 +178,8 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
174178
ret = pmbus_write_word_data(client, page,
175179
MAX34440_MFR_IOUT_PEAK, 0);
176180
if (!ret && (data->id == max34446 || data->id == max34451 ||
177-
data->id == adpm12160))
181+
data->id == adpm12100 || data->id == adpm12130 ||
182+
data->id == adpm12160 || data->id == adpm12200))
178183
ret = pmbus_write_word_data(client, page,
179184
MAX34446_MFR_IOUT_AVG, 0);
180185

@@ -319,6 +324,76 @@ static int max34451_set_supported_funcs(struct i2c_client *client,
319324
}
320325

321326
static struct pmbus_driver_info max34440_info[] = {
327+
[adpm12100] = {
328+
.pages = 19,
329+
.format[PSC_VOLTAGE_IN] = direct,
330+
.format[PSC_VOLTAGE_OUT] = direct,
331+
.format[PSC_CURRENT_IN] = direct,
332+
.format[PSC_CURRENT_OUT] = direct,
333+
.format[PSC_TEMPERATURE] = direct,
334+
.m[PSC_VOLTAGE_IN] = 8,
335+
.b[PSC_VOLTAGE_IN] = 0,
336+
.R[PSC_VOLTAGE_IN] = 3,
337+
.m[PSC_VOLTAGE_OUT] = 8,
338+
.b[PSC_VOLTAGE_OUT] = 0,
339+
.R[PSC_VOLTAGE_OUT] = 3,
340+
.m[PSC_CURRENT_IN] = 4,
341+
.b[PSC_CURRENT_IN] = 0,
342+
.R[PSC_CURRENT_IN] = 2,
343+
.m[PSC_CURRENT_OUT] = 4,
344+
.b[PSC_CURRENT_OUT] = 0,
345+
.R[PSC_CURRENT_OUT] = 2,
346+
.m[PSC_TEMPERATURE] = 1,
347+
.b[PSC_TEMPERATURE] = 0,
348+
.R[PSC_TEMPERATURE] = 2,
349+
/* absent func below [18] are not for monitoring */
350+
.func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT,
351+
.func[4] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
352+
.func[5] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
353+
.func[6] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
354+
.func[8] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
355+
.func[9] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT,
356+
.func[10] = PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT,
357+
.func[14] = PMBUS_HAVE_IOUT,
358+
.func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
359+
.read_word_data = max34440_read_word_data,
360+
.write_word_data = max34440_write_word_data,
361+
},
362+
[adpm12130] = {
363+
.pages = 19,
364+
.format[PSC_VOLTAGE_IN] = direct,
365+
.format[PSC_VOLTAGE_OUT] = direct,
366+
.format[PSC_CURRENT_IN] = direct,
367+
.format[PSC_CURRENT_OUT] = direct,
368+
.format[PSC_TEMPERATURE] = direct,
369+
.m[PSC_VOLTAGE_IN] = 8,
370+
.b[PSC_VOLTAGE_IN] = 0,
371+
.R[PSC_VOLTAGE_IN] = 3,
372+
.m[PSC_VOLTAGE_OUT] = 8,
373+
.b[PSC_VOLTAGE_OUT] = 0,
374+
.R[PSC_VOLTAGE_OUT] = 3,
375+
.m[PSC_CURRENT_IN] = 4,
376+
.b[PSC_CURRENT_IN] = 0,
377+
.R[PSC_CURRENT_IN] = 2,
378+
.m[PSC_CURRENT_OUT] = 4,
379+
.b[PSC_CURRENT_OUT] = 0,
380+
.R[PSC_CURRENT_OUT] = 2,
381+
.m[PSC_TEMPERATURE] = 1,
382+
.b[PSC_TEMPERATURE] = 0,
383+
.R[PSC_TEMPERATURE] = 2,
384+
/* absent func below [18] are not for monitoring */
385+
.func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT,
386+
.func[4] = PMBUS_HAVE_IOUT,
387+
.func[5] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
388+
.func[6] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
389+
.func[8] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
390+
.func[9] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT,
391+
.func[10] = PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT,
392+
.func[14] = PMBUS_HAVE_IOUT,
393+
.func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
394+
.read_word_data = max34440_read_word_data,
395+
.write_word_data = max34440_write_word_data,
396+
},
322397
[adpm12160] = {
323398
.pages = 19,
324399
.format[PSC_VOLTAGE_IN] = direct,
@@ -354,6 +429,42 @@ static struct pmbus_driver_info max34440_info[] = {
354429
.read_word_data = max34440_read_word_data,
355430
.write_word_data = max34440_write_word_data,
356431
},
432+
[adpm12200] = {
433+
.pages = 19,
434+
.format[PSC_VOLTAGE_IN] = direct,
435+
.format[PSC_VOLTAGE_OUT] = direct,
436+
.format[PSC_CURRENT_IN] = direct,
437+
.format[PSC_CURRENT_OUT] = direct,
438+
.format[PSC_TEMPERATURE] = direct,
439+
.m[PSC_VOLTAGE_IN] = 125,
440+
.b[PSC_VOLTAGE_IN] = 0,
441+
.R[PSC_VOLTAGE_IN] = 0,
442+
.m[PSC_VOLTAGE_OUT] = 125,
443+
.b[PSC_VOLTAGE_OUT] = 0,
444+
.R[PSC_VOLTAGE_OUT] = 0,
445+
.m[PSC_CURRENT_IN] = 250,
446+
.b[PSC_CURRENT_IN] = 0,
447+
.R[PSC_CURRENT_IN] = -1,
448+
.m[PSC_CURRENT_OUT] = 250,
449+
.b[PSC_CURRENT_OUT] = 0,
450+
.R[PSC_CURRENT_OUT] = -1,
451+
.m[PSC_TEMPERATURE] = 1,
452+
.b[PSC_TEMPERATURE] = 0,
453+
.R[PSC_TEMPERATURE] = 2,
454+
/* absent func below [18] are not for monitoring */
455+
.func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT,
456+
.func[4] = PMBUS_HAVE_STATUS_IOUT,
457+
.func[5] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
458+
.func[6] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
459+
.func[7] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
460+
.func[8] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
461+
.func[9] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT,
462+
.func[10] = PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT,
463+
.func[14] = PMBUS_HAVE_IOUT,
464+
.func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
465+
.read_word_data = max34440_read_word_data,
466+
.write_word_data = max34440_write_word_data,
467+
},
357468
[max34440] = {
358469
.pages = 14,
359470
.format[PSC_VOLTAGE_IN] = direct,
@@ -584,7 +695,8 @@ static int max34440_probe(struct i2c_client *client)
584695
rv = max34451_set_supported_funcs(client, data);
585696
if (rv)
586697
return rv;
587-
} else if (data->id == adpm12160) {
698+
} else if (data->id == adpm12100 || data->id == adpm12130 ||
699+
data->id == adpm12100 || data->id == adpm12200) {
588700
data->iout_oc_fault_limit = PMBUS_IOUT_OC_FAULT_LIMIT;
589701
data->iout_oc_warn_limit = PMBUS_IOUT_OC_WARN_LIMIT;
590702
}
@@ -593,7 +705,10 @@ static int max34440_probe(struct i2c_client *client)
593705
}
594706

595707
static const struct i2c_device_id max34440_id[] = {
708+
{"adpm12100", adpm12100},
709+
{"adpm12130", adpm12130},
596710
{"adpm12160", adpm12160},
711+
{"adpm12200", adpm12200},
597712
{"max34440", max34440},
598713
{"max34441", max34441},
599714
{"max34446", max34446},

0 commit comments

Comments
 (0)