]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (pmbus/max20860a) Add driver for Analog Devices MAX20860A
authorSyed Arif <arif.syed@hpe.com>
Mon, 1 Jun 2026 18:45:36 +0000 (18:45 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jun 2026 15:23:18 +0000 (08:23 -0700)
Add a PMBus driver for the Analog Devices MAX20860A step-down DC-DC
switching regulator. The MAX20860A provides monitoring of input/output
voltage, output current, and temperature via the PMBus interface using
linear data format. Optional regulator support is available via
CONFIG_SENSORS_MAX20860A_REGULATOR.

Signed-off-by: Syed Arif <arif.syed@hpe.com>
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260601184516.919488-3-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/index.rst
Documentation/hwmon/max20860a.rst [new file with mode: 0644]
MAINTAINERS
drivers/hwmon/pmbus/Kconfig
drivers/hwmon/pmbus/Makefile
drivers/hwmon/pmbus/max20860a.c [new file with mode: 0644]

index e880c6ca84f03d307ac4b57043cfed6547dc12aa..ffaacda416e7337e7e556eaba0ac307b45dfe715 100644 (file)
@@ -163,6 +163,7 @@ Hardware Monitoring Kernel Drivers
    max20730
    max20751
    max20830
+   max20860a
    max31722
    max31730
    max31760
diff --git a/Documentation/hwmon/max20860a.rst b/Documentation/hwmon/max20860a.rst
new file mode 100644 (file)
index 0000000..ea6d222
--- /dev/null
@@ -0,0 +1,57 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver max20860a
+=======================
+
+Supported chips:
+
+  * Analog Devices MAX20860A
+
+    Prefix: 'max20860a'
+
+    Addresses scanned: -
+
+    Datasheet: https://www.analog.com/en/products/max20860a.html
+
+Author:
+
+  - Syed Arif <arif.syed@hpe.com>
+  - Sanman Pradhan <psanman@juniper.net>
+
+
+Description
+-----------
+
+This driver supports hardware monitoring for Analog Devices MAX20860A
+Step-Down Switching Regulator with PMBus Interface.
+
+The MAX20860A is a 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
+Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
+
+Usage Notes
+-----------
+
+This driver does not auto-detect devices. You will have to instantiate
+the devices explicitly.
+
+Sysfs entries
+-------------
+
+================= ========================================
+in1_label         "vin"
+in1_input         Measured input voltage
+in1_alarm         Input voltage alarm
+in2_label         "vout1"
+in2_input         Measured output voltage
+in2_alarm         Output voltage alarm
+curr1_label       "iout1"
+curr1_input       Measured output current
+curr1_alarm       Output current alarm
+temp1_input       Measured temperature
+temp1_alarm       Chip temperature alarm
+temp2_input       Measured temperature (secondary)
+================= ========================================
index d57da4881737fc42b57911a06d44edceded3e583..61de4fd69cfa4d7b3d8ed2c2047dfd57a2684807 100644 (file)
@@ -15693,6 +15693,14 @@ F:     Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml
 F:     Documentation/hwmon/max20830.rst
 F:     drivers/hwmon/pmbus/max20830.c
 
+MAX20860A HARDWARE MONITOR DRIVER
+M:     Sanman Pradhan <psanman@juniper.net>
+L:     linux-hwmon@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/hwmon/pmbus/adi,max20860a.yaml
+F:     Documentation/hwmon/max20860a.rst
+F:     drivers/hwmon/pmbus/max20860a.c
+
 MAX2175 SDR TUNER DRIVER
 M:     Ramesh Shanmugasundaram <rashanmu@gmail.com>
 L:     linux-media@vger.kernel.org
index 64f38654f4e7c4c0c32e13929a2ea1e3152fd937..f330dc3f21fe5f309554f3fbf6dae95c7c78f730 100644 (file)
@@ -402,6 +402,25 @@ config SENSORS_MAX20830
          This driver can also be built as a module. If so, the module will
          be called max20830.
 
+config SENSORS_MAX20860A
+       tristate "Analog Devices MAX20860A"
+       help
+         If you say yes here you get hardware monitoring support for Analog
+         Devices MAX20860A step-down converter.
+
+         This driver can also be built as a module. If so, the module will
+         be called max20860a.
+
+config SENSORS_MAX20860A_REGULATOR
+       bool "Regulator support for MAX20860A"
+       depends on SENSORS_MAX20860A && REGULATOR
+       help
+         If you say yes here you get regulator support for Analog Devices
+         MAX20860A step-down converter.
+
+         This enables the MAX20860A to be used as a regulator device,
+         providing voltage control through the regulator framework.
+
 config SENSORS_MAX31785
        tristate "Maxim MAX31785 and compatibles"
        help
index 1f2c73b71953eee368e1fd1a4edd83f0255da107..ffc05f49321310e238253a2c2e5b2deb63ffce25 100644 (file)
@@ -39,6 +39,7 @@ 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_MAX20860A)        += max20860a.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/max20860a.c b/drivers/hwmon/pmbus/max20860a.c
new file mode 100644 (file)
index 0000000..905f916
--- /dev/null
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Hardware monitoring driver for Analog Devices MAX20860A
+ *
+ * SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP
+ */
+
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/regulator/driver.h>
+#include "pmbus.h"
+
+#if IS_ENABLED(CONFIG_SENSORS_MAX20860A_REGULATOR)
+static const struct regulator_desc max20860a_reg_desc[] = {
+       PMBUS_REGULATOR_ONE("vout"),
+};
+#endif
+
+static struct pmbus_driver_info max20860a_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_STATUS_VOUT |
+               PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
+               PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 |
+               PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_STATUS_INPUT,
+#if IS_ENABLED(CONFIG_SENSORS_MAX20860A_REGULATOR)
+       .num_regulators = 1,
+       .reg_desc = max20860a_reg_desc,
+#endif
+};
+
+static int max20860a_probe(struct i2c_client *client)
+{
+       return pmbus_do_probe(client, &max20860a_info);
+}
+
+static const struct i2c_device_id max20860a_id[] = {
+       {"max20860a"},
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, max20860a_id);
+
+static const struct of_device_id max20860a_of_match[] = {
+       { .compatible = "adi,max20860a" },
+       {}
+};
+MODULE_DEVICE_TABLE(of, max20860a_of_match);
+
+static struct i2c_driver max20860a_driver = {
+       .driver = {
+               .name = "max20860a",
+               .of_match_table = max20860a_of_match,
+       },
+       .probe = max20860a_probe,
+       .id_table = max20860a_id,
+};
+
+module_i2c_driver(max20860a_driver);
+
+MODULE_AUTHOR("Syed Arif <arif.syed@hpe.com>");
+MODULE_AUTHOR("Sanman Pradhan <psanman@juniper.net>");
+MODULE_DESCRIPTION("PMBus driver for Analog Devices MAX20860A");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");