Skip to contentSkip to conversation

add support for Delta E50SN12051

PATCH Superseded Colin Huang 3 participants 8 messages Apr 30

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover add support for Delta E50SN12051

Delta E50SN12051 is a 600W non-isolated 1/8th brick DC-DC power module. With this series applied, voltage, current and temperature sensors can be exposed through the standard hwmon interface.

Changes in this series:
- Introduce device-tree binding documentation for the new device
- Add hwmon documentation describing the supported sensors
- Add PMBus driver support for Delta E50SN12051

---
Changes in v3:
- Simplify to pass &e50sn12051_info directly to pmbus_do_probe()
to avoid the extra memory allocation
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Add %YAML 1.2 declaration in binding document.
- Use a generic node name in examples in binding document.
- Add MODULE_IMPORT_NS("PMBUS")
- Remove unused / incorrect headers
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Colin Huang (3):
dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding Documentation/hwmon: add Delta E50SN12051 documentation
hwmon: (pmbus) add support for Delta E50SN12051

 .../bindings/hwmon/pmbus/delta,e50sn12051.yaml     | 41 +++++++++++
 Documentation/hwmon/e50sn12051.rst                 | 81 ++++++++++++++++++++++
 Documentation/hwmon/index.rst                      |  1 +
 drivers/hwmon/pmbus/Kconfig                        |  9 +++
 drivers/hwmon/pmbus/Makefile                       |  1 +
 drivers/hwmon/pmbus/e50sn12051.c                   | 52 ++++++++++++++
 6 files changed, 185 insertions(+)

---
base-commit: b584e7d50af502462349910bf4ed30057620b69f
change-id: 20260316-add-e50sn12051-ad828ad6777a

Best regards,

Signature · 1 line
Colin Huang <[email protected]>
#1 lore raw

PATCH v3 1/3 dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding

Add devicetree binding documentation for the Delta E50SN12051 PMBus-compliant device.

---
 .../bindings/hwmon/pmbus/delta,e50sn12051.yaml     | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +41 -0
new file mode 100644
index 000000000000..ea7b6d001d66
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/pmbus/delta,e50sn12051.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Delta E50SN12051 PMBus Sensor
+
+maintainers:
+  - Kevin Chang <[email protected]>
+
+description: |
+  This binding describes the Delta E50SN12051 PMBus sensor.
+  The driver supports reading voltage, current, and temperature
+  using the PMBus interface.
+
+properties:
+  compatible:
+    const: delta,e50sn12051
+
+  reg:
+    maxItems: 1
+    description: I2C bus address of the PMBus device
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hwmon@40 {
+            compatible = "delta,e50sn12051";
+            reg = <0x40>;
+        };
+    };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 1/3] dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] The binding description violates Devicetree principles by describing software instead of hardware.…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The binding description violates Devicetree principles by describing software instead of hardware. It explicitly states 'The driver supports...', which is an OS-specific software description.
- [Low] The Devicetree example uses the Linux-specific subsystem name 'hwmon@40' for the node name instead of a generic functional name.
--

commit 8f686eaa80cf8986d09fe9ea7dca7debf1c51cb1
Author: Colin Huang <[email protected]>

dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding

This commit introduces the devicetree binding schema for the Delta E50SN12051 PMBus-compliant sensor.

Quoted 3 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +0 -0

[ ... ]

Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml line 15

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +4 -0
+description: |
+  This binding describes the Delta E50SN12051 PMBus sensor.
+  The driver supports reading voltage, current, and temperature
+  using the PMBus interface.

This isn't a bug, but should the description focus purely on the hardware rather than mentioning what the driver supports? Devicetree bindings are generally expected to be OS-agnostic hardware descriptions.

[ ... ]

Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml line 37

Quoted 7 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +7 -0
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hwmon@40 {

Is hwmon@40 the most appropriate node name here? The devicetree specification usually recommends using generic names that reflect the function of the hardware, such as sensor@40, rather than OS-specific subsystem names like hwmon.

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +4 -0
+            compatible = "delta,e50sn12051";
+            reg = <0x40>;
+        };
+    };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#3 lore raw

Re: [PATCH v3 1/3] dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding

Quoted 17 lines · On 4/29/26 23:59, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The binding description violates Devicetree principles by describing software instead of hardware. It explicitly states 'The driver supports...', which is an OS-specific software description.
- [Low] The Devicetree example uses the Linux-specific subsystem name 'hwmon@40' for the node name instead of a generic functional name.
--

commit 8f686eaa80cf8986d09fe9ea7dca7debf1c51cb1
Author: Colin Huang <[email protected]>

dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding

This commit introduces the devicetree binding schema for the Delta E50SN12051 PMBus-compliant sensor.

