Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Documentation/hwmon/max34440.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Supported chips:

Datasheet: -

* ADI ADPM12886

Prefixes: 'adpm12886'

Addresses scanned: -

Datasheet: -

* Maxim MAX34440

Prefixes: 'max34440'
Expand Down Expand Up @@ -113,11 +121,12 @@ This driver supports multiple devices: hardware monitoring for Maxim MAX34440
PMBus 6-Channel Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply
Manager and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data
Logger; PMBus Voltage Monitor and Sequencers for MAX34451, MAX34452, MAX34460,
and MAX34461; PMBus DC/DC Power Module ADPM12160, ADPM12200, ADPM12250 and
ADPM12300. The MAX34451 and MAX34452 support monitoring voltage or current of 16
channels based on GIN pins. The MAX34460 supports 12 voltage channels, and the
MAX34461 supports 16 voltage channels. The ADPM12160, ADPM12200, ADPM12250 and
ADPM12300 also monitor both input and output of voltage and current.
and MAX34461; PMBus DC/DC Power Module ADPM12160, ADPM12200, ADPM12250,
ADPM12300, and ADPM12886. The MAX34451 and MAX34452 support monitoring voltage
or current of 16 channels based on GIN pins. The MAX34460 supports 12 voltage
channels, and the MAX34461 supports 16 voltage channels. The ADPM12160, ADPM12200,
ADPM12250, ADPM12300, and ADPM12886 also monitor both input and output of voltage
and current.

The driver is a client driver to the core PMBus driver. Please see
Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
Expand Down Expand Up @@ -175,7 +184,7 @@ in[1-6]_reset_history Write any value to reset history.
.. note::

- MAX34446 only supports in[1-4].
- ADPM12160, ADPM12200, ADPM12250, and ADPM12300 only supports in[1-2].
- ADPM12160, ADPM12200, ADPM12250, ADPM12300, and ADPM12886 only supports in[1-2].
Label is "vin1" and "vout1" respectively.

Curr
Expand All @@ -198,9 +207,10 @@ curr[1-6]_reset_history Write any value to reset history.

- in6 and curr6 attributes only exist for MAX34440.
- MAX34446 only supports curr[1-4].
- For ADPM12160, ADPM12200, ADPM12250, and ADPM12300, curr[1] is "iin1"
- For ADPM12160, ADPM12200, ADPM12250, ADPM12300, and ADPM12886, curr[1] is "iin1"
- For ADPM12160, and ADPM12200 curr[2-6] are "iout[1-5]".
- For ADPM12250, and ADPM12300 curr[2-4] are "iout[1-3]".
- For ADPM12886 curr[2-3] are "iout[1-2]".

Power
~~~~~
Expand Down Expand Up @@ -236,7 +246,7 @@ temp[1-8]_reset_history Write any value to reset history.
.. note::
- temp7 and temp8 attributes only exist for MAX34440.
- MAX34446 only supports temp[1-3].
- ADPM12160, ADPM12200, ADPM12250, and ADPM12300 only supports temp[1].
- ADPM12160, ADPM12200, ADPM12250, ADPM12300, and ADPM12886 only supports temp[1].


.. note::
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/pmbus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ config SENSORS_MAX34440
If you say yes here you get hardware monitoring support for Maxim
MAX34440, MAX34441, MAX34446, MAX34451, MAX34452, MAX34460, and
MAX34461. Other compatible devices are ADPM12160, ADPM12200,
ADPM12250, and ADPM12300.
ADPM12250, ADPM12300, and ADPM12886.

This driver can also be built as a module. If so, the module will
be called max34440.
Expand Down
51 changes: 45 additions & 6 deletions drivers/hwmon/pmbus/max34440.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum chips {
adpm12160,
adpm12200,
adpm12250,
adpm12886,
max34440,
max34441,
max34446,
Expand Down Expand Up @@ -114,7 +115,7 @@ static int max34440_read_word_data(struct i2c_client *client, int page,
*/
if (data->id == max34451 || data->id == max34452 ||
data->id == adpm12160 || data->id == adpm12200 ||
data->id == adpm12250)
data->id == adpm12250 || data->id == adpm12886)
return -ENXIO;
ret = -ENODATA;
break;
Expand All @@ -133,7 +134,8 @@ static int max34440_read_word_data(struct i2c_client *client, int page,
case PMBUS_VIRT_READ_IOUT_AVG:
if (data->id != max34446 && data->id != max34451 &&
data->id != max34452 && data->id != adpm12160 &&
data->id != adpm12200 && data->id != adpm12250)
data->id != adpm12200 && data->id != adpm12250 &&
data->id != adpm12886)
return -ENXIO;
ret = pmbus_read_word_data(client, page, phase,
MAX34446_MFR_IOUT_AVG);
Expand Down Expand Up @@ -223,7 +225,8 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
MAX34440_MFR_IOUT_PEAK, 0);
if (!ret && (data->id == max34446 || data->id == max34451 ||
data->id == max34452 || data->id == adpm12160 ||
data->id == adpm12200 || data->id == adpm12250))
data->id == adpm12200 || data->id == adpm12250 ||
data->id == adpm12886))
ret = pmbus_write_word_data(client, page,
MAX34446_MFR_IOUT_AVG, 0);

