Skip to content

Commit d4d8279

Browse files
committed
hwmon: (pmbus/max34440): add support adpm12200
ADPM12200 is a quarter brick DC/DC Power Module. It is a high power non-isolated converter capable of delivering regulated 12V with continuous power level of 2000W. Uses PMBus. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
1 parent 9f1e674 commit d4d8279

File tree

3 files changed

+60
-11
lines changed

3 files changed

+60
-11
lines changed

Documentation/hwmon/max34440.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ Supported chips:
1111

1212
Datasheet: -
1313

14+
* ADI ADPM12200
15+
16+
Prefixes: 'adpm12200'
17+
18+
Addresses scanned: -
19+
20+
Datasheet: -
21+
1422
* Maxim MAX34440
1523

1624
Prefixes: 'max34440'
@@ -79,10 +87,11 @@ This driver supports multiple devices: hardware monitoring for Maxim MAX34440
7987
PMBus 6-Channel Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply
8088
Manager and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data
8189
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
85-
also monitors both input and output of voltage and current.
90+
MAX34461; PMBus DC/DC Power Module ADPM12160, and ADPM12200. The MAX34451
91+
supports monitoring voltage or current of 12 channels based on GIN pins. The
92+
MAX34460 supports 12 voltage channels, and the MAX34461 supports 16 voltage
93+
channels. The ADPM12160, and ADPM12200 also monitors both input and output
94+
of voltage and current.
8695

8796
The driver is a client driver to the core PMBus driver. Please see
8897
Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
@@ -140,7 +149,8 @@ in[1-6]_reset_history Write any value to reset history.
140149
.. note::
141150

142151
- MAX34446 only supports in[1-4].
143-
- ADPM12160 only supports in[1-2]. Label is "vin1" and "vout1" respectively.
152+
- ADPM12160, and ADPM12200 only supports in[1-2]. Label is "vin1"
153+
and "vout1" respectively.
144154

145155
Curr
146156
~~~~
@@ -162,7 +172,8 @@ curr[1-6]_reset_history Write any value to reset history.
162172

163173
- in6 and curr6 attributes only exist for MAX34440.
164174
- MAX34446 only supports curr[1-4].
165-
- For ADPM12160, curr[1] is "iin1" and curr[2-6] are "iout[1-5].
175+
- For ADPM12160, and ADPM12200, curr[1] is "iin1" and curr[2-6]
176+
are "iout[1-5].
166177

167178
Power
168179
~~~~~
@@ -198,7 +209,7 @@ temp[1-8]_reset_history Write any value to reset history.
198209
.. note::
199210
- temp7 and temp8 attributes only exist for MAX34440.
200211
- MAX34446 only supports temp[1-3].
201-
- ADPM12160 only supports temp[1].
212+
- ADPM12160, and ADPM12200 only supports temp[1].
202213

203214

204215
.. 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 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: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
enum chips {
1818
adpm12160,
19+
adpm12200,
1920
max34440,
2021
max34441,
2122
max34446,
@@ -89,7 +90,7 @@ static int max34440_read_word_data(struct i2c_client *client, int page,
8990
break;
9091
case PMBUS_VIRT_READ_IOUT_AVG:
9192
if (data->id != max34446 && data->id != max34451 &&
92-
data->id != adpm12160)
93+
data->id != adpm12160 && data->id != adpm12200)
9394
return -ENXIO;
9495
ret = pmbus_read_word_data(client, page, phase,
9596
MAX34446_MFR_IOUT_AVG);
@@ -174,7 +175,7 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
174175
ret = pmbus_write_word_data(client, page,
175176
MAX34440_MFR_IOUT_PEAK, 0);
176177
if (!ret && (data->id == max34446 || data->id == max34451 ||
177-
data->id == adpm12160))
178+
data->id == adpm12160 || data->id == adpm12200))
178179
ret = pmbus_write_word_data(client, page,
179180
MAX34446_MFR_IOUT_AVG, 0);
180181

@@ -354,6 +355,42 @@ static struct pmbus_driver_info max34440_info[] = {
354355
.read_word_data = max34440_read_word_data,
355356
.write_word_data = max34440_write_word_data,
356357
},
358+
[adpm12200] = {
359+
.pages = 19,
360+
.format[PSC_VOLTAGE_IN] = direct,
361+
.format[PSC_VOLTAGE_OUT] = direct,
362+
.format[PSC_CURRENT_IN] = direct,
363+
.format[PSC_CURRENT_OUT] = direct,
364+
.format[PSC_TEMPERATURE] = direct,
365+
.m[PSC_VOLTAGE_IN] = 125,
366+
.b[PSC_VOLTAGE_IN] = 0,
367+
.R[PSC_VOLTAGE_IN] = 0,
368+
.m[PSC_VOLTAGE_OUT] = 125,
369+
.b[PSC_VOLTAGE_OUT] = 0,
370+
.R[PSC_VOLTAGE_OUT] = 0,
371+
.m[PSC_CURRENT_IN] = 250,
372+
.b[PSC_CURRENT_IN] = 0,
373+
.R[PSC_CURRENT_IN] = -1,
374+
.m[PSC_CURRENT_OUT] = 250,
375+
.b[PSC_CURRENT_OUT] = 0,
376+
.R[PSC_CURRENT_OUT] = -1,
377+
.m[PSC_TEMPERATURE] = 1,
378+
.b[PSC_TEMPERATURE] = 0,
379+
.R[PSC_TEMPERATURE] = 2,
380+
/* absent func below [18] are not for monitoring */
381+
.func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT,
382+
.func[4] = PMBUS_HAVE_STATUS_IOUT,
383+
.func[5] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
384+
.func[6] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
385+
.func[7] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
386+
.func[8] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
387+
.func[9] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT,
388+
.func[10] = PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT,
389+
.func[14] = PMBUS_HAVE_IOUT,
390+
.func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
391+
.read_word_data = max34440_read_word_data,
392+
.write_word_data = max34440_write_word_data,
393+
},
357394
[max34440] = {
358395
.pages = 14,
359396
.format[PSC_VOLTAGE_IN] = direct,
@@ -584,7 +621,7 @@ static int max34440_probe(struct i2c_client *client)
584621
rv = max34451_set_supported_funcs(client, data);
585622
if (rv)
586623
return rv;
587-
} else if (data->id == adpm12160) {
624+
} else if (data->id == adpm12160 || data->id == adpm12200) {
588625
data->iout_oc_fault_limit = PMBUS_IOUT_OC_FAULT_LIMIT;
589626
data->iout_oc_warn_limit = PMBUS_IOUT_OC_WARN_LIMIT;
590627
}
@@ -594,6 +631,7 @@ static int max34440_probe(struct i2c_client *client)
594631

595632
static const struct i2c_device_id max34440_id[] = {
596633
{"adpm12160", adpm12160},
634+
{"adpm12200", adpm12200},
597635
{"max34440", max34440},
598636
{"max34441", max34441},
599637
{"max34446", max34446},

0 commit comments

Comments
 (0)