Quoted 3 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +0 -0

[ ... ]

Quoted 8 lines

Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml line 15

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +4 -0
+description: |
+  This binding describes the Delta E50SN12051 PMBus sensor.
+  The driver supports reading voltage, current, and temperature
+  using the PMBus interface.

This isn't a bug, but should the description focus purely on the hardware rather than mentioning what the driver supports? Devicetree bindings are generally expected to be OS-agnostic hardware descriptions.

I am not a devicetree maintainer, but I agree.

Guenter

Quoted 20 lines

[ ... ]

Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml line 37

Quoted 7 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +7 -0
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hwmon@40 {

Is hwmon@40 the most appropriate node name here? The devicetree specification usually recommends using generic names that reflect the function of the hardware, such as sensor@40, rather than OS-specific subsystem names like hwmon.

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/pmbus/delta,e50sn12051.yaml new file +4 -0
+            compatible = "delta,e50sn12051";
+            reg = <0x40>;
+        };
+    };
#4 lore raw

PATCH v3 2/3 Documentation/hwmon: add Delta E50SN12051 documentation

In reply to Colin Huang

Document the hardware monitoring support for the Delta E50SN12051 device.

The documentation describes the supported sensors exposed via the hwmon subsystem, including voltage, current, and temperature measurements.

---
 Documentation/hwmon/e50sn12051.rst | 81 ++++++++++++++++++++++++++++++++++++++
 Documentation/hwmon/index.rst      |  1 +
 2 files changed, 82 insertions(+)
Documentation/hwmon/e50sn12051.rst new file +81 -0
new file mode 100644
index 000000000000..cbbfa7895d82
@@ -0,0 +1,81 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Kernel driver e50sn12051
+========================
+
+Supported chips:
+
+  * Delta E50SN12051
+
+    Prefix: 'e50sn12051'
+
+    Addresses scanned: -
+
+    Datasheet:
+
+      Provided by Delta upon request and NDA
+
+Description
+-----------
+
+E50SN12051 is a 600W non-isolated 1/8th brick DC-DC power module.
+
+This driver supports the E50SN12051 PMBus compliant monitor device.
+
+The device provides measurements for:
+
+* Input voltage
+* Output current
+* Output voltage
+* Temperature
+
+The driver is based on the PMBus core and exposes standard hwmon
+sysfs attributes.
+
+Sysfs attributes
+----------------
+
+======================= =======================================================
+curr1_label             "iout1"
+curr1_crit              Critical maximum current.
+                        From IOUT_OC_FAULT_LIMIT register.
+curr1_crit_alarm        Current critical high alarm.
+                        From IOUT_OC_FAULT status.
+curr1_input             Measured current.
+                        From READ_IOUT register.
+curr1_max               Maximum current.
+                        From IOUT_OC_WARN_LIMIT register.
+curr1_max_alarm         Current high alarm.
+                        From IOUT_OC_WARN_LIMIT status.
+
+in1_label               "vin"
+in1_alarm               Input voltage alarm.
+in1_input               Measured voltage.
+                        From READ_VIN register.
+
+in2_label               "vout1"
+in2_crit                Critical maximum voltage.
+                        From VOUT_OV_FAULT_LIMIT register.
+in2_crit_alarm          Voltage critical high alarm.
+                        From VOLTAGE_OV_FAULT status.
+in2_input               Measured voltage.
+                        From READ_VOUT register.
+in2_max                 Maximum voltage.
+                        From VOUT_OV_WARN_LIMIT register.
+in2_max_alarm           Voltage high alarm.
+                        From VOLTAGE_OV_WARNING status.
+
+temp1_crit              Critical high temperature.
+                        From OT_FAULT_LIMIT register.
+temp1_crit_alarm        Module temperature critical high alarm.
+                        Set by comparing READ_TEMPERATURE_1 with OT_FAULT_LIMIT
+                        if TEMP_OT_FAULT status is set.
+temp1_input             Measured module's hot spot temperature.
+                        From READ_TEMPERATURE_1 register.
+temp1_max               Maximum temperature.
+                        From OT_WARN_LIMIT register.
+temp1_max_alarm         Module temperature high alarm.
+                        Set by comparing READ_TEMPERATURE_1 with OT_WARN_LIMIT if
+                        TEMP_OT_WARNING status is set.
+======================= =======================================================
+
Documentation/hwmon/index.rst +1 -0
index 8b655e5d6b68..ba08655fc496 100644
@@ -68,6 +68,7 @@ Hardware Monitoring Kernel Drivers
    drivetemp
    ds1621
    ds620
+   e50sn12051
    emc1403
    emc2103
    emc2305
Signature · 1 line
2.34.1
maintainer Reviewed-by on v3 2/3
#5 lore raw

