Re: [PATCH v2 1/2] hwmon: (pmbus) Add support for MPS multi-phase mp2869a/mp29612a controllers
From: Guenter Roeck <linux@roeck-us.net>
Date: 2025-07-16 20:36:51
Also in:
linux-doc, linux-hwmon, lkml
On 6/30/25 04:20, tzuhao.wtmh@gmail.com wrote:
quoted hunk ↗ jump to hunk
From: Henry Wu <redacted> Add support for the mp2869a and mp29612a controllers from Monolithic Power Systems, Inc. (MPS). These are dual-loop, digital, multi-phase modulation controllers. Signed-off-by: Henry Wu <redacted> --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/mp2869a.rst | 86 +++++++++ drivers/hwmon/pmbus/Kconfig | 10 ++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/mp2869a.c | 299 ++++++++++++++++++++++++++++++++ 5 files changed, 397 insertions(+) create mode 100644 Documentation/hwmon/mp2869a.rst create mode 100644 drivers/hwmon/pmbus/mp2869a.cdiff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index b45bfb4ebf30..10bf4bd77f7b 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst@@ -172,6 +172,7 @@ Hardware Monitoring Kernel Drivers menf21bmc mlxreg-fan mp2856 + mp2869a mp2888 mp2891 mp2975diff --git a/Documentation/hwmon/mp2869a.rst b/Documentation/hwmon/mp2869a.rst new file mode 100644 index 000000000000..a98ccb3d630d --- /dev/null +++ b/Documentation/hwmon/mp2869a.rst@@ -0,0 +1,86 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver mp2896a +===================== + +Supported chips: + + * MPS MP2896A + + Prefix: 'mp2896a' + + * MPS MP29612A + + Prefix: 'mp29612a' + +Author: + + Henry Wu <Henry_WU@quantatw.com> + +Description +----------- + +This driver implements support for Monolithic Power Systems, Inc. (MPS) +MP2896A, a digital, multi-phase voltage regulator controller with PMBus interface. + +This device: + +- Supports up to two power rails. +- Supports multiple PMBus pages for telemetry and configuration. +- Supports VOUT readout in **VID format only** (no support for direct format). +- Supports AMD SVI3 VID protocol with 5-mV/LSB resolution (if applicable). +- Uses vendor-specific registers for VOUT scaling and phase configuration. + +Device supports: + +- SVID interface. +- AVSBus interface. + +Device compliant with: + +- PMBus rev 1.3 interface. + +Sysfs Interface +--------------- + +The driver provides the following sysfs attributes: + +**Current measurements:** + +- Index 1: "iin" +- Indexes 2, 3: "iout" + +**curr[1-3]_alarm** +**curr[1-3]_input** +**curr[1-3]_label** + +**Voltage measurements:** + +- Index 1: "vin" +- Indexes 2, 3: "vout" + +**in[1-3]_crit** +**in[1-3]_crit_alarm** +**in[1-3]_input** +**in[1-3]_label** +**in[1-3]_lcrit** +**in[1-3]_lcrit_alarm** + +**Power measurements:** + +- Index 1: "pin" +- Indexes 2, 3: "pout" + +**power[1-3]_alarm** +**power[1-3]_input** +**power[1-3]_label** + +**Temperature measurements:** + +**temp[1-2]_crit** +**temp[1-2]_crit_alarm** +**temp[1-2]_input** +**temp[1-2]_max** +**temp[1-2]_max_alarm** + +diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 441f984a859d..93b558761cc6 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig@@ -364,6 +364,16 @@ config SENSORS_MP2856 This driver can also be built as a module. If so, the module will be called mp2856. +config SENSORS_MP2869A + tristate "MP2869A PMBus sensor" + depends on I2C && PMBUS + help + If you say yes here you get support for the MPS MP2869A MP29612A + voltage regulator via the PMBus interface. + + This driver can also be built as a module. If so, the module + will be called mp2869a. + config SENSORS_MP2888 tristate "MPS MP2888" helpdiff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile index 29cd8a3317d2..42087d0dedbc 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile@@ -37,6 +37,7 @@ obj-$(CONFIG_SENSORS_MAX31785) += max31785.o obj-$(CONFIG_SENSORS_MAX34440) += max34440.o obj-$(CONFIG_SENSORS_MAX8688) += max8688.o obj-$(CONFIG_SENSORS_MP2856) += mp2856.o +obj-$(CONFIG_SENSORS_MP2869A) += mp2869a.o obj-$(CONFIG_SENSORS_MP2888) += mp2888.o obj-$(CONFIG_SENSORS_MP2891) += mp2891.o obj-$(CONFIG_SENSORS_MP2975) += mp2975.odiff --git a/drivers/hwmon/pmbus/mp2869a.c b/drivers/hwmon/pmbus/mp2869a.c new file mode 100644 index 000000000000..e61f1380dbc1 --- /dev/null +++ b/drivers/hwmon/pmbus/mp2869a.c@@ -0,0 +1,299 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for MP2856A/MP29612A + * Monolithic Power Systems VR Controller + * + * Copyright (C) 2023 Quanta Computer lnc. + */ + +#include <linux/err.h> +#include <linux/i2c.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/pmbus.h> +#include "pmbus.h" + +/* Vendor specific registers. */ +#define MP2869A_VOUT_MODE 0x20
Standard register.
+#define MP2869A_VOUT_MODE_MASK GENMASK(7, 5) +#define MP2869A_VOUT_MODE_VID (0 << 5) + +#define MP2869A_READ_VOUT 0x8b
Standard register.
+ +#define MP2869A_MFR_VOUT_SCALE_LOOP 0x29
Standard register. Guenter