From 963b129b33b5fdef721dcae0e34daf86d471e9da Mon Sep 17 00:00:00 2001 From: Alexis Czezar Torreno Date: Fri, 13 Mar 2026 10:30:50 +0800 Subject: [PATCH 1/3] dt-bindings: hwmon: pmbus: add max20830 Add device tree documentation for MAX20830 step-down DC-DC switching regulator with PMBus interface. Signed-off-by: Alexis Czezar Torreno --- .../bindings/hwmon/pmbus/adi,max20830.yaml | 55 +++++++++++++++++++ MAINTAINERS | 7 +++ 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml new file mode 100644 index 00000000000000..cc7d7646d7db5f --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/pmbus/adi,max20830.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices MAX20830 Step-Down Switching Regulator with PMBus + +maintainers: + - Alexis Czezar Torreno + +description: | + The MAX20830 is a fully integrated step-down DC-DC switching regulator with + PMBus interface. It provides 2.7V to 16V input, 0.4V to 5.8V adjustable + output, and up to 30A output current. It allows monitoring of input/output + voltage, output current and temperature through the PMBus serial interface. + Datasheet: + https://www.analog.com/en/products/max20830.html + +properties: + compatible: + const: adi,max20830 + + reg: + maxItems: 1 + + vddh-supply: + description: + Phandle to the regulator that provides the VDDH power supply. + + avdd-supply: + description: + Phandle to the regulator that provides the AVDD power supply. + +required: + - compatible + - reg + - vddh-supply + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + hwmon@30 { + compatible = "adi,max20830"; + reg = <0x30>; + vddh-supply = <&vddh>; + avdd-supply = <&avdd>; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index c5ef8e12e5f85a..79c92b96fce04c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14063,6 +14063,13 @@ F: Documentation/devicetree/bindings/hwmon/pmbus/adi,max17616.yaml F: Documentation/hwmon/max17616.rst F: drivers/hwmon/pmbus/max17616.c +MAX20830 HARDWARE MONITOR DRIVER +M: Alexis Czezar Torreno +L: linux-hwmon@vger.kernel.org +S: Supported +W: https://ez.analog.com/linux-software-drivers +F: Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml + MAX2175 SDR TUNER DRIVER M: Ramesh Shanmugasundaram L: linux-media@vger.kernel.org From c359504aebebdb0fc2b0e4f948da05baf3c68ada Mon Sep 17 00:00:00 2001 From: Alexis Czezar Torreno Date: Fri, 13 Mar 2026 10:36:23 +0800 Subject: [PATCH 2/3] hwmon: (pmbus/max20830) add driver for max20830 Add support for MAX20830 step-down DC-DC switching regulator with PMBus interface. It allows monitoring of input/output voltage, output current and temperature through the PMBus serial interface. Signed-off-by: Alexis Czezar Torreno --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/max20830.rst | 48 ++++++++++++++++++++++ MAINTAINERS | 2 + drivers/hwmon/pmbus/Kconfig | 9 ++++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/max20830.c | 70 ++++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 Documentation/hwmon/max20830.rst create mode 100644 drivers/hwmon/pmbus/max20830.c diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index 9e86412926f11b..b2f3b725cdd898 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -147,6 +147,7 @@ Hardware Monitoring Kernel Drivers max197 max20730 max20751 + max20830 max31722 max31730 max31760 diff --git a/Documentation/hwmon/max20830.rst b/Documentation/hwmon/max20830.rst new file mode 100644 index 00000000000000..7f429ed5dd1907 --- /dev/null +++ b/Documentation/hwmon/max20830.rst @@ -0,0 +1,48 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver max20830 +====================== + +Supported chips: + + * Analog Devices MAX20830 + + Prefix: 'max20830' + + Addresses scanned: - + + Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max20830.pdf + +Author: + + - Alexis Czezar Torreno + + +Description +----------- + +This driver supports hardware monitoring for Analog Devices MAX20830 +Step-Down Switching Regulator with PMBus Interface. + +The MAX20830 is a 2.7V to 16V, 30A fully integrated step-down DC-DC switching +regulator. Through the PMBus interface, the device can monitor input/output +voltages, output current and temperature. + +The driver is a client driver to the core PMBus driver. Please see +:doc:`/hwmon/pmbus` for details on PMBus client drivers. + +Sysfs entries +------------- + +================= ======================================== +in1_label "vin" +in1_input Measured input voltage +in1_alarm Input voltage alarm +in2_label "vout1" +in2_input Measured output voltage +curr1_label "iout1" +curr1_input Measured output current +curr1_alarm Output current alarm +temp1_input Measured temperature +temp1_alarm Chip temperature alarm +================= ======================================== diff --git a/MAINTAINERS b/MAINTAINERS index 79c92b96fce04c..74c732fa7efa7c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14069,6 +14069,8 @@ L: linux-hwmon@vger.kernel.org S: Supported W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml +F: Documentation/hwmon/max20830.rst +F: drivers/hwmon/pmbus/max20830.c MAX2175 SDR TUNER DRIVER M: Ramesh Shanmugasundaram diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 9bb23f03231671..0fe50d6c3eeb2c 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -328,6 +328,15 @@ config SENSORS_MAX20751 This driver can also be built as a module. If so, the module will be called max20751. +config SENSORS_MAX20830 + tristate "Analog Devices MAX20830" + help + If you say yes here you get hardware monitoring support for Analog + Devices MAX20830. + + This driver can also be built as a module. If so, the module will + be called max20830. + config SENSORS_MAX31785 tristate "Maxim MAX31785 and compatibles" help diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile index 02f77de8626b4b..4fd1d162bd99d5 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile @@ -33,6 +33,7 @@ obj-$(CONFIG_SENSORS_MAX16601) += max16601.o obj-$(CONFIG_SENSORS_MAX17616) += max17616.o obj-$(CONFIG_SENSORS_MAX20730) += max20730.o obj-$(CONFIG_SENSORS_MAX20751) += max20751.o +obj-$(CONFIG_SENSORS_MAX20830) += max20830.o obj-$(CONFIG_SENSORS_MAX31785) += max31785.o obj-$(CONFIG_SENSORS_MAX34440) += max34440.o obj-$(CONFIG_SENSORS_MAX8688) += max8688.o diff --git a/drivers/hwmon/pmbus/max20830.c b/drivers/hwmon/pmbus/max20830.c new file mode 100644 index 00000000000000..c8917b7d94fbf9 --- /dev/null +++ b/drivers/hwmon/pmbus/max20830.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Hardware monitoring driver for Analog Devices MAX20830 + * + * Copyright (C) 2026 Analog Devices, Inc. + */ + +#include +#include +#include +#include "pmbus.h" + +static struct pmbus_driver_info max20830_info = { + .pages = 1, + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_TEMPERATURE] = linear, + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT | + PMBUS_HAVE_TEMP | + PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP, +}; + +static int max20830_probe(struct i2c_client *client) +{ + u8 buf[I2C_SMBUS_BLOCK_MAX + 1]; + int ret; + + ret = i2c_smbus_read_i2c_block_data(client, PMBUS_IC_DEVICE_ID, + I2C_SMBUS_BLOCK_MAX, buf); + if (ret < 0) + return dev_err_probe(&client->dev, ret, + "Failed to read IC_DEVICE_ID\n"); + + buf[ret] = '\0'; + if (!strstr(buf, "MAX20830")) + return dev_err_probe(&client->dev, -ENODEV, + "Unsupported device: '%s'\n", buf); + + return pmbus_do_probe(client, &max20830_info); +} + +static const struct i2c_device_id max20830_id[] = { + {"max20830"}, + {} +}; +MODULE_DEVICE_TABLE(i2c, max20830_id); + +static const struct of_device_id max20830_of_match[] = { + { .compatible = "adi,max20830" }, + {} +}; +MODULE_DEVICE_TABLE(of, max20830_of_match); + +static struct i2c_driver max20830_driver = { + .driver = { + .name = "max20830", + .of_match_table = max20830_of_match, + }, + .probe = max20830_probe, + .id_table = max20830_id, +}; + +module_i2c_driver(max20830_driver); + +MODULE_AUTHOR("Alexis Czezar Torreno "); +MODULE_DESCRIPTION("PMBus driver for Analog Devices MAX20830"); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(PMBUS); From 0389b7fe45b5fa470f06a0f65836c3fd34342d5b Mon Sep 17 00:00:00 2001 From: Alexis Czezar Torreno Date: Fri, 13 Mar 2026 10:40:23 +0800 Subject: [PATCH 3/3] hwmon: Kconfig.adi: imply MAX20830 Add MAX20830 to the ADI Kconfig. Signed-off-by: Alexis Czezar Torreno --- drivers/hwmon/Kconfig.adi | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/Kconfig.adi b/drivers/hwmon/Kconfig.adi index ff3032e21f6804..5259e85939e038 100644 --- a/drivers/hwmon/Kconfig.adi +++ b/drivers/hwmon/Kconfig.adi @@ -48,3 +48,4 @@ config HWMON_ALL_ADI_DRIVERS imply SENSORS_LT7182S imply SENSORS_LTC4282 imply SENSORS_MAX17616 + imply SENSORS_MAX20830