Re: [PATCH v3 2/3] Documentation/hwmon: add Delta E50SN12051 documentation

Quoted 9 lines · On 4/29/26 23:16, Colin Huang via B4 Relay wrote:

From: Colin Huang <[email protected]>

Document the hardware monitoring support for the Delta E50SN12051 device.

The documentation describes the supported sensors exposed via the hwmon subsystem, including voltage, current, and temperature measurements.

For my reference:

Quoted 105 lines
---
  Documentation/hwmon/e50sn12051.rst | 81 ++++++++++++++++++++++++++++++++++++++
  Documentation/hwmon/index.rst      |  1 +
  2 files changed, 82 insertions(+)
Documentation/hwmon/e50sn12051.rst new file +81 -0
new file mode 100644
index 000000000000..cbbfa7895d82
@@ -0,0 +1,81 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Kernel driver e50sn12051
+========================
+
+Supported chips:
+
+  * Delta E50SN12051
+
+    Prefix: 'e50sn12051'
+
+    Addresses scanned: -
+
+    Datasheet:
+
+      Provided by Delta upon request and NDA
+
+Description
+-----------
+
+E50SN12051 is a 600W non-isolated 1/8th brick DC-DC power module.
+
+This driver supports the E50SN12051 PMBus compliant monitor device.
+
+The device provides measurements for:
+
+* Input voltage
+* Output current
+* Output voltage
+* Temperature
+
+The driver is based on the PMBus core and exposes standard hwmon
+sysfs attributes.
+
+Sysfs attributes
+----------------
+
+======================= =======================================================
+curr1_label             "iout1"
+curr1_crit              Critical maximum current.
+                        From IOUT_OC_FAULT_LIMIT register.
+curr1_crit_alarm        Current critical high alarm.
+                        From IOUT_OC_FAULT status.
+curr1_input             Measured current.
+                        From READ_IOUT register.
+curr1_max               Maximum current.
+                        From IOUT_OC_WARN_LIMIT register.
+curr1_max_alarm         Current high alarm.
+                        From IOUT_OC_WARN_LIMIT status.
+
+in1_label               "vin"
+in1_alarm               Input voltage alarm.
+in1_input               Measured voltage.
+                        From READ_VIN register.
+
+in2_label               "vout1"
+in2_crit                Critical maximum voltage.
+                        From VOUT_OV_FAULT_LIMIT register.
+in2_crit_alarm          Voltage critical high alarm.
+                        From VOLTAGE_OV_FAULT status.
+in2_input               Measured voltage.
+                        From READ_VOUT register.
+in2_max                 Maximum voltage.
+                        From VOUT_OV_WARN_LIMIT register.
+in2_max_alarm           Voltage high alarm.
+                        From VOLTAGE_OV_WARNING status.
+
+temp1_crit              Critical high temperature.
+                        From OT_FAULT_LIMIT register.
+temp1_crit_alarm        Module temperature critical high alarm.
+                        Set by comparing READ_TEMPERATURE_1 with OT_FAULT_LIMIT
+                        if TEMP_OT_FAULT status is set.
+temp1_input             Measured module's hot spot temperature.
+                        From READ_TEMPERATURE_1 register.
+temp1_max               Maximum temperature.
+                        From OT_WARN_LIMIT register.
+temp1_max_alarm         Module temperature high alarm.
+                        Set by comparing READ_TEMPERATURE_1 with OT_WARN_LIMIT if
+                        TEMP_OT_WARNING status is set.
+======================= =======================================================
+
Documentation/hwmon/index.rst +1 -0
index 8b655e5d6b68..ba08655fc496 100644
@@ -68,6 +68,7 @@ Hardware Monitoring Kernel Drivers
     drivetemp
     ds1621
     ds620
+   e50sn12051
     emc1403
     emc2103
     emc2305
#6 lore raw

PATCH v3 3/3 hwmon: (pmbus) add support for Delta E50SN12051

In reply to Colin Huang

Add the pmbus driver for Delta E50SN12051 600W Non-isolated 1/8th Brick DCDC Power Modules.

---
 drivers/hwmon/pmbus/Kconfig      |  9 +++++++
 drivers/hwmon/pmbus/Makefile     |  1 +
 drivers/hwmon/pmbus/e50sn12051.c | 52 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
drivers/hwmon/pmbus/Kconfig +9 -0
index 8f4bff375ecb..4fbfcbc4a9c5 100644
@@ -161,6 +161,15 @@ config SENSORS_DPS920AB
 	  This driver can also be built as a module. If so, the module will
 	  be called dps920ab.
 