Expand Down Expand Up @@ -297,7 +300,7 @@ static int max34451_read_byte_data(struct i2c_client *client, int page, int reg)
*/
if (data->id == max34451 || data->id == max34452 ||
data->id == adpm12160 || data->id == adpm12200 ||
data->id == adpm12250)
data->id == adpm12250 || data->id == adpm12886)
return -ENXIO;
return -ENODATA;
default:
Expand All @@ -321,7 +324,7 @@ static int max34451_write_byte_data(struct i2c_client *client, int page,
*/
if (data->id == max34451 || data->id == max34452 ||
data->id == adpm12160 || data->id == adpm12200 ||
data->id == adpm12250)
data->id == adpm12250 || data->id == adpm12886)
return -ENXIO;
return -ENODATA;
default:
Expand Down Expand Up @@ -539,6 +542,41 @@ static struct pmbus_driver_info max34440_info[] = {
.write_byte_data = max34451_write_byte_data,
.write_word_data = max34440_write_word_data,
},
[adpm12886] = {
.pages = 19,
.format[PSC_VOLTAGE_IN] = direct,
.format[PSC_VOLTAGE_OUT] = direct,
.format[PSC_CURRENT_IN] = direct,
.format[PSC_CURRENT_OUT] = direct,
.format[PSC_TEMPERATURE] = direct,
.m[PSC_VOLTAGE_IN] = 125,
.b[PSC_VOLTAGE_IN] = 0,
.R[PSC_VOLTAGE_IN] = 0,
.m[PSC_VOLTAGE_OUT] = 125,
.b[PSC_VOLTAGE_OUT] = 0,
.R[PSC_VOLTAGE_OUT] = 0,
.m[PSC_CURRENT_IN] = 250,
.b[PSC_CURRENT_IN] = 0,
.R[PSC_CURRENT_IN] = -1,
.m[PSC_CURRENT_OUT] = 250,
.b[PSC_CURRENT_OUT] = 0,
.R[PSC_CURRENT_OUT] = -1,
.m[PSC_TEMPERATURE] = 1,
.b[PSC_TEMPERATURE] = 0,
.R[PSC_TEMPERATURE] = 2,
/* absent func below [18] are not for monitoring */
.func[2] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT,
.func[4] = PMBUS_HAVE_STATUS_IOUT,
.func[5] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT,
.func[9] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT,
.func[10] = PMBUS_HAVE_IIN | PMBUS_HAVE_STATUS_INPUT,
.func[14] = PMBUS_HAVE_IOUT,
.func[18] = PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
.read_byte_data = max34451_read_byte_data,
.read_word_data = max34440_read_word_data,
.write_byte_data = max34451_write_byte_data,
.write_word_data = max34440_write_word_data,
},
[max34440] = {
.pages = 14,
.format[PSC_VOLTAGE_IN] = direct,
Expand Down Expand Up @@ -804,7 +842,7 @@ static int max34440_probe(struct i2c_client *client)
if (rv)
return rv;
} else if (data->id == adpm12160 || data->id == adpm12200 ||
data->id == adpm12250) {
data->id == adpm12250 || data->id == adpm12886) {
data->iout_oc_fault_limit = PMBUS_IOUT_OC_FAULT_LIMIT;
data->iout_oc_warn_limit = PMBUS_IOUT_OC_WARN_LIMIT;
}
Expand All @@ -818,6 +856,7 @@ static const struct i2c_device_id max34440_id[] = {
{ .name = "adpm12200", .driver_data = adpm12200 },
{ .name = "adpm12250", .driver_data = adpm12250 },
{ .name = "adpm12300", .driver_data = adpm12250 },
{ .name = "adpm12886", .driver_data = adpm12886 },
{ .name = "max34440", .driver_data = max34440 },
{ .name = "max34441", .driver_data = max34441 },
{ .name = "max34446", .driver_data = max34446 },
Expand Down
Loading