From: Kim Seer Paller <kimseer.paller@analog.com>
To: Kim Seer Paller <kimseer.paller@analog.com>,
Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: <linux-hwmon@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>
Subject: [PATCH 2/2] hwmon: (pmbus/max17616): add driver for max17616
Date: Tue, 30 Sep 2025 13:02:21 +0800 [thread overview]
Message-ID: <20250930-upstream-max17616-v1-2-1525a85f126c@analog.com> (raw)
In-Reply-To: <20250930-upstream-max17616-v1-0-1525a85f126c@analog.com>
Add support for MAX17616/MAX17616A current-limiter with
overvoltage/surge, undervoltage, reverse polarity, loss of ground
protection with PMBus interface. The PMBus interface allows monitoring
of input/output voltages, output current and temperature.
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/max17616.rst | 62 ++++++++++++++++++++++++++++++++++
MAINTAINERS | 2 ++
drivers/hwmon/pmbus/Kconfig | 9 +++++
drivers/hwmon/pmbus/Makefile | 1 +
drivers/hwmon/pmbus/max17616.c | 73 ++++++++++++++++++++++++++++++++++++++++
6 files changed, 148 insertions(+)
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index 51a5bdf75b08656ee6499c6b5c50a51fc4d7c210..62c5d10f16ae722dd2e6a4f8953ae24b5f541666 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -151,6 +151,7 @@ Hardware Monitoring Kernel Drivers
max1619
max16601
max1668
+ max17616
max197
max20730
max20751
diff --git a/Documentation/hwmon/max17616.rst b/Documentation/hwmon/max17616.rst
new file mode 100644
index 0000000000000000000000000000000000000000..936447159f87a9c6b270b903c46b43a90caddb23
--- /dev/null
+++ b/Documentation/hwmon/max17616.rst
@@ -0,0 +1,62 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver max17616
+====================
+
+Supported chips:
+
+ * Analog Devices MAX17616/MAX17616A
+
+ Prefix: 'max17616'
+
+ Addresses scanned: -
+
+ Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf
+
+Author:
+
+ - Kim Seer Paller <kimseer.paller@analog.com>
+
+
+Description
+-----------
+
+This driver supports hardware monitoring for Analog Devices MAX17616/MAX17616A
+Current-Limiter with OV/Surge, UV, Reverse Polarity, Loss of Ground Protection
+with PMBus Interface.
+
+The MAX17616/MAX17616A is a 3V to 80V, 7A current-limiter with overvoltage,
+surge, undervoltage, reverse polarity, and loss of ground protection. 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. Please see Documentation/i2c/instantiating-devices.rst
+for details.
+
+Platform data support
+---------------------
+
+The driver supports standard PMBus driver platform data.
+
+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 89d35faf93c9d2e984b73f5c09d09044ee6eddb2..267ab428260a29c38fa508190bdfa2677bba58c8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14923,6 +14923,8 @@ L: linux-hwmon@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/devicetree/bindings/hwmon/pmbus/adi,max17616.yaml
+F: Documentation/hwmon/max17616.rst
+F: drivers/hwmon/pmbus/max17616.c
MAX2175 SDR TUNER DRIVER
M: Ramesh Shanmugasundaram <rashanmu@gmail.com>
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index da04ff6df28bd12909c9140662d6b932a150bd97..def5faad8fdf56eb31fe216322ead57ee43a1ac5 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -320,6 +320,15 @@ config SENSORS_MAX16601
This driver can also be built as a module. If so, the module will
be called max16601.
+config SENSORS_MAX17616
+ tristate "Analog Devices MAX17616/MAX17616A"
+ help
+ If you say yes here you get hardware monitoring support for Analog
+ Devices MAX17616/MAX17616A.
+
+ This driver can also be built as a module. If so, the module will
+ be called max17616.
+
config SENSORS_MAX20730
tristate "Maxim MAX20710, MAX20730, MAX20734, MAX20743"
help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index 4c5ff3f32c5ecbea069dce8af3e3e8365892b278..9cebe488fdf18b2aa164c0fc2ac7d1d8ffd2b970 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_SENSORS_LTC4286) += ltc4286.o
obj-$(CONFIG_SENSORS_MAX15301) += max15301.o
obj-$(CONFIG_SENSORS_MAX16064) += max16064.o
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_MAX31785) += max31785.o
diff --git a/drivers/hwmon/pmbus/max17616.c b/drivers/hwmon/pmbus/max17616.c
new file mode 100644
index 0000000000000000000000000000000000000000..1d4a0ddb95bb6e8349932062be0d918f935cd846
--- /dev/null
+++ b/drivers/hwmon/pmbus/max17616.c
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hardware monitoring driver for Analog Devices MAX17616/MAX17616A
+ *
+ * Copyright (C) 2025 Analog Devices, Inc.
+ */
+
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+
+#include "pmbus.h"
+
+static struct pmbus_driver_info max17616_info = {
+ .pages = 1,
+ .format[PSC_VOLTAGE_IN] = direct,
+ .m[PSC_VOLTAGE_IN] = 512,
+ .b[PSC_VOLTAGE_IN] = -18,
+ .R[PSC_VOLTAGE_IN] = -1,
+
+ .format[PSC_VOLTAGE_OUT] = direct,
+ .m[PSC_VOLTAGE_OUT] = 512,
+ .b[PSC_VOLTAGE_OUT] = -18,
+ .R[PSC_VOLTAGE_OUT] = -1,
+
+ .format[PSC_CURRENT_OUT] = direct,
+ .m[PSC_CURRENT_OUT] = 5845,
+ .b[PSC_CURRENT_OUT] = 80,
+ .R[PSC_CURRENT_OUT] = -1,
+
+ .format[PSC_TEMPERATURE] = direct,
+ .m[PSC_TEMPERATURE] = 71,
+ .b[PSC_TEMPERATURE] = 19653,
+ .R[PSC_TEMPERATURE] = -1,
+
+ .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 max17616_probe(struct i2c_client *client)
+{
+ return pmbus_do_probe(client, &max17616_info);
+}
+
+static const struct i2c_device_id max17616_id[] = {
+ { "max17616" },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, max17616_id);
+
+static const struct of_device_id max17616_of_match[] = {
+ { .compatible = "adi,max17616" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, max17616_of_match);
+
+static struct i2c_driver max17616_driver = {
+ .driver = {
+ .name = "max17616",
+ .of_match_table = max17616_of_match,
+ },
+ .probe = max17616_probe,
+ .id_table = max17616_id,
+};
+module_i2c_driver(max17616_driver);
+
+MODULE_AUTHOR("Kim Seer Paller <kimseer.paller@analog.com>");
+MODULE_DESCRIPTION("PMBus driver for Analog Devices MAX17616/MAX17616A");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");
--
2.34.1
next prev parent reply other threads:[~2025-09-30 5:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-30 5:02 [PATCH 0/2] Add support for MAX17616/MAX17616A hwmon device Kim Seer Paller
2025-09-30 5:02 ` [PATCH 1/2] dt-bindings: hwmon: pmbus: add max17616 Kim Seer Paller
2025-09-30 18:54 ` Conor Dooley
2025-10-02 20:55 ` Guenter Roeck
2025-10-02 22:15 ` Marcelo Schmitt
2025-09-30 5:02 ` Kim Seer Paller [this message]
2025-09-30 10:26 ` [PATCH 2/2] hwmon: (pmbus/max17616): add driver for max17616 Guenter Roeck
2025-10-01 8:17 ` Paller, Kim Seer
2025-10-02 20:55 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250930-upstream-max17616-v1-2-1525a85f126c@analog.com \
--to=kimseer.paller@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).