+config SENSORS_E50SN12051
+	tristate "Delta E50SN12051 Power Modules"
+	help
+	  If you say yes here you get hardware monitoring support for Delta
+	  E50SN12051 Power Modules.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called e50sn12051.
+
 config SENSORS_INA233
 	tristate "Texas Instruments INA233 and compatibles"
 	help
drivers/hwmon/pmbus/Makefile +1 -0
index 7129b62bc00f..fc910bf34fe3 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_SENSORS_FSP_3Y)	+= fsp-3y.o
 obj-$(CONFIG_SENSORS_HAC300S)	+= hac300s.o
 obj-$(CONFIG_SENSORS_IBM_CFFPS)	+= ibm-cffps.o
 obj-$(CONFIG_SENSORS_DPS920AB)	+= dps920ab.o
+obj-$(CONFIG_SENSORS_E50SN12051) += e50sn12051.o
 obj-$(CONFIG_SENSORS_INA233)	+= ina233.o
 obj-$(CONFIG_SENSORS_INSPUR_IPSPS) += inspur-ipsps.o
 obj-$(CONFIG_SENSORS_IR35221)	+= ir35221.o
drivers/hwmon/pmbus/e50sn12051.c new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer Reviewed-by on v3 3/3
#7 lore raw

Re: [PATCH v3 3/3] hwmon: (pmbus) add support for Delta E50SN12051

Quoted 6 lines · On 4/29/26 23:16, Colin Huang via B4 Relay wrote:

From: Colin Huang <[email protected]>

Add the pmbus driver for Delta E50SN12051 600W Non-isolated 1/8th Brick DCDC Power Modules.

For my reference:

Quoted 97 lines
---
  drivers/hwmon/pmbus/Kconfig      |  9 +++++++
  drivers/hwmon/pmbus/Makefile     |  1 +
  drivers/hwmon/pmbus/e50sn12051.c | 52 ++++++++++++++++++++++++++++++++++++++++
  3 files changed, 62 insertions(+)
drivers/hwmon/pmbus/Kconfig +9 -0
index 8f4bff375ecb..4fbfcbc4a9c5 100644
@@ -161,6 +161,15 @@ config SENSORS_DPS920AB
  	  This driver can also be built as a module. If so, the module will
  	  be called dps920ab.
 
+config SENSORS_E50SN12051
+	tristate "Delta E50SN12051 Power Modules"
+	help
+	  If you say yes here you get hardware monitoring support for Delta
+	  E50SN12051 Power Modules.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called e50sn12051.
+
  config SENSORS_INA233
  	tristate "Texas Instruments INA233 and compatibles"
  	help
drivers/hwmon/pmbus/Makefile +1 -0
index 7129b62bc00f..fc910bf34fe3 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_SENSORS_FSP_3Y)	+= fsp-3y.o
  obj-$(CONFIG_SENSORS_HAC300S)	+= hac300s.o
  obj-$(CONFIG_SENSORS_IBM_CFFPS)	+= ibm-cffps.o
  obj-$(CONFIG_SENSORS_DPS920AB)	+= dps920ab.o
+obj-$(CONFIG_SENSORS_E50SN12051) += e50sn12051.o
  obj-$(CONFIG_SENSORS_INA233)	+= ina233.o
  obj-$(CONFIG_SENSORS_INSPUR_IPSPS) += inspur-ipsps.o
  obj-$(CONFIG_SENSORS_IR35221)	+= ir35221.o
drivers/hwmon/pmbus/e50sn12051.c new file +52 -0
new file mode 100644
index 000000000000..efb4d62b2603
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Hardware monitoring driver for E50SN12051
+ */
+
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/mod_devicetable.h>
+#include "pmbus.h"
+
+static struct pmbus_driver_info e50sn12051_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_STATUS_INPUT |
+		   PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
+		   PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
+		   PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP,
+};
+
+static const struct i2c_device_id e50sn12051_id[] = { { "e50sn12051", 0 }, {} };
+MODULE_DEVICE_TABLE(i2c, e50sn12051_id);
+
+static const struct of_device_id e50sn12051_of_match[] = {
+	{ .compatible = "delta,e50sn12051" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, e50sn12051_of_match);
+
+static int e50sn12051_probe(struct i2c_client *client)
+{
+	return pmbus_do_probe(client, &e50sn12051_info);
+}
+
+static struct i2c_driver e50sn12051_driver = {
+	.driver = {
+		.name = "e50sn12051",
+		.of_match_table = e50sn12051_of_match,
+	},
+	.probe = e50sn12051_probe,
+
+	.id_table = e50sn12051_id,
+};
+
+module_i2c_driver(e50sn12051_driver);
+
+MODULE_AUTHOR("Kevin Chang <[email protected]>");
+MODULE_DESCRIPTION("PMBus driver for E50SN12051");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");