public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add support for Infineon Digital eFuse XDP720
@ 2026-04-01 10:45 ASHISH YADAV
  2026-04-01 10:45 ` [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720 ASHISH YADAV
  2026-04-01 10:45 ` [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720 ASHISH YADAV
  0 siblings, 2 replies; 9+ messages in thread
From: ASHISH YADAV @ 2026-04-01 10:45 UTC (permalink / raw)
  To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Ashish Yadav

From: Ashish Yadav <ashish.yadav@infineon.com>

Hi,

These patches add support for Infineon Digital eFuse XDP720.
XDP720 provides accurate system telemetry (V, I, P, T) and
reports analog current at the IMON pin for post-processing.

The Current and Power measurement depends on the RIMON and GIMON values.
Please look into data sheet sections 5.4.2 and 5.4.4 for more details:
https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf

With Best Regards,
 Ashish Yadav
---
Changes in v2:
- Link to v1:
https://lore.kernel.org/all/20260330102345.37065-1-Ashish.Yadav@infineon.com/
- Fix make dt_binding_check issue:
https://patchwork.kernel.org/project/devicetree/patch/20260330102345.37065-2-Ashish.Yadav@infineon.com/
- Address reviews comments for infineon,xdp720.yaml, Kconfig, Makefile and xpe720.c:
https://sashiko.dev/#/patchset/20260330102345.37065-1-Ashish.Yadav%40infineon.com
  It includes fixing of extra space, non-ASCII characters and use spaces
  instead of tabs.
  The xpe720.c driver file update with DIV64_U64_ROUND_CLOSEST() and 
  MODULE_DEVICE_TABLE() as suggested in review comments.
  

Ashish Yadav (2):
  dt-bindings: hwmon/pmbus: Add Infineon XDP720
  hwmon:(pmbus/xdp720) Add support for efuse xdp720

 .../bindings/hwmon/pmbus/infineon,xdp720.yaml |  51 ++++++++
 drivers/hwmon/pmbus/Kconfig                   |   9 ++
 drivers/hwmon/pmbus/Makefile                  |   1 +
 drivers/hwmon/pmbus/xdp720.c                  | 123 ++++++++++++++++++
 4 files changed, 184 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
 create mode 100644 drivers/hwmon/pmbus/xdp720.c

-- 
2.39.5


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

* [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720
  2026-04-01 10:45 [PATCH v2 0/2] Add support for Infineon Digital eFuse XDP720 ASHISH YADAV
@ 2026-04-01 10:45 ` ASHISH YADAV
  2026-04-02  7:44   ` Krzysztof Kozlowski
  2026-04-01 10:45 ` [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720 ASHISH YADAV
  1 sibling, 1 reply; 9+ messages in thread
From: ASHISH YADAV @ 2026-04-01 10:45 UTC (permalink / raw)
  To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Ashish Yadav

From: Ashish Yadav <ashish.yadav@infineon.com>

Add documentation for the device tree binding of the XDP720 eFuse.

Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
---
This patch introduces a YAML schema describing the required and optional
properties for the XDP720 eFuse device node. It includes details on the
compatible string, register mapping, and rimon-micro-ohms(RIMON).

The RIMON resistance is installed between the Imon pin and the ground
reference.
---
 .../bindings/hwmon/pmbus/infineon,xdp720.yaml | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
new file mode 100644
index 000000000000..bbde8ff92ae9
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,xdp720.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Infineon XDP720 Digital eFuse Controller
+
+maintainers:
+  - Ashish Yadav <ashish.yadav@infineon.com>
+
+description: |
+  The XDP720 is an eFuse with integrated current sensor and digital
+  controller. It provides accurate system telemetry (V, I, P, T) and
+  reports analog current at the IMON pin for post-processing.
+
+  Datasheet:
+     https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
+
+properties:
+  compatible:
+    enum:
+      - infineon,xdp720
+
+  reg:
+    maxItems: 1
+
+  infineon,rimon-micro-ohms:
+    description: |
+      The value of the RIMON resistor, in micro ohms, required to enable
+      the system overcurrent protection.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hwmon@11 {
+            compatible = "infineon,xdp720";
+            reg = <0x11>;
+            infineon,rimon-micro-ohms = <1098000000>;  /* 1.098k ohm */
+        };
+    };
-- 
2.39.5


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

* [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720
  2026-04-01 10:45 [PATCH v2 0/2] Add support for Infineon Digital eFuse XDP720 ASHISH YADAV
  2026-04-01 10:45 ` [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720 ASHISH YADAV
@ 2026-04-01 10:45 ` ASHISH YADAV
  2026-04-01 15:56   ` Guenter Roeck
  1 sibling, 1 reply; 9+ messages in thread
From: ASHISH YADAV @ 2026-04-01 10:45 UTC (permalink / raw)
  To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Ashish Yadav

From: Ashish Yadav <ashish.yadav@infineon.com>

Add the pmbus driver for Infineon XDP720 Digital eFuse Controller.

Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
---
XDP720 Digital eFuse Controller provides accurate system telemetry
(V, I, P, T) and reports analog current at the IMON pin for post-processing.

The Current and Power measurement depends on the RIMON and GIMON values.
Please look into data sheet sections 5.4.2 and 5.4.4 for more details:
https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf

The GIMON (microA/A) depends on the 10th bit of TELEMETRY_AVG PMBUS Register.
The value of RIMON (kohm) can be provided by the user through device tree using
infineon,rimon-micro-ohms  property.
---
 drivers/hwmon/pmbus/Kconfig  |   9 +++
 drivers/hwmon/pmbus/Makefile |   1 +
 drivers/hwmon/pmbus/xdp720.c | 123 +++++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+)
 create mode 100644 drivers/hwmon/pmbus/xdp720.c

diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index fc1273abe357..c419e3ecce90 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -702,6 +702,15 @@ config SENSORS_XDP710
 	  This driver can also be built as a module. If so, the module will
 	  be called xdp710.
 
+config SENSORS_XDP720
+	tristate "Infineon XDP720 family"
+	help
+	  If you say yes here you get hardware monitoring support for Infineon
+	  XDP720.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called xdp720.
+
 config SENSORS_XDPE152
 	tristate "Infineon XDPE152 family"
 	help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index d6c86924f887..1cac7ccae79f 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_SENSORS_TPS546D24)	+= tps546d24.o
 obj-$(CONFIG_SENSORS_UCD9000)	+= ucd9000.o
 obj-$(CONFIG_SENSORS_UCD9200)	+= ucd9200.o
 obj-$(CONFIG_SENSORS_XDP710)	+= xdp710.o
+obj-$(CONFIG_SENSORS_XDP720)	+= xdp720.o
 obj-$(CONFIG_SENSORS_XDPE122)	+= xdpe12284.o
 obj-$(CONFIG_SENSORS_XDPE152)	+= xdpe152c4.o
 obj-$(CONFIG_SENSORS_ZL6100)	+= zl6100.o
diff --git a/drivers/hwmon/pmbus/xdp720.c b/drivers/hwmon/pmbus/xdp720.c
new file mode 100644
index 000000000000..382dc3f9ce80
--- /dev/null
+++ b/drivers/hwmon/pmbus/xdp720.c
@@ -0,0 +1,123 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Hardware monitoring driver for Infineon XDP720 Digital eFuse Controller
+ *
+ * Copyright (c) 2026 Infineon Technologies. All rights reserved.
+ */
+
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/of_device.h>
+#include <linux/bitops.h>
+#include <linux/math64.h>
+#include "pmbus.h"
+
+/*
+ * The IMON resistor required to generate the system overcurrent protection.
+ * Arbitrary default Rimon value: 2k Ohm
+ */
+#define XDP720_DEFAULT_RIMON 2000000000 /* 2k ohm */
+#define XDP720_TELEMETRY_AVG 0xE9
+
+static struct pmbus_driver_info xdp720_info = {
+	.pages = 1,
+	.format[PSC_VOLTAGE_IN] = direct,
+	.format[PSC_VOLTAGE_OUT] = direct,
+	.format[PSC_CURRENT_OUT] = direct,
+	.format[PSC_POWER] = direct,
+	.format[PSC_TEMPERATURE] = direct,
+
+	.m[PSC_VOLTAGE_IN] = 4653,
+	.b[PSC_VOLTAGE_IN] = 0,
+	.R[PSC_VOLTAGE_IN] = -2,
+	.m[PSC_VOLTAGE_OUT] = 4653,
+	.b[PSC_VOLTAGE_OUT] = 0,
+	.R[PSC_VOLTAGE_OUT] = -2,
+	/*
+	 * Current and Power measurement depends on the RIMON (kOhm) and
+	 * GIMON(microA/A) values.
+	 */
+	.m[PSC_CURRENT_OUT] = 24668,
+	.b[PSC_CURRENT_OUT] = 0,
+	.R[PSC_CURRENT_OUT] = -4,
+	.m[PSC_POWER] = 4486,
+	.b[PSC_POWER] = 0,
+	.R[PSC_POWER] = -1,
+	.m[PSC_TEMPERATURE] = 54,
+	.b[PSC_TEMPERATURE] = 22521,
+	.R[PSC_TEMPERATURE] = -1,
+
+	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN |
+		   PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_INPUT |
+		   PMBUS_HAVE_STATUS_TEMP,
+};
+
+static int xdp720_probe(struct i2c_client *client)
+{
+	struct pmbus_driver_info *info;
+	int ret;
+	u32 rimon;
+	int gimon;
+
+	info = devm_kmemdup(&client->dev, &xdp720_info, sizeof(*info),
+			    GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
+
+	ret = i2c_smbus_read_word_data(client, XDP720_TELEMETRY_AVG);
+	if (ret < 0) {
+		dev_err(&client->dev, "Can't get TELEMETRY_AVG\n");
+		return ret;
+	}
+
+	ret >>= 10; /* 10th bit of TELEMETRY_AVG REG for GIMON Value */
+	ret &= GENMASK(0, 0);
+	if (ret == 1)
+		gimon = 18200; /* output gain 18.2 microA/A */
+	else
+		gimon = 9100; /* output gain 9.1 microA/A */
+
+	if (of_property_read_u32(client->dev.of_node,
+				 "infineon,rimon-micro-ohms", &rimon))
+		rimon = XDP720_DEFAULT_RIMON; /* Default if not set via DT */
+	if (rimon == 0)
+		return -EINVAL;
+
+	/* Adapt the current and power scale for each instance */
+	info->m[PSC_CURRENT_OUT] = DIV64_U64_ROUND_CLOSEST((u64)
+		info->m[PSC_CURRENT_OUT] * rimon * gimon, 1000000000000);
+	info->m[PSC_POWER] = DIV64_U64_ROUND_CLOSEST((u64)
+		info->m[PSC_POWER] * rimon * gimon, 1000000000000);
+
+	return pmbus_do_probe(client, info);
+}
+
+static const struct of_device_id xdp720_of_match[] = {
+	{ .compatible = "infineon,xdp720" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, xdp720_of_match);
+
+static const struct i2c_device_id xdp720_id[] = {
+	{ "xdp720" },
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, xdp720_id);
+
+static struct i2c_driver xdp720_driver = {
+	.driver = {
+		   .name = "xdp720",
+		   .of_match_table = xdp720_of_match,
+	},
+	.probe = xdp720_probe,
+	.id_table = xdp720_id,
+};
+
+module_i2c_driver(xdp720_driver);
+
+MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
+MODULE_DESCRIPTION("PMBus driver for Infineon XDP720 Digital eFuse Controller");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");
-- 
2.39.5


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

* Re: [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720
  2026-04-01 10:45 ` [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720 ASHISH YADAV
@ 2026-04-01 15:56   ` Guenter Roeck
  2026-04-02 14:09     ` ashish yadav
  0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2026-04-01 15:56 UTC (permalink / raw)
  To: ASHISH YADAV, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Ashish Yadav

Hi,

On 4/1/26 03:45, ASHISH YADAV wrote:
> From: Ashish Yadav <ashish.yadav@infineon.com>
> 
> Add the pmbus driver for Infineon XDP720 Digital eFuse Controller.
> 
> Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
> ---
> XDP720 Digital eFuse Controller provides accurate system telemetry
> (V, I, P, T) and reports analog current at the IMON pin for post-processing.
> 
> The Current and Power measurement depends on the RIMON and GIMON values.
> Please look into data sheet sections 5.4.2 and 5.4.4 for more details:
> https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
> 
> The GIMON (microA/A) depends on the 10th bit of TELEMETRY_AVG PMBUS Register.
> The value of RIMON (kohm) can be provided by the user through device tree using
> infineon,rimon-micro-ohms  property.

Please have a look at

https://sashiko.dev/#/patchset/20260401104550.115715-1-Ashish.Yadav%40infineon.com

Main concern is the power measurement range, but also please use 1000000000000ULL
as suggested.

Thanks,
Guenter

> ---
>   drivers/hwmon/pmbus/Kconfig  |   9 +++
>   drivers/hwmon/pmbus/Makefile |   1 +
>   drivers/hwmon/pmbus/xdp720.c | 123 +++++++++++++++++++++++++++++++++++
>   3 files changed, 133 insertions(+)
>   create mode 100644 drivers/hwmon/pmbus/xdp720.c
> 
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index fc1273abe357..c419e3ecce90 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -702,6 +702,15 @@ config SENSORS_XDP710
>   	  This driver can also be built as a module. If so, the module will
>   	  be called xdp710.
>   
> +config SENSORS_XDP720
> +	tristate "Infineon XDP720 family"
> +	help
> +	  If you say yes here you get hardware monitoring support for Infineon
> +	  XDP720.
> +
> +	  This driver can also be built as a module. If so, the module will
> +	  be called xdp720.
> +
>   config SENSORS_XDPE152
>   	tristate "Infineon XDPE152 family"
>   	help
> diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> index d6c86924f887..1cac7ccae79f 100644
> --- a/drivers/hwmon/pmbus/Makefile
> +++ b/drivers/hwmon/pmbus/Makefile
> @@ -68,6 +68,7 @@ obj-$(CONFIG_SENSORS_TPS546D24)	+= tps546d24.o
>   obj-$(CONFIG_SENSORS_UCD9000)	+= ucd9000.o
>   obj-$(CONFIG_SENSORS_UCD9200)	+= ucd9200.o
>   obj-$(CONFIG_SENSORS_XDP710)	+= xdp710.o
> +obj-$(CONFIG_SENSORS_XDP720)	+= xdp720.o
>   obj-$(CONFIG_SENSORS_XDPE122)	+= xdpe12284.o
>   obj-$(CONFIG_SENSORS_XDPE152)	+= xdpe152c4.o
>   obj-$(CONFIG_SENSORS_ZL6100)	+= zl6100.o
> diff --git a/drivers/hwmon/pmbus/xdp720.c b/drivers/hwmon/pmbus/xdp720.c
> new file mode 100644
> index 000000000000..382dc3f9ce80
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/xdp720.c
> @@ -0,0 +1,123 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Hardware monitoring driver for Infineon XDP720 Digital eFuse Controller
> + *
> + * Copyright (c) 2026 Infineon Technologies. All rights reserved.
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/of_device.h>
> +#include <linux/bitops.h>
> +#include <linux/math64.h>
> +#include "pmbus.h"
> +
> +/*
> + * The IMON resistor required to generate the system overcurrent protection.
> + * Arbitrary default Rimon value: 2k Ohm
> + */
> +#define XDP720_DEFAULT_RIMON 2000000000 /* 2k ohm */
> +#define XDP720_TELEMETRY_AVG 0xE9
> +
> +static struct pmbus_driver_info xdp720_info = {
> +	.pages = 1,
> +	.format[PSC_VOLTAGE_IN] = direct,
> +	.format[PSC_VOLTAGE_OUT] = direct,
> +	.format[PSC_CURRENT_OUT] = direct,
> +	.format[PSC_POWER] = direct,
> +	.format[PSC_TEMPERATURE] = direct,
> +
> +	.m[PSC_VOLTAGE_IN] = 4653,
> +	.b[PSC_VOLTAGE_IN] = 0,
> +	.R[PSC_VOLTAGE_IN] = -2,
> +	.m[PSC_VOLTAGE_OUT] = 4653,
> +	.b[PSC_VOLTAGE_OUT] = 0,
> +	.R[PSC_VOLTAGE_OUT] = -2,
> +	/*
> +	 * Current and Power measurement depends on the RIMON (kOhm) and
> +	 * GIMON(microA/A) values.
> +	 */
> +	.m[PSC_CURRENT_OUT] = 24668,
> +	.b[PSC_CURRENT_OUT] = 0,
> +	.R[PSC_CURRENT_OUT] = -4,
> +	.m[PSC_POWER] = 4486,
> +	.b[PSC_POWER] = 0,
> +	.R[PSC_POWER] = -1,
> +	.m[PSC_TEMPERATURE] = 54,
> +	.b[PSC_TEMPERATURE] = 22521,
> +	.R[PSC_TEMPERATURE] = -1,
> +
> +	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN |
> +		   PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_INPUT |
> +		   PMBUS_HAVE_STATUS_TEMP,
> +};
> +
> +static int xdp720_probe(struct i2c_client *client)
> +{
> +	struct pmbus_driver_info *info;
> +	int ret;
> +	u32 rimon;
> +	int gimon;
> +
> +	info = devm_kmemdup(&client->dev, &xdp720_info, sizeof(*info),
> +			    GFP_KERNEL);
> +	if (!info)
> +		return -ENOMEM;
> +
> +	ret = i2c_smbus_read_word_data(client, XDP720_TELEMETRY_AVG);
> +	if (ret < 0) {
> +		dev_err(&client->dev, "Can't get TELEMETRY_AVG\n");
> +		return ret;
> +	}
> +
> +	ret >>= 10; /* 10th bit of TELEMETRY_AVG REG for GIMON Value */
> +	ret &= GENMASK(0, 0);
> +	if (ret == 1)
> +		gimon = 18200; /* output gain 18.2 microA/A */
> +	else
> +		gimon = 9100; /* output gain 9.1 microA/A */
> +
> +	if (of_property_read_u32(client->dev.of_node,
> +				 "infineon,rimon-micro-ohms", &rimon))
> +		rimon = XDP720_DEFAULT_RIMON; /* Default if not set via DT */
> +	if (rimon == 0)
> +		return -EINVAL;
> +
> +	/* Adapt the current and power scale for each instance */
> +	info->m[PSC_CURRENT_OUT] = DIV64_U64_ROUND_CLOSEST((u64)
> +		info->m[PSC_CURRENT_OUT] * rimon * gimon, 1000000000000);
> +	info->m[PSC_POWER] = DIV64_U64_ROUND_CLOSEST((u64)
> +		info->m[PSC_POWER] * rimon * gimon, 1000000000000);
> +
> +	return pmbus_do_probe(client, info);
> +}
> +
> +static const struct of_device_id xdp720_of_match[] = {
> +	{ .compatible = "infineon,xdp720" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, xdp720_of_match);
> +
> +static const struct i2c_device_id xdp720_id[] = {
> +	{ "xdp720" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(i2c, xdp720_id);
> +
> +static struct i2c_driver xdp720_driver = {
> +	.driver = {
> +		   .name = "xdp720",
> +		   .of_match_table = xdp720_of_match,
> +	},
> +	.probe = xdp720_probe,
> +	.id_table = xdp720_id,
> +};
> +
> +module_i2c_driver(xdp720_driver);
> +
> +MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
> +MODULE_DESCRIPTION("PMBus driver for Infineon XDP720 Digital eFuse Controller");
> +MODULE_LICENSE("GPL");
> +MODULE_IMPORT_NS("PMBUS");


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

* Re: [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720
  2026-04-01 10:45 ` [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720 ASHISH YADAV
@ 2026-04-02  7:44   ` Krzysztof Kozlowski
  2026-04-02 13:58     ` ashish yadav
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-02  7:44 UTC (permalink / raw)
  To: ASHISH YADAV
  Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel, Ashish Yadav

On Wed, Apr 01, 2026 at 04:15:49PM +0530, ASHISH YADAV wrote:
> From: Ashish Yadav <ashish.yadav@infineon.com>
> 
> Add documentation for the device tree binding of the XDP720 eFuse.
> 
> Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
> ---
> This patch introduces a YAML schema describing the required and optional
> properties for the XDP720 eFuse device node. It includes details on the
> compatible string, register mapping, and rimon-micro-ohms(RIMON).
> 
> The RIMON resistance is installed between the Imon pin and the ground
> reference.

Why are you adding second commit msg? Hardware description goes to
commit msg. Redundant parts go to /dev/null.


> ---
>  .../bindings/hwmon/pmbus/infineon,xdp720.yaml | 51 +++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> new file mode 100644
> index 000000000000..bbde8ff92ae9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,xdp720.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Infineon XDP720 Digital eFuse Controller
> +
> +maintainers:
> +  - Ashish Yadav <ashish.yadav@infineon.com>
> +
> +description: |
> +  The XDP720 is an eFuse with integrated current sensor and digital
> +  controller. It provides accurate system telemetry (V, I, P, T) and
> +  reports analog current at the IMON pin for post-processing.
> +
> +  Datasheet:
> +     https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - infineon,xdp720
> +
> +  reg:
> +    maxItems: 1
> +
> +  infineon,rimon-micro-ohms:
> +    description: |

Do not need '|' unless you need to preserve formatting.

> +      The value of the RIMON resistor, in micro ohms, required to enable
> +      the system overcurrent protection.
> +

Missing supply

> +required:
> +  - compatible
> +  - reg

Here as well, most likely.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720
  2026-04-02  7:44   ` Krzysztof Kozlowski
@ 2026-04-02 13:58     ` ashish yadav
  2026-04-02 14:01       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: ashish yadav @ 2026-04-02 13:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel, Ashish Yadav

Hi Krzysztof,

Thanks for your valuable feedback and time.
Please find my response in-line.

With Best Regards,
  Ashish Yadav

On Thu, Apr 2, 2026 at 1:14 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Wed, Apr 01, 2026 at 04:15:49PM +0530, ASHISH YADAV wrote:
> > From: Ashish Yadav <ashish.yadav@infineon.com>
> >
> > Add documentation for the device tree binding of the XDP720 eFuse.
> >
> > Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
> > ---
> > This patch introduces a YAML schema describing the required and optional
> > properties for the XDP720 eFuse device node. It includes details on the
> > compatible string, register mapping, and rimon-micro-ohms(RIMON).
> >
> > The RIMON resistance is installed between the Imon pin and the ground
> > reference.
>
> Why are you adding second commit msg? Hardware description goes to
> commit msg. Redundant parts go to /dev/null.
>
>
  ACK.

> > ---
> >  .../bindings/hwmon/pmbus/infineon,xdp720.yaml | 51 +++++++++++++++++++
> >  1 file changed, 51 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> > new file mode 100644
> > index 000000000000..bbde8ff92ae9
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,xdp720.yaml
> > @@ -0,0 +1,51 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +
> > +$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,xdp720.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Infineon XDP720 Digital eFuse Controller
> > +
> > +maintainers:
> > +  - Ashish Yadav <ashish.yadav@infineon.com>
> > +
> > +description: |
> > +  The XDP720 is an eFuse with integrated current sensor and digital
> > +  controller. It provides accurate system telemetry (V, I, P, T) and
> > +  reports analog current at the IMON pin for post-processing.
> > +
> > +  Datasheet:
> > +     https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - infineon,xdp720
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  infineon,rimon-micro-ohms:
> > +    description: |
>
> Do not need '|' unless you need to preserve formatting.
>
ACK

> > +      The value of the RIMON resistor, in micro ohms, required to enable
> > +      the system overcurrent protection.
> > +
>
> Missing supply
Could you please provide more info here.

> > +required:
> > +  - compatible
> > +  - reg
>
> Here as well, most likely.
>
Could you please provide more info here.

> Best regards,
> Krzysztof
>

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

* Re: [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720
  2026-04-02 13:58     ` ashish yadav
@ 2026-04-02 14:01       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-02 14:01 UTC (permalink / raw)
  To: ashish yadav
  Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel, Ashish Yadav

On 02/04/2026 15:58, ashish yadav wrote:
> 
>>> +      The value of the RIMON resistor, in micro ohms, required to enable
>>> +      the system overcurrent protection.
>>> +
>>
>> Missing supply
> Could you please provide more info here.

Your device has a supply, no? At least I found one in the datasheet.



Best regards,
Krzysztof

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

* Re: [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720
  2026-04-01 15:56   ` Guenter Roeck
@ 2026-04-02 14:09     ` ashish yadav
  2026-04-06  5:22       ` ashish yadav
  0 siblings, 1 reply; 9+ messages in thread
From: ashish yadav @ 2026-04-02 14:09 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
	devicetree, linux-kernel, Ashish Yadav

Hi Guenter,

Thanks for your valuable feedback and time.
Please find my response in-line.

With Best Regards,
  Ashish Yadav

On Wed, Apr 1, 2026 at 9:26 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Hi,
>
> On 4/1/26 03:45, ASHISH YADAV wrote:
> > From: Ashish Yadav <ashish.yadav@infineon.com>
> >
> > Add the pmbus driver for Infineon XDP720 Digital eFuse Controller.
> >
> > Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
> > ---
> > XDP720 Digital eFuse Controller provides accurate system telemetry
> > (V, I, P, T) and reports analog current at the IMON pin for post-processing.
> >
> > The Current and Power measurement depends on the RIMON and GIMON values.
> > Please look into data sheet sections 5.4.2 and 5.4.4 for more details:
> > https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
> >
> > The GIMON (microA/A) depends on the 10th bit of TELEMETRY_AVG PMBUS Register.
> > The value of RIMON (kohm) can be provided by the user through device tree using
> > infineon,rimon-micro-ohms  property.
>
> Please have a look at
>
> https://sashiko.dev/#/patchset/20260401104550.115715-1-Ashish.Yadav%40infineon.com
>
> Main concern is the power measurement range, but also please use 1000000000000ULL
> as suggested.

Sure, We will look into it and get back to you.

> Thanks,
> Guenter
>
> > ---
> >   drivers/hwmon/pmbus/Kconfig  |   9 +++
> >   drivers/hwmon/pmbus/Makefile |   1 +
> >   drivers/hwmon/pmbus/xdp720.c | 123 +++++++++++++++++++++++++++++++++++
> >   3 files changed, 133 insertions(+)
> >   create mode 100644 drivers/hwmon/pmbus/xdp720.c
> >
> > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> > index fc1273abe357..c419e3ecce90 100644
> > --- a/drivers/hwmon/pmbus/Kconfig
> > +++ b/drivers/hwmon/pmbus/Kconfig
> > @@ -702,6 +702,15 @@ config SENSORS_XDP710
> >         This driver can also be built as a module. If so, the module will
> >         be called xdp710.
> >
> > +config SENSORS_XDP720
> > +     tristate "Infineon XDP720 family"
> > +     help
> > +       If you say yes here you get hardware monitoring support for Infineon
> > +       XDP720.
> > +
> > +       This driver can also be built as a module. If so, the module will
> > +       be called xdp720.
> > +
> >   config SENSORS_XDPE152
> >       tristate "Infineon XDPE152 family"
> >       help
> > diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> > index d6c86924f887..1cac7ccae79f 100644
> > --- a/drivers/hwmon/pmbus/Makefile
> > +++ b/drivers/hwmon/pmbus/Makefile
> > @@ -68,6 +68,7 @@ obj-$(CONFIG_SENSORS_TPS546D24)     += tps546d24.o
> >   obj-$(CONFIG_SENSORS_UCD9000)       += ucd9000.o
> >   obj-$(CONFIG_SENSORS_UCD9200)       += ucd9200.o
> >   obj-$(CONFIG_SENSORS_XDP710)        += xdp710.o
> > +obj-$(CONFIG_SENSORS_XDP720) += xdp720.o
> >   obj-$(CONFIG_SENSORS_XDPE122)       += xdpe12284.o
> >   obj-$(CONFIG_SENSORS_XDPE152)       += xdpe152c4.o
> >   obj-$(CONFIG_SENSORS_ZL6100)        += zl6100.o
> > diff --git a/drivers/hwmon/pmbus/xdp720.c b/drivers/hwmon/pmbus/xdp720.c
> > new file mode 100644
> > index 000000000000..382dc3f9ce80
> > --- /dev/null
> > +++ b/drivers/hwmon/pmbus/xdp720.c
> > @@ -0,0 +1,123 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Hardware monitoring driver for Infineon XDP720 Digital eFuse Controller
> > + *
> > + * Copyright (c) 2026 Infineon Technologies. All rights reserved.
> > + */
> > +
> > +#include <linux/i2c.h>
> > +#include <linux/module.h>
> > +#include <linux/init.h>
> > +#include <linux/kernel.h>
> > +#include <linux/of_device.h>
> > +#include <linux/bitops.h>
> > +#include <linux/math64.h>
> > +#include "pmbus.h"
> > +
> > +/*
> > + * The IMON resistor required to generate the system overcurrent protection.
> > + * Arbitrary default Rimon value: 2k Ohm
> > + */
> > +#define XDP720_DEFAULT_RIMON 2000000000 /* 2k ohm */
> > +#define XDP720_TELEMETRY_AVG 0xE9
> > +
> > +static struct pmbus_driver_info xdp720_info = {
> > +     .pages = 1,
> > +     .format[PSC_VOLTAGE_IN] = direct,
> > +     .format[PSC_VOLTAGE_OUT] = direct,
> > +     .format[PSC_CURRENT_OUT] = direct,
> > +     .format[PSC_POWER] = direct,
> > +     .format[PSC_TEMPERATURE] = direct,
> > +
> > +     .m[PSC_VOLTAGE_IN] = 4653,
> > +     .b[PSC_VOLTAGE_IN] = 0,
> > +     .R[PSC_VOLTAGE_IN] = -2,
> > +     .m[PSC_VOLTAGE_OUT] = 4653,
> > +     .b[PSC_VOLTAGE_OUT] = 0,
> > +     .R[PSC_VOLTAGE_OUT] = -2,
> > +     /*
> > +      * Current and Power measurement depends on the RIMON (kOhm) and
> > +      * GIMON(microA/A) values.
> > +      */
> > +     .m[PSC_CURRENT_OUT] = 24668,
> > +     .b[PSC_CURRENT_OUT] = 0,
> > +     .R[PSC_CURRENT_OUT] = -4,
> > +     .m[PSC_POWER] = 4486,
> > +     .b[PSC_POWER] = 0,
> > +     .R[PSC_POWER] = -1,
> > +     .m[PSC_TEMPERATURE] = 54,
> > +     .b[PSC_TEMPERATURE] = 22521,
> > +     .R[PSC_TEMPERATURE] = -1,
> > +
> > +     .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN |
> > +                PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_INPUT |
> > +                PMBUS_HAVE_STATUS_TEMP,
> > +};
> > +
> > +static int xdp720_probe(struct i2c_client *client)
> > +{
> > +     struct pmbus_driver_info *info;
> > +     int ret;
> > +     u32 rimon;
> > +     int gimon;
> > +
> > +     info = devm_kmemdup(&client->dev, &xdp720_info, sizeof(*info),
> > +                         GFP_KERNEL);
> > +     if (!info)
> > +             return -ENOMEM;
> > +
> > +     ret = i2c_smbus_read_word_data(client, XDP720_TELEMETRY_AVG);
> > +     if (ret < 0) {
> > +             dev_err(&client->dev, "Can't get TELEMETRY_AVG\n");
> > +             return ret;
> > +     }
> > +
> > +     ret >>= 10; /* 10th bit of TELEMETRY_AVG REG for GIMON Value */
> > +     ret &= GENMASK(0, 0);
> > +     if (ret == 1)
> > +             gimon = 18200; /* output gain 18.2 microA/A */
> > +     else
> > +             gimon = 9100; /* output gain 9.1 microA/A */
> > +
> > +     if (of_property_read_u32(client->dev.of_node,
> > +                              "infineon,rimon-micro-ohms", &rimon))
> > +             rimon = XDP720_DEFAULT_RIMON; /* Default if not set via DT */
> > +     if (rimon == 0)
> > +             return -EINVAL;
> > +
> > +     /* Adapt the current and power scale for each instance */
> > +     info->m[PSC_CURRENT_OUT] = DIV64_U64_ROUND_CLOSEST((u64)
> > +             info->m[PSC_CURRENT_OUT] * rimon * gimon, 1000000000000);
> > +     info->m[PSC_POWER] = DIV64_U64_ROUND_CLOSEST((u64)
> > +             info->m[PSC_POWER] * rimon * gimon, 1000000000000);
> > +
> > +     return pmbus_do_probe(client, info);
> > +}
> > +
> > +static const struct of_device_id xdp720_of_match[] = {
> > +     { .compatible = "infineon,xdp720" },
> > +     {}
> > +};
> > +MODULE_DEVICE_TABLE(of, xdp720_of_match);
> > +
> > +static const struct i2c_device_id xdp720_id[] = {
> > +     { "xdp720" },
> > +     {}
> > +};
> > +MODULE_DEVICE_TABLE(i2c, xdp720_id);
> > +
> > +static struct i2c_driver xdp720_driver = {
> > +     .driver = {
> > +                .name = "xdp720",
> > +                .of_match_table = xdp720_of_match,
> > +     },
> > +     .probe = xdp720_probe,
> > +     .id_table = xdp720_id,
> > +};
> > +
> > +module_i2c_driver(xdp720_driver);
> > +
> > +MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
> > +MODULE_DESCRIPTION("PMBus driver for Infineon XDP720 Digital eFuse Controller");
> > +MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("PMBUS");
>

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

* Re: [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720
  2026-04-02 14:09     ` ashish yadav
@ 2026-04-06  5:22       ` ashish yadav
  0 siblings, 0 replies; 9+ messages in thread
From: ashish yadav @ 2026-04-06  5:22 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
	devicetree, linux-kernel, Ashish Yadav

Hi Guenter,

I hope you’re doing well.

I’m writing to provide an update regarding the m[PSC_POWER] issue
identified in the following
patchset: https://sashiko.dev/#/patchset/20260401104550.115715-1-Ashish.Yadav%40infineon.com.

The discrepancy was caused by an incorrect divisor in the power
calculation. Specifically:
info->m[PSC_POWER] = DIV64_U64_ROUND_CLOSEST((u64) info->m[PSC_POWER]
* rimon * gimon, 1000000000000);

The divisor should be 10^15 rather than 10^12.
With this correction, the [PSC_POWER] value scales correctly to 163.29
(previously 16329).

I will include this fix in the next version of the patch.
Apologies for any inconvenience this may have caused, and thank you
for your time and feedback.

With Best Regards,
   Ashish Yadav


On Thu, Apr 2, 2026 at 7:39 PM ashish yadav <ashishyadav78@gmail.com> wrote:
>
> Hi Guenter,
>
> Thanks for your valuable feedback and time.
> Please find my response in-line.
>
> With Best Regards,
>   Ashish Yadav
>
> On Wed, Apr 1, 2026 at 9:26 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > Hi,
> >
> > On 4/1/26 03:45, ASHISH YADAV wrote:
> > > From: Ashish Yadav <ashish.yadav@infineon.com>
> > >
> > > Add the pmbus driver for Infineon XDP720 Digital eFuse Controller.
> > >
> > > Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
> > > ---
> > > XDP720 Digital eFuse Controller provides accurate system telemetry
> > > (V, I, P, T) and reports analog current at the IMON pin for post-processing.
> > >
> > > The Current and Power measurement depends on the RIMON and GIMON values.
> > > Please look into data sheet sections 5.4.2 and 5.4.4 for more details:
> > > https://www.infineon.com/assets/row/public/documents/24/49/infineon-xdp720-001-datasheet-en.pdf
> > >
> > > The GIMON (microA/A) depends on the 10th bit of TELEMETRY_AVG PMBUS Register.
> > > The value of RIMON (kohm) can be provided by the user through device tree using
> > > infineon,rimon-micro-ohms  property.
> >
> > Please have a look at
> >
> > https://sashiko.dev/#/patchset/20260401104550.115715-1-Ashish.Yadav%40infineon.com
> >
> > Main concern is the power measurement range, but also please use 1000000000000ULL
> > as suggested.
>
> Sure, We will look into it and get back to you.
>
> > Thanks,
> > Guenter
> >
> > > ---
> > >   drivers/hwmon/pmbus/Kconfig  |   9 +++
> > >   drivers/hwmon/pmbus/Makefile |   1 +
> > >   drivers/hwmon/pmbus/xdp720.c | 123 +++++++++++++++++++++++++++++++++++
> > >   3 files changed, 133 insertions(+)
> > >   create mode 100644 drivers/hwmon/pmbus/xdp720.c
> > >
> > > diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> > > index fc1273abe357..c419e3ecce90 100644
> > > --- a/drivers/hwmon/pmbus/Kconfig
> > > +++ b/drivers/hwmon/pmbus/Kconfig
> > > @@ -702,6 +702,15 @@ config SENSORS_XDP710
> > >         This driver can also be built as a module. If so, the module will
> > >         be called xdp710.
> > >
> > > +config SENSORS_XDP720
> > > +     tristate "Infineon XDP720 family"
> > > +     help
> > > +       If you say yes here you get hardware monitoring support for Infineon
> > > +       XDP720.
> > > +
> > > +       This driver can also be built as a module. If so, the module will
> > > +       be called xdp720.
> > > +
> > >   config SENSORS_XDPE152
> > >       tristate "Infineon XDPE152 family"
> > >       help
> > > diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> > > index d6c86924f887..1cac7ccae79f 100644
> > > --- a/drivers/hwmon/pmbus/Makefile
> > > +++ b/drivers/hwmon/pmbus/Makefile
> > > @@ -68,6 +68,7 @@ obj-$(CONFIG_SENSORS_TPS546D24)     += tps546d24.o
> > >   obj-$(CONFIG_SENSORS_UCD9000)       += ucd9000.o
> > >   obj-$(CONFIG_SENSORS_UCD9200)       += ucd9200.o
> > >   obj-$(CONFIG_SENSORS_XDP710)        += xdp710.o
> > > +obj-$(CONFIG_SENSORS_XDP720) += xdp720.o
> > >   obj-$(CONFIG_SENSORS_XDPE122)       += xdpe12284.o
> > >   obj-$(CONFIG_SENSORS_XDPE152)       += xdpe152c4.o
> > >   obj-$(CONFIG_SENSORS_ZL6100)        += zl6100.o
> > > diff --git a/drivers/hwmon/pmbus/xdp720.c b/drivers/hwmon/pmbus/xdp720.c
> > > new file mode 100644
> > > index 000000000000..382dc3f9ce80
> > > --- /dev/null
> > > +++ b/drivers/hwmon/pmbus/xdp720.c
> > > @@ -0,0 +1,123 @@
> > > +// SPDX-License-Identifier: GPL-2.0+
> > > +/*
> > > + * Hardware monitoring driver for Infineon XDP720 Digital eFuse Controller
> > > + *
> > > + * Copyright (c) 2026 Infineon Technologies. All rights reserved.
> > > + */
> > > +
> > > +#include <linux/i2c.h>
> > > +#include <linux/module.h>
> > > +#include <linux/init.h>
> > > +#include <linux/kernel.h>
> > > +#include <linux/of_device.h>
> > > +#include <linux/bitops.h>
> > > +#include <linux/math64.h>
> > > +#include "pmbus.h"
> > > +
> > > +/*
> > > + * The IMON resistor required to generate the system overcurrent protection.
> > > + * Arbitrary default Rimon value: 2k Ohm
> > > + */
> > > +#define XDP720_DEFAULT_RIMON 2000000000 /* 2k ohm */
> > > +#define XDP720_TELEMETRY_AVG 0xE9
> > > +
> > > +static struct pmbus_driver_info xdp720_info = {
> > > +     .pages = 1,
> > > +     .format[PSC_VOLTAGE_IN] = direct,
> > > +     .format[PSC_VOLTAGE_OUT] = direct,
> > > +     .format[PSC_CURRENT_OUT] = direct,
> > > +     .format[PSC_POWER] = direct,
> > > +     .format[PSC_TEMPERATURE] = direct,
> > > +
> > > +     .m[PSC_VOLTAGE_IN] = 4653,
> > > +     .b[PSC_VOLTAGE_IN] = 0,
> > > +     .R[PSC_VOLTAGE_IN] = -2,
> > > +     .m[PSC_VOLTAGE_OUT] = 4653,
> > > +     .b[PSC_VOLTAGE_OUT] = 0,
> > > +     .R[PSC_VOLTAGE_OUT] = -2,
> > > +     /*
> > > +      * Current and Power measurement depends on the RIMON (kOhm) and
> > > +      * GIMON(microA/A) values.
> > > +      */
> > > +     .m[PSC_CURRENT_OUT] = 24668,
> > > +     .b[PSC_CURRENT_OUT] = 0,
> > > +     .R[PSC_CURRENT_OUT] = -4,
> > > +     .m[PSC_POWER] = 4486,
> > > +     .b[PSC_POWER] = 0,
> > > +     .R[PSC_POWER] = -1,
> > > +     .m[PSC_TEMPERATURE] = 54,
> > > +     .b[PSC_TEMPERATURE] = 22521,
> > > +     .R[PSC_TEMPERATURE] = -1,
> > > +
> > > +     .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN |
> > > +                PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_INPUT |
> > > +                PMBUS_HAVE_STATUS_TEMP,
> > > +};
> > > +
> > > +static int xdp720_probe(struct i2c_client *client)
> > > +{
> > > +     struct pmbus_driver_info *info;
> > > +     int ret;
> > > +     u32 rimon;
> > > +     int gimon;
> > > +
> > > +     info = devm_kmemdup(&client->dev, &xdp720_info, sizeof(*info),
> > > +                         GFP_KERNEL);
> > > +     if (!info)
> > > +             return -ENOMEM;
> > > +
> > > +     ret = i2c_smbus_read_word_data(client, XDP720_TELEMETRY_AVG);
> > > +     if (ret < 0) {
> > > +             dev_err(&client->dev, "Can't get TELEMETRY_AVG\n");
> > > +             return ret;
> > > +     }
> > > +
> > > +     ret >>= 10; /* 10th bit of TELEMETRY_AVG REG for GIMON Value */
> > > +     ret &= GENMASK(0, 0);
> > > +     if (ret == 1)
> > > +             gimon = 18200; /* output gain 18.2 microA/A */
> > > +     else
> > > +             gimon = 9100; /* output gain 9.1 microA/A */
> > > +
> > > +     if (of_property_read_u32(client->dev.of_node,
> > > +                              "infineon,rimon-micro-ohms", &rimon))
> > > +             rimon = XDP720_DEFAULT_RIMON; /* Default if not set via DT */
> > > +     if (rimon == 0)
> > > +             return -EINVAL;
> > > +
> > > +     /* Adapt the current and power scale for each instance */
> > > +     info->m[PSC_CURRENT_OUT] = DIV64_U64_ROUND_CLOSEST((u64)
> > > +             info->m[PSC_CURRENT_OUT] * rimon * gimon, 1000000000000);
> > > +     info->m[PSC_POWER] = DIV64_U64_ROUND_CLOSEST((u64)
> > > +             info->m[PSC_POWER] * rimon * gimon, 1000000000000);
> > > +
> > > +     return pmbus_do_probe(client, info);
> > > +}
> > > +
> > > +static const struct of_device_id xdp720_of_match[] = {
> > > +     { .compatible = "infineon,xdp720" },
> > > +     {}
> > > +};
> > > +MODULE_DEVICE_TABLE(of, xdp720_of_match);
> > > +
> > > +static const struct i2c_device_id xdp720_id[] = {
> > > +     { "xdp720" },
> > > +     {}
> > > +};
> > > +MODULE_DEVICE_TABLE(i2c, xdp720_id);
> > > +
> > > +static struct i2c_driver xdp720_driver = {
> > > +     .driver = {
> > > +                .name = "xdp720",
> > > +                .of_match_table = xdp720_of_match,
> > > +     },
> > > +     .probe = xdp720_probe,
> > > +     .id_table = xdp720_id,
> > > +};
> > > +
> > > +module_i2c_driver(xdp720_driver);
> > > +
> > > +MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
> > > +MODULE_DESCRIPTION("PMBus driver for Infineon XDP720 Digital eFuse Controller");
> > > +MODULE_LICENSE("GPL");
> > > +MODULE_IMPORT_NS("PMBUS");
> >

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

end of thread, other threads:[~2026-04-06  5:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 10:45 [PATCH v2 0/2] Add support for Infineon Digital eFuse XDP720 ASHISH YADAV
2026-04-01 10:45 ` [PATCH v2 1/2] dt-bindings: hwmon/pmbus: Add Infineon XDP720 ASHISH YADAV
2026-04-02  7:44   ` Krzysztof Kozlowski
2026-04-02 13:58     ` ashish yadav
2026-04-02 14:01       ` Krzysztof Kozlowski
2026-04-01 10:45 ` [PATCH v2 2/2] hwmon:(pmbus/xdp720) Add support for efuse xdp720 ASHISH YADAV
2026-04-01 15:56   ` Guenter Roeck
2026-04-02 14:09     ` ashish yadav
2026-04-06  5:22       ` ashish yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox