* [PATCH v3 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver
@ 2026-07-24 16:49 Pradhan, Sanman
2026-07-24 16:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
0 siblings, 2 replies; 9+ messages in thread
From: Pradhan, Sanman @ 2026-07-24 16:49 UTC (permalink / raw)
To: linux-hwmon@vger.kernel.org
Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan
From: Sanman Pradhan <psanman@juniper.net>
This series adds a PMBus driver for the Analog Devices MAX16545 and
MAX16550, and the Volterra VT7505 controllers.
The driver reports input and output voltage, input and output current,
input power, and temperature over PMBus. All sensors use the direct data
format. Peak input voltage, output voltage, output current, input power
and temperature readings are exposed and can be reset.
The MAX16545 uses the same programming model as the VT7505 and is
described with a fallback compatible.
The current and power scaling depend on the external current-report
resistor on the ILOAD pin, which can be specified with the
"adi,rload-ohms" device tree property. On the MAX16550 and VT7505, the
severe overcurrent-protection deglitch time can optionally be programmed
with the "adi,ocp-severe-filter-us" property; on the MAX16545 that delay
is fixed, so the property is rejected for that part.
The driver was tested on Juniper PTX hardware.
Changes in v3:
- dt-bindings: clarify that adi,rload-ohms is the ILOAD telemetry
resistor, not a current-path shunt; note that the severe-OCP filter
retains the existing hardware setting when omitted, and add it to the
example; move additionalProperties after the allOf block.
- driver: use per-device match data instead of an enum (no zero-valued
match data), derive the temperature coefficients and severe-OCP filter
support from it, add an explicit adi,max16545 match entry, and replace
the SPDX-FileCopyrightText tag with a plain copyright line.
Changes in v2:
- dt-bindings: represent the severe-OCP deglitch filter in microseconds
(renamed to adi,ocp-severe-filter-us, values 0/1/2/10).
- driver: map the microsecond value to the MFR_CONFIG[15:14] field.
Georgi Vlaev (1):
hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550
and Volterra VT7505
Sanman Pradhan (1):
dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and
Volterra VT7505
.../bindings/hwmon/pmbus/adi,vt7505.yaml | 84 ++++++
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/vt7505.rst | 89 ++++++
MAINTAINERS | 8 +
drivers/hwmon/pmbus/Kconfig | 9 +
drivers/hwmon/pmbus/Makefile | 1 +
drivers/hwmon/pmbus/vt7505.c | 284 ++++++++++++++++++
7 files changed, 476 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
create mode 100644 Documentation/hwmon/vt7505.rst
create mode 100644 drivers/hwmon/pmbus/vt7505.c
base-commit: fa8ff8bde9207509f90adacc157b208ee732adad
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:49 [PATCH v3 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
@ 2026-07-24 16:49 ` Pradhan, Sanman
2026-07-24 16:53 ` sashiko-bot
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
1 sibling, 1 reply; 9+ messages in thread
From: Pradhan, Sanman @ 2026-07-24 16:49 UTC (permalink / raw)
To: linux-hwmon@vger.kernel.org
Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan
From: Sanman Pradhan <psanman@juniper.net>
Add device tree binding documentation for the Analog Devices MAX16545 and
MAX16550, and the Volterra VT7505 PMBus controllers.
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
---
Changes in v3:
- Clarify that adi,rload-ohms is the ILOAD telemetry resistor, not a
current-path shunt.
- Note that the severe-OCP filter retains the existing hardware setting
when omitted, and add it to the example.
- Move additionalProperties after the allOf block.
Changes in v2:
- Represent the severe-OCP deglitch filter in microseconds
(renamed to adi,ocp-severe-filter-us, values 0/1/2/10).
.../bindings/hwmon/pmbus/adi,vt7505.yaml | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
new file mode 100644
index 0000000000000..cc538de6c0675
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/pmbus/adi,vt7505.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices MAX16545/MAX16550 and Volterra VT7505 PMBus controllers
+
+maintainers:
+ - Sanman Pradhan <psanman@juniper.net>
+
+description: |
+ The Analog Devices MAX16545 and MAX16550, and the Volterra VT7505, are PMBus
+ controllers that provide input/output voltage, input/output current,
+ input power and temperature monitoring over the PMBus interface.
+
+ The MAX16545 uses the same programming model as the VT7505.
+
+ Datasheets:
+ https://www.analog.com/media/en/technical-documentation/data-sheets/max16545b-max16545c.pdf
+ https://www.analog.com/media/en/technical-documentation/data-sheets/max16550.pdf
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - adi,max16550
+ - adi,vt7505
+ - items:
+ - const: adi,max16545
+ - const: adi,vt7505
+
+ reg:
+ maxItems: 1
+
+ adi,rload-ohms:
+ description:
+ Resistance in ohms of the external telemetry load resistor connected
+ between the ILOAD current-output pin and ground. This is not a
+ current-path shunt resistor; it sets the scaling of the reported input
+ current, output current and input power.
+ minimum: 1
+ default: 4750
+
+ adi,ocp-severe-filter-us:
+ description:
+ Deglitch time, in microseconds, applied to the severe
+ overcurrent-protection comparator, programmed into the
+ MFR_CONFIG[15:14] field. The MAX16550 and VT7505 expose this field.
+ On the MAX16545 the severe overcurrent delay is fixed and these bits
+ are reserved. If omitted, the existing hardware setting is retained.
+ enum: [0, 1, 2, 10]
+
+required:
+ - compatible
+ - reg
+
+allOf:
+ # The severe OCP deglitch filter is fixed on the MAX16545, so the property
+ # is only valid for the MAX16550 and VT7505.
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: adi,max16545
+ then:
+ properties:
+ adi,ocp-severe-filter-us: false
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulator@40 {
+ compatible = "adi,vt7505";
+ reg = <0x40>;
+ adi,rload-ohms = <4750>;
+ adi,ocp-severe-filter-us = <10>;
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:49 [PATCH v3 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
2026-07-24 16:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
@ 2026-07-24 16:50 ` Pradhan, Sanman
2026-07-24 16:59 ` sashiko-bot
` (2 more replies)
1 sibling, 3 replies; 9+ messages in thread
From: Pradhan, Sanman @ 2026-07-24 16:50 UTC (permalink / raw)
To: linux-hwmon@vger.kernel.org
Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan, Georgi Vlaev, Dhruva Devineni, Debjit Ghosh,
Jawahar Balaji Thirumalaisamy, Avadhut Naik,
Santhanakrishnan Balraj, Brian Mak
From: Georgi Vlaev <gvlaev@juniper.net>
Add a PMBus driver for the Analog Devices MAX16545 and MAX16550, and the
Volterra VT7505 controllers. The driver reports input/output voltage,
input/output current, input power and temperature over PMBus. All values
use the direct data format. Peak input voltage, output voltage, output
current, input power and temperature readings are exposed and can be
reset.
The reported current and power depend on the external current-report
resistor connected to the ILOAD pin, which can be provided through the
"adi,rload-ohms" device tree property.
On the MAX16550 and VT7505, the severe-OCP deglitch time can optionally
be configured with the "adi,ocp-severe-filter-us" device tree property.
When omitted, the existing hardware setting is left unchanged.
Signed-off-by: Georgi Vlaev <gvlaev@juniper.net>
Co-developed-by: Dhruva Devineni <ddevineni@juniper.net>
Signed-off-by: Dhruva Devineni <ddevineni@juniper.net>
Co-developed-by: Debjit Ghosh <dghosh@juniper.net>
Signed-off-by: Debjit Ghosh <dghosh@juniper.net>
Co-developed-by: JawaharBalaji Thirumalaisamy <jawaharb@juniper.net>
Signed-off-by: JawaharBalaji Thirumalaisamy <jawaharb@juniper.net>
Co-developed-by: Avadhut Naik <avadhutn@juniper.net>
Signed-off-by: Avadhut Naik <avadhutn@juniper.net>
Co-developed-by: Santhanakrishnan Balraj <sbalraj@juniper.net>
Signed-off-by: Santhanakrishnan Balraj <sbalraj@juniper.net>
Co-developed-by: Brian Mak <makb@juniper.net>
Signed-off-by: Brian Mak <makb@juniper.net>
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
---
Changes in v3:
- Use per-device match data instead of an enum (no zero-valued match
data); derive the temperature coefficients and severe-OCP filter
support from it.
- Add an explicit adi,max16545 match entry and drop the compatible-string
check in probe.
- Use designated initializers for the I2C device ID table.
- Replace the SPDX-FileCopyrightText tag with a plain copyright line.
Changes in v2:
- Map the microsecond adi,ocp-severe-filter-us value to the
MFR_CONFIG[15:14] register field.
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/vt7505.rst | 89 +++++++++++
MAINTAINERS | 8 +
drivers/hwmon/pmbus/Kconfig | 9 ++
drivers/hwmon/pmbus/Makefile | 1 +
drivers/hwmon/pmbus/vt7505.c | 284 +++++++++++++++++++++++++++++++++
6 files changed, 392 insertions(+)
create mode 100644 Documentation/hwmon/vt7505.rst
create mode 100644 drivers/hwmon/pmbus/vt7505.c
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index 956f3da0b7223..62687bb994ac1 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -281,6 +281,7 @@ Hardware Monitoring Kernel Drivers
vexpress
via686a
vt1211
+ vt7505
w83627ehf
w83627hf
w83773g
diff --git a/Documentation/hwmon/vt7505.rst b/Documentation/hwmon/vt7505.rst
new file mode 100644
index 0000000000000..e56dc0055e89f
--- /dev/null
+++ b/Documentation/hwmon/vt7505.rst
@@ -0,0 +1,89 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver vt7505
+====================
+
+Supported chips:
+
+ * Analog Devices MAX16545
+
+ Prefix: 'max16545'
+
+ Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max16545b-max16545c.pdf
+
+ * Analog Devices MAX16550
+
+ Prefix: 'max16550'
+
+ Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/max16550.pdf
+
+ * Volterra VT7505
+
+ Prefix: 'vt7505'
+
+ Datasheet: Not publicly available; register-compatible with the MAX16545.
+
+Author: Georgi Vlaev <gvlaev@juniper.net>
+
+Description
+-----------
+
+This driver supports hardware monitoring for the Analog Devices MAX16545 and
+MAX16550, and the Volterra VT7505 PMBus controllers.
+
+The devices report input and output voltage, input and output current,
+input power, and temperature. All values use the PMBus direct data format.
+Peak (maximum) values for input voltage, output voltage, output current,
+input power and temperature are exposed and can be reset. Writing to any
+``*_reset_history`` attribute clears all of the device's peak values.
+
+The reported current and power values depend on the resistance of the
+external current-report resistor connected between the ILOAD pin and
+ground. This resistance can be provided via the ``adi,rload-ohms``
+device tree property; a default of 4750 ohms is used when it is absent.
+
+Sysfs entries
+-------------
+
+The limit and alarm attributes are created by the PMBus core for the limit
+registers that the device implements. See
+Documentation/hwmon/sysfs-interface.rst for the meaning of each attribute.
+
+======================= ========================================================
+in1_label "vin"
+in1_input Measured input voltage.
+in1_min Input undervoltage warning limit.
+in1_min_alarm Input undervoltage warning alarm.
+in1_lcrit Input undervoltage fault limit.
+in1_lcrit_alarm Input undervoltage fault alarm.
+in1_highest Historical maximum input voltage.
+in1_reset_history Write to reset all peak values.
+in2_label "vout1"
+in2_input Measured output voltage.
+in2_min Output undervoltage warning limit.
+in2_min_alarm Output undervoltage warning alarm.
+in2_highest Historical maximum output voltage.
+in2_reset_history Write to reset all peak values.
+curr1_label "iin"
+curr1_input Measured input current.
+curr1_alarm Input current alarm.
+curr2_label "iout1"
+curr2_input Measured output current.
+curr2_max Output overcurrent warning limit.
+curr2_max_alarm Output overcurrent warning alarm.
+curr2_highest Historical maximum output current.
+curr2_reset_history Write to reset all peak values.
+power1_label "pin"
+power1_input Measured input power.
+power1_max Input overpower warning limit.
+power1_alarm Input overpower warning alarm.
+power1_input_highest Historical maximum input power.
+power1_reset_history Write to reset all peak values.
+temp1_input Measured temperature.
+temp1_max Overtemperature warning limit.
+temp1_max_alarm Overtemperature warning alarm.
+temp1_crit Overtemperature fault limit.
+temp1_crit_alarm Overtemperature fault alarm.
+temp1_highest Historical maximum temperature.
+temp1_reset_history Write to reset all peak values.
+======================= ========================================================
diff --git a/MAINTAINERS b/MAINTAINERS
index d88c0dd4c8142..b914aafb8514c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -28958,6 +28958,14 @@ S: Maintained
F: Documentation/hwmon/vt1211.rst
F: drivers/hwmon/vt1211.c
+VT7505 HARDWARE MONITOR DRIVER
+M: Sanman Pradhan <psanman@juniper.net>
+L: linux-hwmon@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
+F: Documentation/hwmon/vt7505.rst
+F: drivers/hwmon/pmbus/vt7505.c
+
VT8231 HARDWARE MONITOR DRIVER
M: Roger Lucas <vt8231@hiddenengine.co.uk>
L: linux-hwmon@vger.kernel.org
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index ca312be58ed5c..6c97a6dc88a59 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -795,6 +795,15 @@ config SENSORS_UCD9200
This driver can also be built as a module. If so, the module will
be called ucd9200.
+config SENSORS_VT7505
+ tristate "Analog Devices MAX16545, MAX16550 and Volterra VT7505"
+ help
+ If you say yes here you get hardware monitoring support for Analog
+ Devices MAX16545, MAX16550 and Volterra VT7505 PMBus controllers.
+
+ This driver can also be built as a module. If so, the module will
+ be called vt7505.
+
config SENSORS_XDP710
tristate "Infineon XDP710 family"
help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index 080d366809f32..daa4b49bc90fd 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -75,6 +75,7 @@ obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o
obj-$(CONFIG_SENSORS_TPS546D24) += tps546d24.o
obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o
obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o
+obj-$(CONFIG_SENSORS_VT7505) += vt7505.o
obj-$(CONFIG_SENSORS_XDP710) += xdp710.o
obj-$(CONFIG_SENSORS_XDP720) += xdp720.o
obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o
diff --git a/drivers/hwmon/pmbus/vt7505.c b/drivers/hwmon/pmbus/vt7505.c
new file mode 100644
index 0000000000000..c60f849e1f9ea
--- /dev/null
+++ b/drivers/hwmon/pmbus/vt7505.c
@@ -0,0 +1,284 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Hardware monitoring driver for Analog Devices MAX16545/MAX16550 and
+ * Volterra VT7505 PMBus controllers.
+ *
+ * Copyright 2026 Hewlett Packard Enterprise Development LP
+ */
+
+#include <linux/bitfield.h>
+#include <linux/i2c.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/pmbus.h>
+
+#include "pmbus.h"
+
+#define VT7505_MFR_CONFIG 0xd0
+#define VT7505_CFG_OCP_S_FILT_MASK GENMASK(15, 14)
+
+#define VT7505_MFR_PEAK_VIN 0xd1
+#define VT7505_MFR_PEAK_IOUT 0xd2
+#define VT7505_MFR_PEAK_PIN 0xd3
+#define VT7505_MFR_PEAK_TEMP 0xd4
+#define VT7505_MFR_CLEAR_PEAKS 0xd5
+#define VT7505_MFR_PEAK_VOUT 0xfd
+
+#define VT7505_RLOAD_DEFAULT 4750
+
+struct vt7505_chip_data {
+ int temp_m;
+ int temp_b;
+ bool has_ocp_filter;
+};
+
+static const struct vt7505_chip_data max16545_data = {
+ .temp_m = 205,
+ .temp_b = 6545,
+};
+
+static const struct vt7505_chip_data max16550_data = {
+ .temp_m = 199,
+ .temp_b = 7046,
+ .has_ocp_filter = true,
+};
+
+static const struct vt7505_chip_data vt7505_data = {
+ .temp_m = 205,
+ .temp_b = 6545,
+ .has_ocp_filter = true,
+};
+
+static int vt7505_read_word_data(struct i2c_client *client, int page,
+ int phase, int reg)
+{
+ switch (reg) {
+ case PMBUS_VIRT_READ_VIN_MAX:
+ return pmbus_read_word_data(client, page, phase,
+ VT7505_MFR_PEAK_VIN);
+ case PMBUS_VIRT_READ_IOUT_MAX:
+ return pmbus_read_word_data(client, page, phase,
+ VT7505_MFR_PEAK_IOUT);
+ case PMBUS_VIRT_READ_PIN_MAX:
+ return pmbus_read_word_data(client, page, phase,
+ VT7505_MFR_PEAK_PIN);
+ case PMBUS_VIRT_READ_TEMP_MAX:
+ return pmbus_read_word_data(client, page, phase,
+ VT7505_MFR_PEAK_TEMP);
+ case PMBUS_VIRT_READ_VOUT_MAX:
+ return pmbus_read_word_data(client, page, phase,
+ VT7505_MFR_PEAK_VOUT);
+ case PMBUS_VIRT_RESET_VIN_HISTORY:
+ case PMBUS_VIRT_RESET_IOUT_HISTORY:
+ case PMBUS_VIRT_RESET_PIN_HISTORY:
+ case PMBUS_VIRT_RESET_TEMP_HISTORY:
+ case PMBUS_VIRT_RESET_VOUT_HISTORY:
+ return 0;
+ default:
+ return -ENODATA;
+ }
+}
+
+static int vt7505_write_word_data(struct i2c_client *client, int page,
+ int reg, u16 word)
+{
+ switch (reg) {
+ /*
+ * A single reset command clears all peak values. CLEAR_PEAKS is a
+ * send-byte command; the device NAKs a word or byte-data write to it.
+ */
+ case PMBUS_VIRT_RESET_VIN_HISTORY:
+ case PMBUS_VIRT_RESET_IOUT_HISTORY:
+ case PMBUS_VIRT_RESET_PIN_HISTORY:
+ case PMBUS_VIRT_RESET_TEMP_HISTORY:
+ case PMBUS_VIRT_RESET_VOUT_HISTORY:
+ return pmbus_write_byte(client, page,
+ VT7505_MFR_CLEAR_PEAKS);
+ default:
+ return -ENODATA;
+ }
+}
+
+/*
+ * None of these controllers implement the standard PMBus WRITE_PROTECT
+ * (0x10) register, so tell the core not to access it.
+ */
+static struct pmbus_platform_data vt7505_pdata = {
+ .flags = PMBUS_NO_WRITE_PROTECT,
+};
+
+static int vt7505_set_ocp_filter(struct i2c_client *client)
+{
+ u32 ocp_us;
+ u8 field;
+ int ret;
+ u16 word;
+
+ if (of_property_read_u32(client->dev.of_node, "adi,ocp-severe-filter-us",
+ &ocp_us))
+ return 0;
+
+ switch (ocp_us) {
+ case 0:
+ field = 0;
+ break;
+ case 1:
+ field = 1;
+ break;
+ case 2:
+ field = 2;
+ break;
+ case 10:
+ field = 3;
+ break;
+ default:
+ return dev_err_probe(&client->dev, -EINVAL,
+ "invalid adi,ocp-severe-filter-us value %u\n",
+ ocp_us);
+ }
+
+ ret = i2c_smbus_read_word_data(client, VT7505_MFR_CONFIG);
+ if (ret < 0)
+ return dev_err_probe(&client->dev, ret,
+ "failed to read MFR_CONFIG\n");
+
+ word = ret & ~VT7505_CFG_OCP_S_FILT_MASK;
+ word |= FIELD_PREP(VT7505_CFG_OCP_S_FILT_MASK, field);
+
+ ret = i2c_smbus_write_word_data(client, VT7505_MFR_CONFIG, word);
+ if (ret < 0)
+ return dev_err_probe(&client->dev, ret,
+ "failed to write MFR_CONFIG\n");
+
+ return 0;
+}
+
+static void vt7505_set_m(int *m, u32 rload)
+{
+ u64 val = (u64)*m * rload;
+
+ /* Make sure m fits the s32 type */
+ *m = DIV_ROUND_CLOSEST_ULL(val, 1000);
+}
+
+static int vt7505_probe(struct i2c_client *client)
+{
+ struct device *dev = &client->dev;
+ const struct vt7505_chip_data *chip;
+ struct pmbus_driver_info *info;
+ u32 rload;
+ int ret;
+
+ chip = i2c_get_match_data(client);
+ if (!chip)
+ return -ENODEV;
+
+ info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
+
+ dev->platform_data = &vt7505_pdata;
+
+ /*
+ * The m coefficient used in the direct-format current and power
+ * calculations depends on RLOAD, the external current-report resistor
+ * connected between the ILOAD pin and ground. Use the default value if
+ * none is specified.
+ */
+ if (of_property_read_u32(dev->of_node, "adi,rload-ohms", &rload))
+ rload = VT7505_RLOAD_DEFAULT;
+
+ if (!rload)
+ return dev_err_probe(dev, -EINVAL,
+ "adi,rload-ohms must be non-zero\n");
+
+ info->pages = 1;
+ info->read_word_data = vt7505_read_word_data;
+ info->write_word_data = vt7505_write_word_data;
+
+ info->format[PSC_VOLTAGE_IN] = direct;
+ info->format[PSC_VOLTAGE_OUT] = direct;
+ info->format[PSC_CURRENT_IN] = direct;
+ info->format[PSC_CURRENT_OUT] = direct;
+ info->format[PSC_POWER] = direct;
+ info->format[PSC_TEMPERATURE] = direct;
+
+ /*
+ * Direct data format coefficients from the device datasheet ("PMBus
+ * Equation Parameters"). The current and power m coefficients scale
+ * with RLOAD; vt7505_set_m() applies the 1/1000 factor below, giving
+ * m = 3.824 * RLOAD for current and 0.895 * RLOAD for power. The
+ * temperature coefficients are chip specific (see the chip data).
+ */
+ info->m[PSC_VOLTAGE_IN] = 7578;
+ info->R[PSC_VOLTAGE_IN] = -2;
+ info->m[PSC_VOLTAGE_OUT] = 7578;
+ info->R[PSC_VOLTAGE_OUT] = -2;
+ info->m[PSC_CURRENT_IN] = 3824;
+ info->b[PSC_CURRENT_IN] = -4300;
+ info->R[PSC_CURRENT_IN] = -3;
+ info->m[PSC_CURRENT_OUT] = 3824;
+ info->b[PSC_CURRENT_OUT] = -4300;
+ info->R[PSC_CURRENT_OUT] = -3;
+ info->m[PSC_POWER] = 895;
+ info->b[PSC_POWER] = -9100;
+ info->R[PSC_POWER] = -2;
+
+ vt7505_set_m(&info->m[PSC_CURRENT_IN], rload);
+ vt7505_set_m(&info->m[PSC_CURRENT_OUT], rload);
+ vt7505_set_m(&info->m[PSC_POWER], rload);
+
+ info->m[PSC_TEMPERATURE] = chip->temp_m;
+ info->b[PSC_TEMPERATURE] = chip->temp_b;
+ info->R[PSC_TEMPERATURE] = -2;
+
+ info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT |
+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
+ PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
+ PMBUS_HAVE_IIN | PMBUS_HAVE_PIN;
+
+ /*
+ * The severe OCP deglitch filter is programmable on the MAX16550 and
+ * the VT7505, but fixed on the MAX16545.
+ */
+ if (chip->has_ocp_filter) {
+ ret = vt7505_set_ocp_filter(client);
+ if (ret)
+ return ret;
+ }
+
+ return pmbus_do_probe(client, info);
+}
+
+static const struct i2c_device_id vt7505_id[] = {
+ { .name = "max16545", .driver_data = (kernel_ulong_t)&max16545_data },
+ { .name = "max16550", .driver_data = (kernel_ulong_t)&max16550_data },
+ { .name = "vt7505", .driver_data = (kernel_ulong_t)&vt7505_data },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, vt7505_id);
+
+static const struct of_device_id vt7505_of_match[] = {
+ { .compatible = "adi,max16545", .data = &max16545_data },
+ { .compatible = "adi,max16550", .data = &max16550_data },
+ { .compatible = "adi,vt7505", .data = &vt7505_data },
+ { }
+};
+MODULE_DEVICE_TABLE(of, vt7505_of_match);
+
+static struct i2c_driver vt7505_driver = {
+ .driver = {
+ .name = "vt7505",
+ .of_match_table = vt7505_of_match,
+ },
+ .probe = vt7505_probe,
+ .id_table = vt7505_id,
+};
+module_i2c_driver(vt7505_driver);
+
+MODULE_AUTHOR("Georgi Vlaev <gvlaev@juniper.net>");
+MODULE_DESCRIPTION("PMBus driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
@ 2026-07-24 16:53 ` sashiko-bot
0 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-07-24 16:53 UTC (permalink / raw)
To: Pradhan, Sanman; +Cc: conor+dt, robh, linux-hwmon, devicetree
> From: Sanman Pradhan <psanman@juniper.net>
>
> Add device tree binding documentation for the Analog Devices MAX16545 and
> MAX16550, and the Volterra VT7505 PMBus controllers.
>
> Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724164919.247162-1-sanman.pradhan@hpe.com?part=1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
@ 2026-07-24 16:59 ` sashiko-bot
2026-07-24 17:27 ` Guenter Roeck
2026-07-24 17:53 ` Guenter Roeck
2 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-07-24 16:59 UTC (permalink / raw)
To: Pradhan, Sanman; +Cc: conor+dt, devicetree, linux-hwmon, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The arithmetic calculation in `vt7505_set_m()` can overflow when converting the 64-bit result to a signed 32-bit integer, resulting in a negative or corrupted PMBus coefficient.
--
--- Patch [2]: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505 ---
commit 6d968d4ee814c7e869f893c1177921f54e4e55cd
Author: Georgi Vlaev <gvlaev@juniper.net>
hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
This commit adds a PMBus driver for the MAX16545, MAX16550, and VT7505
controllers. It reports voltage, current, power, and temperature over
PMBus, calculating current and power coefficients based on the
adi,rload-ohms device tree property.
> diff --git a/drivers/hwmon/pmbus/vt7505.c b/drivers/hwmon/pmbus/vt7505.c
> new file mode 100644
> index 0000000000000..c60f849e1f9ea
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/vt7505.c
[ ... ]
> +static void vt7505_set_m(int *m, u32 rload)
> +{
> + u64 val = (u64)*m * rload;
> +
> + /* Make sure m fits the s32 type */
> + *m = DIV_ROUND_CLOSEST_ULL(val, 1000);
[Severity: Medium]
Does this downcast to a signed 32-bit integer safely handle large values of
rload?
If the rload value is sufficiently large, could the result of
DIV_ROUND_CLOSEST_ULL() exceed INT_MAX and silently overflow into a
negative PMBus coefficient?
> +}
> +
> +static int vt7505_probe(struct i2c_client *client)
> +{
> + struct device *dev = &client->dev;
> + const struct vt7505_chip_data *chip;
> + struct pmbus_driver_info *info;
> + u32 rload;
> + int ret;
[ ... ]
> + /*
> + * The m coefficient used in the direct-format current and power
> + * calculations depends on RLOAD, the external current-report resistor
> + * connected between the ILOAD pin and ground. Use the default value if
> + * none is specified.
> + */
> + if (of_property_read_u32(dev->of_node, "adi,rload-ohms", &rload))
> + rload = VT7505_RLOAD_DEFAULT;
> +
> + if (!rload)
> + return dev_err_probe(dev, -EINVAL,
> + "adi,rload-ohms must be non-zero\n");
[Severity: Medium]
Should there be an upper bound validation for rload here?
Because rload is read directly from the device tree and passed to
vt7505_set_m(), an unexpectedly large unbounded value could trigger the
arithmetic overflow mentioned above.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724164919.247162-1-sanman.pradhan@hpe.com?part=2
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
2026-07-24 16:59 ` sashiko-bot
@ 2026-07-24 17:27 ` Guenter Roeck
2026-07-24 17:53 ` Guenter Roeck
2 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2026-07-24 17:27 UTC (permalink / raw)
To: Pradhan, Sanman
Cc: linux-hwmon@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan, Georgi Vlaev, Dhruva Devineni, Debjit Ghosh,
Jawahar Balaji Thirumalaisamy, Avadhut Naik,
Santhanakrishnan Balraj, Brian Mak
On Fri, Jul 24, 2026 at 04:50:00PM +0000, Pradhan, Sanman wrote:
> From: Georgi Vlaev <gvlaev@juniper.net>
>
> Add a PMBus driver for the Analog Devices MAX16545 and MAX16550, and the
> Volterra VT7505 controllers. The driver reports input/output voltage,
> input/output current, input power and temperature over PMBus. All values
> use the direct data format. Peak input voltage, output voltage, output
> current, input power and temperature readings are exposed and can be
> reset.
>
> The reported current and power depend on the external current-report
> resistor connected to the ILOAD pin, which can be provided through the
> "adi,rload-ohms" device tree property.
>
> On the MAX16550 and VT7505, the severe-OCP deglitch time can optionally
> be configured with the "adi,ocp-severe-filter-us" device tree property.
> When omitted, the existing hardware setting is left unchanged.
>
...
> +static void vt7505_set_m(int *m, u32 rload)
> +{
> + u64 val = (u64)*m * rload;
> +
> + /* Make sure m fits the s32 type */
> + *m = DIV_ROUND_CLOSEST_ULL(val, 1000);
The largest possible value of m is 7578. That means that this _will_
overflow if rload >= 283383960 because 283383960 * 7578 / 1000 =
2147483648.88, rounded up to to 2147483649 == 0x80000001.
Please add a range check in the probe function.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
2026-07-24 16:59 ` sashiko-bot
2026-07-24 17:27 ` Guenter Roeck
@ 2026-07-24 17:53 ` Guenter Roeck
2026-07-24 19:42 ` Pradhan, Sanman
2026-07-24 19:59 ` Pradhan, Sanman
2 siblings, 2 replies; 9+ messages in thread
From: Guenter Roeck @ 2026-07-24 17:53 UTC (permalink / raw)
To: Pradhan, Sanman, linux-hwmon@vger.kernel.org
Cc: robh@kernel.org, krzk+dt@kernel.org, krzk@kernel.org,
conor+dt@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, Sanman Pradhan, Debjit Ghosh,
Jawahar Balaji Thirumalaisamy, Santhanakrishnan Balraj, Brian Mak
Hi,
On 7/24/26 09:50, Pradhan, Sanman wrote:
> From: Georgi Vlaev <gvlaev@juniper.net>
>
> Add a PMBus driver for the Analog Devices MAX16545 and MAX16550, and the
> Volterra VT7505 controllers. The driver reports input/output voltage,
> input/output current, input power and temperature over PMBus. All values
> use the direct data format. Peak input voltage, output voltage, output
> current, input power and temperature readings are exposed and can be
> reset.
>
> The reported current and power depend on the external current-report
> resistor connected to the ILOAD pin, which can be provided through the
> "adi,rload-ohms" device tree property.
>
> On the MAX16550 and VT7505, the severe-OCP deglitch time can optionally
> be configured with the "adi,ocp-severe-filter-us" device tree property.
> When omitted, the existing hardware setting is left unchanged.
>
> Signed-off-by: Georgi Vlaev <gvlaev@juniper.net>
> Co-developed-by: Dhruva Devineni <ddevineni@juniper.net>
> Signed-off-by: Dhruva Devineni <ddevineni@juniper.net>
> Co-developed-by: Debjit Ghosh <dghosh@juniper.net>
> Signed-off-by: Debjit Ghosh <dghosh@juniper.net>
> Co-developed-by: JawaharBalaji Thirumalaisamy <jawaharb@juniper.net>
> Signed-off-by: JawaharBalaji Thirumalaisamy <jawaharb@juniper.net>
> Co-developed-by: Avadhut Naik <avadhutn@juniper.net>
> Signed-off-by: Avadhut Naik <avadhutn@juniper.net>
> Co-developed-by: Santhanakrishnan Balraj <sbalraj@juniper.net>
> Signed-off-by: Santhanakrishnan Balraj <sbalraj@juniper.net>
> Co-developed-by: Brian Mak <makb@juniper.net>
> Signed-off-by: Brian Mak <makb@juniper.net>
> Signed-off-by: Sanman Pradhan <psanman@juniper.net>
> ---
I get delivery errors for the following addresses.
ddevineni@juniper.net
gvlaev@juniper.net
avadhutn@juniper.net
meaning they are quite obviously _not_ involved in the patch approval path.
Please drop those addresses. Also, per Documentation/process/submitting-patches.rst:
Any further SoBs (Signed-off-by:'s) following the author's SoB are from
people handling and transporting the patch, but were not involved in its
development. SoB chains should reflect the **real** route a patch took
as it was propagated to the maintainers and ultimately to Linus, with
the first SoB entry signalling primary authorship of a single author.
Does the above SoB sequence really reflect the approval patch for this
patch ?
Thanks,
Guenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 17:53 ` Guenter Roeck
@ 2026-07-24 19:42 ` Pradhan, Sanman
2026-07-24 19:59 ` Pradhan, Sanman
1 sibling, 0 replies; 9+ messages in thread
From: Pradhan, Sanman @ 2026-07-24 19:42 UTC (permalink / raw)
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan, Debjit Ghosh, Jawahar Balaji Thirumalaisamy,
Santhanakrishnan Balraj, Brian Mak
From: Sanman Pradhan <psanman@juniper.net>
On Fri, Jul 24, 2026 at 10:53:36 -0700, Guenter Roeck wrote:
> I get delivery errors for the following addresses.
> ddevineni@juniper.net
> gvlaev@juniper.net
> avadhutn@juniper.net
>
> meaning they are quite obviously _not_ involved in the patch approval
> path. Please drop those addresses. Also, per
> Documentation/process/submitting-patches.rst:
>
> Any further SoBs (Signed-off-by:'s) following the author's SoB are
> from people handling and transporting the patch, but were not
> involved in its development. SoB chains should reflect the **real**
> route a patch took as it was propagated to the maintainers and
> ultimately to Linus, with the first SoB entry signalling primary
> authorship of a single author.
>
> Does the above SoB sequence really reflect the approval patch for this
> patch ?
Thank you for the review.
Just to clarify the sign-off history, this driver consolidates work
from several internal commits developed by multiple contributors over a
number of years. Each Signed-off-by line was carried over from the
contributor's original commit, where they signed off on their own work
I did not add any sign-offs on their behalf.
The contributions were roughly as follows:
* Georgi Vlaev: original driver
* Dhruva Devineni: MAX16550 support
* Debjit Ghosh: MAX16545 support and device-specific data
* Santhanakrishnan Balraj: severe-OCP filter
* Avadhut Naik and JawaharBalaji Thirumalaisamy: device-tree probing
* Brian Mak: fixes
Some of these contributors have since left the company, so their
juniper.net addresses now bounce. I've removed those addresses from
the recipient list to avoid further delivery errors.
My intention in retaining the Co-developed-by and Signed-off-by lines
was to preserve the original authorship and sign-off history. However,
I'm happy to adjust the attribution chain if there is a preferred way
to handle contributors whose email addresses are no longer active.
Thank you.
Regards,
Sanman Pradhan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
2026-07-24 17:53 ` Guenter Roeck
2026-07-24 19:42 ` Pradhan, Sanman
@ 2026-07-24 19:59 ` Pradhan, Sanman
1 sibling, 0 replies; 9+ messages in thread
From: Pradhan, Sanman @ 2026-07-24 19:59 UTC (permalink / raw)
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
krzk@kernel.org, conor+dt@kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Sanman Pradhan, Debjit Ghosh, Jawahar Balaji Thirumalaisamy,
Santhanakrishnan Balraj, Brian Mak
From: Sanman Pradhan <psanman@juniper.net>
I think my ordering on the trailer in v4 should be changed,
I'll restructure the sign-off chain so that co-developers are
attributed before the primary author, rather than after, which
should better reflect the development history rather than the
transport path:
Co-developed-by: <co-developer>
Signed-off-by: <co-developer>
... (one pair per co-developer)
Signed-off-by: Georgi Vlaev (primary author)
Signed-off-by: Sanman Pradhan (submitter)
Please let me know if you'd prefer a different arrangement.
Thank you.
Regards,
Sanman Pradhan
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-07-24 19:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 16:49 [PATCH v3 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
2026-07-24 16:49 ` [PATCH v3 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
2026-07-24 16:53 ` sashiko-bot
2026-07-24 16:50 ` [PATCH v3 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
2026-07-24 16:59 ` sashiko-bot
2026-07-24 17:27 ` Guenter Roeck
2026-07-24 17:53 ` Guenter Roeck
2026-07-24 19:42 ` Pradhan, Sanman
2026-07-24 19:59 ` Pradhan, Sanman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox