All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver
@ 2026-07-23 16:43 Pradhan, Sanman
  2026-07-23 16:43 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
  2026-07-23 16:43 ` [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
  0 siblings, 2 replies; 6+ messages in thread
From: Pradhan, Sanman @ 2026-07-23 16:43 UTC (permalink / raw)
  To: linux-hwmon@vger.kernel.org
  Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@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 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      |  82 ++++++
 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                  | 274 ++++++++++++++++++
 7 files changed, 464 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] 6+ messages in thread

* [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505
  2026-07-23 16:43 [PATCH v2 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
@ 2026-07-23 16:43 ` Pradhan, Sanman
  2026-07-23 16:54   ` sashiko-bot
  2026-07-23 16:43 ` [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
  1 sibling, 1 reply; 6+ messages in thread
From: Pradhan, Sanman @ 2026-07-23 16:43 UTC (permalink / raw)
  To: linux-hwmon@vger.kernel.org
  Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@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 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      | 82 +++++++++++++++++++
 1 file changed, 82 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 000000000000..6096e03cb80a
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml
@@ -0,0 +1,82 @@
+# 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 current-report resistor connected
+      between the ILOAD pin and ground. It is used to scale the reported
+      input and output current and 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.
+    enum: [0, 1, 2, 10]
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+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
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@40 {
+            compatible = "adi,vt7505";
+            reg = <0x40>;
+            adi,rload-ohms = <4750>;
+        };
+    };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
  2026-07-23 16:43 [PATCH v2 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
  2026-07-23 16:43 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
@ 2026-07-23 16:43 ` Pradhan, Sanman
  2026-07-23 17:00   ` sashiko-bot
  1 sibling, 1 reply; 6+ messages in thread
From: Pradhan, Sanman @ 2026-07-23 16:43 UTC (permalink / raw)
  To: linux-hwmon@vger.kernel.org
  Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@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.

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 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   | 274 +++++++++++++++++++++++++++++++++
 6 files changed, 382 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 956f3da0b722..62687bb994ac 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 000000000000..e56dc0055e89
--- /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 d88c0dd4c814..b914aafb8514 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 ca312be58ed5..6c97a6dc88a5 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 080d366809f3..daa4b49bc90f 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 000000000000..a96abf75b1aa
--- /dev/null
+++ b/drivers/hwmon/pmbus/vt7505.c
@@ -0,0 +1,274 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Hardware monitoring driver for Analog Devices MAX16545/MAX16550 and
+ * Volterra VT7505 PMBus controllers.
+ *
+ * SPDX-FileCopyrightText: Copyright 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
+
+enum chips { max16550, vt7505 };
+
+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;
+	struct pmbus_driver_info *info;
+	enum chips chip;
+	u32 rload;
+	int ret;
+
+	chip = (enum chips)(unsigned long)i2c_get_match_data(client);
+
+	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 switch below).
+	 */
+	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);
+
+	switch (chip) {
+	case max16550:
+		info->m[PSC_TEMPERATURE] = 199;
+		info->b[PSC_TEMPERATURE] = 7046;
+		info->R[PSC_TEMPERATURE] = -2;
+		break;
+	case vt7505:
+		info->m[PSC_TEMPERATURE] = 205;
+		info->b[PSC_TEMPERATURE] = 6545;
+		info->R[PSC_TEMPERATURE] = -2;
+		break;
+	default:
+		return -ENODEV;
+	}
+
+	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. The MAX16545 shares match data
+	 * with the VT7505 (its fallback compatible), so identify it by its
+	 * compatible string and skip the programming there.
+	 */
+	if (chip == max16550 ||
+	    !of_device_is_compatible(dev->of_node, "adi,max16545")) {
+		ret = vt7505_set_ocp_filter(client);
+		if (ret)
+			return ret;
+	}
+
+	return pmbus_do_probe(client, info);
+}
+
+static const struct i2c_device_id vt7505_id[] = {
+	{ "max16545", vt7505 },
+	{ "max16550", max16550 },
+	{ "vt7505", vt7505 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, vt7505_id);
+
+static const struct of_device_id vt7505_of_match[] = {
+	{ .compatible = "adi,max16550", .data = (void *)max16550 },
+	{ .compatible = "adi,vt7505", .data = (void *)vt7505 },
+	{ }
+};
+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] 6+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505
  2026-07-23 16:43 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
