Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (pmbus/max17616) add driver for max17616

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>
Link: https://lore.kernel.org/r/20250930-upstream-max17616-v1-2-1525a85f126c@analog.com
[groeck: Fixed htmldocs 'WARNING: Title underline too short'
as reported by Kriish Sharma <kriish.sharma2006@gmail.com>]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Kim Seer Paller and committed by
Guenter Roeck
77ed12d1 1288ea95

+148
+1
Documentation/hwmon/index.rst
··· 151 151 max1619 152 152 max16601 153 153 max1668 154 + max17616 154 155 max197 155 156 max20730 156 157 max20751
+62
Documentation/hwmon/max17616.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + Kernel driver max17616 4 + ====================== 5 + 6 + Supported chips: 7 + 8 + * Analog Devices MAX17616/MAX17616A 9 + 10 + Prefix: 'max17616' 11 + 12 + Addresses scanned: - 13 + 14 + Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max17616-max17616a.pdf 15 + 16 + Author: 17 + 18 + - Kim Seer Paller <kimseer.paller@analog.com> 19 + 20 + 21 + Description 22 + ----------- 23 + 24 + This driver supports hardware monitoring for Analog Devices MAX17616/MAX17616A 25 + Current-Limiter with OV/Surge, UV, Reverse Polarity, Loss of Ground Protection 26 + with PMBus Interface. 27 + 28 + The MAX17616/MAX17616A is a 3V to 80V, 7A current-limiter with overvoltage, 29 + surge, undervoltage, reverse polarity, and loss of ground protection. Through 30 + the PMBus interface, the device can monitor input/output voltages, output current 31 + and temperature. 32 + 33 + The driver is a client driver to the core PMBus driver. Please see 34 + Documentation/hwmon/pmbus.rst for details on PMBus client drivers. 35 + 36 + Usage Notes 37 + ----------- 38 + 39 + This driver does not auto-detect devices. You will have to instantiate 40 + the devices explicitly. Please see Documentation/i2c/instantiating-devices.rst 41 + for details. 42 + 43 + Platform data support 44 + --------------------- 45 + 46 + The driver supports standard PMBus driver platform data. 47 + 48 + Sysfs entries 49 + ------------- 50 + 51 + ================= ======================================== 52 + in1_label "vin" 53 + in1_input Measured input voltage 54 + in1_alarm Input voltage alarm 55 + in2_label "vout1" 56 + in2_input Measured output voltage 57 + curr1_label "iout1" 58 + curr1_input Measured output current. 59 + curr1_alarm Output current alarm 60 + temp1_input Measured temperature 61 + temp1_alarm Chip temperature alarm 62 + ================= ========================================
+2
MAINTAINERS
··· 15171 15171 S: Supported 15172 15172 W: https://ez.analog.com/linux-software-drivers 15173 15173 F: Documentation/devicetree/bindings/hwmon/pmbus/adi,max17616.yaml 15174 + F: Documentation/hwmon/max17616.rst 15175 + F: drivers/hwmon/pmbus/max17616.c 15174 15176 15175 15177 MAX2175 SDR TUNER DRIVER 15176 15178 M: Ramesh Shanmugasundaram <rashanmu@gmail.com>
+9
drivers/hwmon/pmbus/Kconfig
··· 320 320 This driver can also be built as a module. If so, the module will 321 321 be called max16601. 322 322 323 + config SENSORS_MAX17616 324 + tristate "Analog Devices MAX17616/MAX17616A" 325 + help 326 + If you say yes here you get hardware monitoring support for Analog 327 + Devices MAX17616/MAX17616A. 328 + 329 + This driver can also be built as a module. If so, the module will 330 + be called max17616. 331 + 323 332 config SENSORS_MAX20730 324 333 tristate "Maxim MAX20710, MAX20730, MAX20734, MAX20743" 325 334 help
+1
drivers/hwmon/pmbus/Makefile
··· 31 31 obj-$(CONFIG_SENSORS_MAX15301) += max15301.o 32 32 obj-$(CONFIG_SENSORS_MAX16064) += max16064.o 33 33 obj-$(CONFIG_SENSORS_MAX16601) += max16601.o 34 + obj-$(CONFIG_SENSORS_MAX17616) += max17616.o 34 35 obj-$(CONFIG_SENSORS_MAX20730) += max20730.o 35 36 obj-$(CONFIG_SENSORS_MAX20751) += max20751.o 36 37 obj-$(CONFIG_SENSORS_MAX31785) += max31785.o
+73
drivers/hwmon/pmbus/max17616.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Hardware monitoring driver for Analog Devices MAX17616/MAX17616A 4 + * 5 + * Copyright (C) 2025 Analog Devices, Inc. 6 + */ 7 + 8 + #include <linux/err.h> 9 + #include <linux/i2c.h> 10 + #include <linux/mod_devicetable.h> 11 + #include <linux/module.h> 12 + 13 + #include "pmbus.h" 14 + 15 + static struct pmbus_driver_info max17616_info = { 16 + .pages = 1, 17 + .format[PSC_VOLTAGE_IN] = direct, 18 + .m[PSC_VOLTAGE_IN] = 512, 19 + .b[PSC_VOLTAGE_IN] = -18, 20 + .R[PSC_VOLTAGE_IN] = -1, 21 + 22 + .format[PSC_VOLTAGE_OUT] = direct, 23 + .m[PSC_VOLTAGE_OUT] = 512, 24 + .b[PSC_VOLTAGE_OUT] = -18, 25 + .R[PSC_VOLTAGE_OUT] = -1, 26 + 27 + .format[PSC_CURRENT_OUT] = direct, 28 + .m[PSC_CURRENT_OUT] = 5845, 29 + .b[PSC_CURRENT_OUT] = 80, 30 + .R[PSC_CURRENT_OUT] = -1, 31 + 32 + .format[PSC_TEMPERATURE] = direct, 33 + .m[PSC_TEMPERATURE] = 71, 34 + .b[PSC_TEMPERATURE] = 19653, 35 + .R[PSC_TEMPERATURE] = -1, 36 + 37 + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT | 38 + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_VOUT | 39 + PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_INPUT | 40 + PMBUS_HAVE_STATUS_TEMP, 41 + }; 42 + 43 + static int max17616_probe(struct i2c_client *client) 44 + { 45 + return pmbus_do_probe(client, &max17616_info); 46 + } 47 + 48 + static const struct i2c_device_id max17616_id[] = { 49 + { "max17616" }, 50 + { } 51 + }; 52 + MODULE_DEVICE_TABLE(i2c, max17616_id); 53 + 54 + static const struct of_device_id max17616_of_match[] = { 55 + { .compatible = "adi,max17616" }, 56 + { } 57 + }; 58 + MODULE_DEVICE_TABLE(of, max17616_of_match); 59 + 60 + static struct i2c_driver max17616_driver = { 61 + .driver = { 62 + .name = "max17616", 63 + .of_match_table = max17616_of_match, 64 + }, 65 + .probe = max17616_probe, 66 + .id_table = max17616_id, 67 + }; 68 + module_i2c_driver(max17616_driver); 69 + 70 + MODULE_AUTHOR("Kim Seer Paller <kimseer.paller@analog.com>"); 71 + MODULE_DESCRIPTION("PMBus driver for Analog Devices MAX17616/MAX17616A"); 72 + MODULE_LICENSE("GPL"); 73 + MODULE_IMPORT_NS("PMBUS");