@ 2026-07-23 16:54   ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-07-23 16:54 UTC (permalink / raw)
  To: Pradhan, Sanman; +Cc: robh, devicetree, conor+dt, linux-hwmon

> 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/20260723164249.199442-1-sanman.pradhan@hpe.com?part=1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
  2026-07-23 16:43 ` [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
@ 2026-07-23 17:00   ` sashiko-bot
  2026-07-23 21:30     ` Pradhan, Sanman
  0 siblings, 1 reply; 6+ messages in thread
From: sashiko-bot @ 2026-07-23 17:00 UTC (permalink / raw)
  To: Pradhan, Sanman; +Cc: robh, conor+dt, devicetree, linux-hwmon

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `i2c_device_id` array does not use named (designated) initializers, violating I2C subsystem guidelines.
--

--- Patch [2]: [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505 ---
commit 909ee10f8fd3e9cdfd9644221cb8eccdd4ef2cb0
Author: Georgi Vlaev <gvlaev@juniper.net>

hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505

This commit adds a PMBus hardware monitoring driver for the Analog Devices
MAX16545, MAX16550, and Volterra VT7505 controllers. It supports reporting
and clearing peak values for voltage, current, power, and temperature.

> diff --git a/drivers/hwmon/pmbus/vt7505.c b/drivers/hwmon/pmbus/vt7505.c
> new file mode 100644
> index 0000000000000..a96abf75b1aad
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/vt7505.c
[ ... ]
> +static const struct i2c_device_id vt7505_id[] = {
> +	{ "max16545", vt7505 },
> +	{ "max16550", max16550 },
> +	{ "vt7505", vt7505 },
> +	{ }
> +};

[Severity: Low]
Could these array entries be updated to use named (designated) initializers?
The I2C subsystem guidelines recommend using named initializers for arrays of
type struct i2c_device_id to maintain uniformity and prevent field
misalignment.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260723164249.199442-1-sanman.pradhan@hpe.com?part=2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for Analog Devices MAX16545/MAX16550 and Volterra VT7505
  2026-07-23 17:00   ` sashiko-bot
@ 2026-07-23 21:30     ` Pradhan, Sanman
  0 siblings, 0 replies; 6+ messages in thread
From: Pradhan, Sanman @ 2026-07-23 21:30 UTC (permalink / raw)
  To: sashiko-reviews@lists.linux.dev
  Cc: linux-hwmon@vger.kernel.org, linux@roeck-us.net, robh@kernel.org,
	krzk+dt@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>

On Thu, Jul 23, 2026 at 17:00:21 +0000, sashiko-bot@kernel.org wrote:
> > +static const struct i2c_device_id vt7505_id[] = {
> > +	{ "max16545", vt7505 },
> > +	{ "max16550", max16550 },
> > +	{ "vt7505", vt7505 },
> > +	{ }
> > +};
>
> [Severity: Low]
> Could these array entries be updated to use named (designated) initializers?
> The I2C subsystem guidelines recommend using named initializers for arrays of
> type struct i2c_device_id to maintain uniformity and prevent field
> misalignment.

Thanks for the suggestion. I think the current initialization is valid
across existing drivers for i2c_device_id.

Since this looks like more of a style change, I can incorporate the
designated initializers if another revision of the series becomes necessary.

Thank you.

Regards,
Sanman Pradhan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-23 21:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 16:43 [PATCH v2 0/2] hwmon: (pmbus) Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 driver Pradhan, Sanman
2026-07-23 16:43 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus: Add Analog Devices MAX16545/MAX16550 and Volterra VT7505 Pradhan, Sanman
2026-07-23 16:54   ` sashiko-bot
2026-07-23 16:43 ` [PATCH v2 2/2] hwmon: (pmbus/vt7505) Add driver for " Pradhan, Sanman
2026-07-23 17:00   ` sashiko-bot
2026-07-23 21:30     ` Pradhan, Sanman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.