Skip to content

Commit 21a8d75

Browse files
committed
hw-mgmt: kernel patch: Add dedicated patch for XDPE1A2G7B
Add new patch to support Infineon XDPE1A2G7B Digital Multi-phase Controller. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
1 parent 4e719fe commit 21a8d75

File tree

12 files changed

+332
-132
lines changed

12 files changed

+332
-132
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y (if kernel version >= v5.4, optional up to
183183
CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY=y (if kernel version >= v5.4, optional up to user)
184184
CONFIG_THERMAL_NETLINK=y (if kernel version >= v5.10)
185185
CONFIG_SENSORS_XDPE152=m
186+
CONFIG_SENSORS_XDPE1A2G7B=m
186187
CONFIG_SENSORS_DRIVETEMP=m
187188
CONFIG_SENSORS_IIO_HWMON=m
188189
CONFIG_SENSORS_LM25066=m
@@ -285,6 +286,7 @@ CONFIG_I2C_MUX_PCA954x=m
285286
CONFIG_GPIO_PCA953X=m
286287
CONFIG_THERMAL_NETLINK=y
287288
CONFIG_SENSORS_XDPE152=m
289+
CONFIG_SENSORS_XDPE1A2G7B=m
288290
CONFIG_SENSORS_DRIVETEMP=m
289291
CONFIG_SENSORS_IIO_HWMON=m
290292
CONFIG_SENSORS_LM25066=m

recipes-kernel/linux/Patch_Status_Table.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ Kernel-5.10
276276
|0265-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch | | Downstream;skip[sonic,cumulus] | | BF3 |
277277
|0266-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch | | Downstream;skip[sonic,cumulus] | | BF3 |
278278
|0267-platform-mellanox-mlx-platform-Modify-power-off-call.patch | | Feature pending | | |
279-
|0268-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch | | Feature pending | | |
280-
|0269-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch | | Downstream accepted | | |
279+
|0268-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch | | Downstream;skip[ALL] | | |
281280
|0270-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch | | Downstream accepted | | |
282281
|0271-leds-mlxreg-Remove-code-for-amber-LED-colour.patch | | Downstream accepted | | |
283282
|0272-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch | | Downstream accepted | | |
@@ -661,8 +660,8 @@ Kernel-6.1
661660
|0043-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch | | Feature pending | | |
662661
|0044-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch | | Downstream accepted | | |
663662
|0045-leds-mlxreg-Remove-code-for-amber-LED-colour.patch | | Downstream accepted | | |
664-
|0046-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch | | Downstream accepted | | |
665-
|0047-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch | | Downstream accepted | | |
663+
|0046-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch | | Downstream;skip[ALL] | | |
664+
|0047-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch | | Downstream;skip[ALL] | | |
666665
|0048-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch | | Downstream accepted | | |
667666
|0049-dt-bindings-trivial-devices-Add-mps-mp2891.patch | | Downstream accepted | | |
668667
|0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch | | Downstream accepted | | |
@@ -717,6 +716,7 @@ Kernel-6.1
717716
|0103-platform-mellanox-mlx-dpu-improve-interrupt-handling.patch | | Downstream accepted | | SN4280 |
718717
|0104-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2869-c.patch | | Downstream accepted | | mp2869 |
719718
|0105-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp29502-.patch | | Downstream accepted | | mp29502 |
719+
|0106-hwmon-pmbus-xdpe1a2g7b-XDPE1A2G7B-Digital-Multi-phas.patch | | Downstream accepted | | xdpe1a2g7b |
720720
|8000-mlxsw-Use-weak-reverse-dependencies-for-firmware-fla.patch | | Downstream accepted | | Disable FW update |
721721
|8002-platform-mlx-platform-Downstream-Add-SPI-path-for-ra.patch | | Downstream;skip[sonic,cumulus] | | Add SPI |
722722
|8003-mlxsw-i2c-SONIC-ISSU-Prevent-transaction-execution-f.patch | | Downstream accepted | | Sonic/ISSU |

recipes-kernel/linux/kconfig_6_1.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ CONFIG_SENSORS_MP2888=m
6161
CONFIG_SENSORS_MP2891=m
6262
CONFIG_SENSORS_MP2869=m
6363
CONFIG_SENSORS_MP29502=m
64+
CONFIG_SENSORS_XDPE1A2G7B=m
6465
CONFIG_GPIO_ICH=m
6566
CONFIG_LPC_ICH=m
6667
CONFIG_CPU_THERMAL=y
@@ -200,6 +201,7 @@ CONFIG_I2C_MUX_PCA954x=m
200201
CONFIG_GPIO_PCA953X=m
201202
CONFIG_THERMAL_NETLINK=y
202203
CONFIG_SENSORS_XDPE152=m
204+
CONFIG_SENSORS_XDPE1A2G7B=m
203205
CONFIG_SENSORS_DRIVETEMP=m
204206
CONFIG_SENSORS_IIO_HWMON=m
205207
CONFIG_SENSORS_LM25066=m
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
From 984090311edebbf7f3b246230f567847540b66bd Mon Sep 17 00:00:00 2001
2+
From: Vadim Pasternak <vadimp@nvidia.com>
3+
Date: Wed, 14 Jan 2026 19:19:20 +0200
4+
Subject: [PATCH backport 6.1 1/1] hwmon:(pmbus/xdpe1a2g7b) XDPE1A2G7B Digital
5+
Multi-phase Controller Driver
6+
7+
Add the pmbus driver for the Infineon XDPE1A2G7B Digital Multi-phase
8+
Controller.
9+
10+
Signed-off-by: Ashish Yadav <ashish.yadav@infineon.com>
11+
---
12+
drivers/hwmon/pmbus/Kconfig | 9 +++
13+
drivers/hwmon/pmbus/Makefile | 1 +
14+
drivers/hwmon/pmbus/pmbus.h | 2 +-
15+
drivers/hwmon/pmbus/pmbus_core.c | 4 ++
16+
drivers/hwmon/pmbus/xdpe1a2g7b.c | 97 ++++++++++++++++++++++++++++++++
17+
5 files changed, 112 insertions(+), 1 deletion(-)
18+
create mode 100644 drivers/hwmon/pmbus/xdpe1a2g7b.c
19+
20+
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
21+
index 571427e53..1eabc51d6 100644
22+
--- a/drivers/hwmon/pmbus/Kconfig
23+
+++ b/drivers/hwmon/pmbus/Kconfig
24+
@@ -472,6 +472,15 @@ config SENSORS_XDPE152
25+
This driver can also be built as a module. If so, the module will
26+
be called xdpe152c4.
27+
28+
+config SENSORS_XDPE1A2G7B
29+
+ tristate "Infineon XDPE1A2G7B"
30+
+ help
31+
+ If you say yes here you get hardware monitoring support for Infineon
32+
+ XDPE1A2G7B.
33+
+
34+
+ This driver can also be built as a module. If so, the module will
35+
+ be called xdpe1a2g7b.
36+
+
37+
config SENSORS_XDPE122
38+
tristate "Infineon XDPE122 family"
39+
help
40+
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
41+
index 186e2ecc6..ed15ebae5 100644
42+
--- a/drivers/hwmon/pmbus/Makefile
43+
+++ b/drivers/hwmon/pmbus/Makefile
44+
@@ -50,5 +50,6 @@ obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o
45+
obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o
46+
obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o
47+
obj-$(CONFIG_SENSORS_XDPE152) += xdpe152c4.o
48+
+obj-$(CONFIG_SENSORS_XDPE1A2G7B) += xdpe1a2g7b.o
49+
obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o
50+
obj-$(CONFIG_SENSORS_PIM4328) += pim4328.o
51+
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
52+
index 0bbb8ae93..62a6908d7 100644
53+
--- a/drivers/hwmon/pmbus/pmbus.h
54+
+++ b/drivers/hwmon/pmbus/pmbus.h
55+
@@ -407,7 +407,7 @@ enum pmbus_sensor_classes {
56+
#define PMBUS_PAGE_VIRTUAL BIT(31) /* Page is virtual */
57+
58+
enum pmbus_data_format { linear = 0, ieee754, direct, vid };
59+
-enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv };
60+
+enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv, nvidia195mv };
61+
62+
/* PMBus revision identifiers */
63+
#define PMBUS_REV_10 0x00 /* PMBus revision 1.0 */
64+
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
65+
index 4b73c7b27..43502f730 100644
66+
--- a/drivers/hwmon/pmbus/pmbus_core.c
67+
+++ b/drivers/hwmon/pmbus/pmbus_core.c
68+
@@ -816,6 +816,10 @@ static s64 pmbus_reg2data_vid(struct pmbus_data *data,
69+
if (val >= 0x0 && val <= 0xd8)
70+
rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100);
71+
break;
72+
+ case nvidia195mv:
73+
+ if (val >= 0x01)
74+
+ rv = 195 + (val - 1) * 5;
75+
+ break;
76+
}
77+
return rv;
78+
}
79+
diff --git a/drivers/hwmon/pmbus/xdpe1a2g7b.c b/drivers/hwmon/pmbus/xdpe1a2g7b.c
80+
new file mode 100644
81+
index 000000000..c7e230dc8
82+
--- /dev/null
83+
+++ b/drivers/hwmon/pmbus/xdpe1a2g7b.c
84+
@@ -0,0 +1,97 @@
85+
+// SPDX-License-Identifier: GPL-2.0+
86+
+/*
87+
+ * Hardware monitoring driver for Infineon Multi-phase Digital VR Controllers
88+
+ *
89+
+ * Copyright (c) 2026 Infineon Technologies. All rights reserved.
90+
+ */
91+
+
92+
+#include <linux/err.h>
93+
+#include <linux/i2c.h>
94+
+#include <linux/init.h>
95+
+#include <linux/kernel.h>
96+
+#include <linux/module.h>
97+
+#include "pmbus.h"
98+
+
99+
+#define XDPE1A2G7B_PAGE_NUM 2
100+
+#define XDPE122_NVIDIA_195MV 0x1E /* NVIDIA mode 1.95mV */
101+
+
102+
+static struct pmbus_driver_info xdpe1a2g7b_info = {
103+
+ .pages = XDPE1A2G7B_PAGE_NUM,
104+
+ .format[PSC_VOLTAGE_IN] = linear,
105+
+ .format[PSC_VOLTAGE_OUT] = vid,
106+
+ .format[PSC_TEMPERATURE] = linear,
107+
+ .format[PSC_CURRENT_IN] = linear,
108+
+ .format[PSC_CURRENT_OUT] = linear,
109+
+ .format[PSC_POWER] = linear,
110+
+ .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
111+
+ PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
112+
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP |
113+
+ PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
114+
+ .func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
115+
+ PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
116+
+ PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
117+
+};
118+
+
119+
+static int xdpe1a2g7b_identify(struct i2c_client *client,
120+
+ struct pmbus_driver_info *info)
121+
+{
122+
+ u8 vout_params;
123+
+ int i, ret;
124+
+
125+
+ for (i = 0; i < info->pages; i++) {
126+
+ /* Read the register with VOUT for VID Code Type. */
127+
+ ret = pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE);
128+
+ if (ret < 0)
129+
+ return ret;
130+
+
131+
+ vout_params = ret & GENMASK(4, 0);
132+
+
133+
+ switch (vout_params) {
134+
+ case XDPE122_NVIDIA_195MV:
135+
+ info->vrm_version[i] = nvidia195mv;
136+
+ break;
137+
+ default:
138+
+ return -EINVAL;
139+
+ }
140+
+ }
141+
+
142+
+ return 0;
143+
+}
144+
+
145+
+static int xdpe1a2g7b_probe(struct i2c_client *client)
146+
+{
147+
+ struct pmbus_driver_info *info;
148+
+
149+
+ info = devm_kmemdup(&client->dev, &xdpe1a2g7b_info, sizeof(*info),
150+
+ GFP_KERNEL);
151+
+ if (!info)
152+
+ return -ENOMEM;
153+
+
154+
+ info->identify = xdpe1a2g7b_identify;
155+
+
156+
+ return pmbus_do_probe(client, info);
157+
+}
158+
+
159+
+static const struct i2c_device_id xdpe1a2g7b_id[] = { { "xdpe1a2g7b" }, {} };
160+
+
161+
+MODULE_DEVICE_TABLE(i2c, xdpe1a2g7b_id);
162+
+
163+
+static const struct of_device_id __maybe_unused
164+
+ xdpe1a2g7b_of_match[] = { { .compatible = "infineon,xdpe1a2g7b" }, {} };
165+
+MODULE_DEVICE_TABLE(of, xdpe1a2g7b_of_match);
166+
+
167+
+static struct i2c_driver xdpe1a2g7b_driver = {
168+
+ .driver = {
169+
+ .name = "xdpe1a2g7b",
170+
+ .of_match_table = of_match_ptr(xdpe1a2g7b_of_match),
171+
+ },
172+
+ .probe_new = xdpe1a2g7b_probe,
173+
+ .id_table = xdpe1a2g7b_id,
174+
+};
175+
+
176+
+module_i2c_driver(xdpe1a2g7b_driver);
177+
+
178+
+MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
179+
+MODULE_DESCRIPTION("PMBus driver for Infineon XDPE1A2G7B");
180+
+MODULE_LICENSE("GPL");
181+
+MODULE_IMPORT_NS(PMBUS);
182+
--
183+
2.34.1
184+

usr/etc/hw-management-sensors/n51xxld_sensors.conf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##################################################################################
2-
# Copyright (c) 2020 - 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright (c) 2020 - 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Platform specific sensors config for P4262
55
##################################################################################
@@ -115,7 +115,7 @@ bus "i2c-13" "i2c-9-mux (chan_id 4)"
115115
label curr3 "PMIC-3 ASIC1_HVDD_PL1 Curr (out1)"
116116
label curr4 "PMIC-3 ASIC1_DVDD_PL1Curr (out2)"
117117

118-
chip "xdpe1a2g7-i2c-13-66"
118+
chip "xdpe1a2g7b-i2c-13-66"
119119
label in1 "PMIC-1 PVIN1_VDD_ASIC1 Volt (in)"
120120
label in2 "PMIC-1 ASIC1_VDD Volt (out1)"
121121
ignore in3
@@ -129,7 +129,7 @@ bus "i2c-13" "i2c-9-mux (chan_id 4)"
129129
label curr3 "PMIC-1 ASIC1_VDD Curr (out1)"
130130
ignore curr4
131131

132-
chip "xdpe1a2g7-i2c-13-68"
132+
chip "xdpe1a2g7b-i2c-13-68"
133133
label in1 "PMIC-2 PVIN1_HVDD_DVDD_ASIC1 Volt (in)"
134134
label in2 "PMIC-2 ASIC1_HVDD_PL0 Volt (out1)"
135135
label in3 "PMIC-2 ASIC1_DVDD_PL0 Volt (out2)"
@@ -143,7 +143,7 @@ bus "i2c-13" "i2c-9-mux (chan_id 4)"
143143
label curr3 "PMIC-2 ASIC1_HVDD_PL0 Curr (out1)"
144144
label curr4 "PMIC-2 ASIC1_DVDD_PL0 Curr (out2)"
145145

146-
chip "xdpe1a2g7-i2c-13-6c"
146+
chip "xdpe1a2g7b-i2c-13-6c"
147147
label in1 "PMIC-3 PVIN1_HVDD_DVDD_ASIC1 Volt (in)"
148148
label in2 "PMIC-3 ASIC1_HVDD_PL1 Volt (out1)"
149149
label in3 "PMIC-3 ASIC1_DVDD_PL1 Volt (out2)"
@@ -246,7 +246,7 @@ bus "i2c-29" "i2c-9-mux (chan_id 20)"
246246
label curr3 "PMIC-6 ASIC2_HVDD_PL1 Curr (out1)"
247247
label curr4 "PMIC-6 ASIC2_DVDD_PL1Curr (out2)"
248248

249-
chip "xdpe1a2g7-i2c-29-66"
249+
chip "xdpe1a2g7b-i2c-29-66"
250250
label in1 "PMIC-4 PVIN1_VDD_ASIC2 Volt (in)"
251251
label in2 "PMIC-4 ASIC2_VDD Volt (out1)"
252252
ignore in3
@@ -260,7 +260,7 @@ bus "i2c-29" "i2c-9-mux (chan_id 20)"
260260
label curr3 "PMIC-4 ASIC2_VDD Curr (out1)"
261261
ignore curr4
262262

263-
chip "xdpe1a2g7-i2c-29-68"
263+
chip "xdpe1a2g7b-i2c-29-68"
264264
label in1 "PMIC-5 PVIN1_HVDD_DVDD_ASIC2 Volt (in)"
265265
label in2 "PMIC-5 ASIC2_HVDD_PL0 Volt (out1)"
266266
label in3 "PMIC-5 ASIC2_DVDD_PL0 Volt (out2)"
@@ -274,7 +274,7 @@ bus "i2c-29" "i2c-9-mux (chan_id 20)"
274274
label curr3 "PMIC-5 ASIC1_HVDD_PL0 Curr (out1)"
275275
label curr4 "PMIC-5 ASIC1_DVDD_PL0 Curr (out2)"
276276

277-
chip "xdpe1a2g7-i2c-29-6c"
277+
chip "xdpe1a2g7b-i2c-29-6c"
278278
label in1 "PMIC-6 PVIN1_HVDD_DVDD_ASIC2 Volt (in)"
279279
label in2 "PMIC-6 ASIC2_HVDD_PL1 Volt (out1)"
280280
label in3 "PMIC-6 ASIC2_DVDD_PL1 Volt (out2)"
@@ -332,7 +332,7 @@ bus "i2c-59" "i2c-9-mux (chan_id 52)"
332332
label curr3 "PMIC-9 ASIC3_HVDD_PL1 Curr (out1)"
333333
label curr4 "PMIC-9 ASIC3_DVDD_PL1 Curr (out2)"
334334

335-
chip "xdpe1a2g7-i2c-59-66"
335+
chip "xdpe1a2g7b-i2c-59-66"
336336
label in1 "PMIC-7 PVIN1_VDD_ASIC3 Volt (in)"
337337
label in2 "PMIC-7 ASIC3_VDD Volt (out1)"
338338
ignore in3
@@ -346,7 +346,7 @@ bus "i2c-59" "i2c-9-mux (chan_id 52)"
346346
label curr3 "PMIC-7 ASIC3_VDD Curr (out1)"
347347
ignore curr4
348348

349-
chip "xdpe1a2g7-i2c-59-68"
349+
chip "xdpe1a2g7b-i2c-59-68"
350350
label in1 "PMIC-8 PVIN1_HVDD_DVDD_ASIC3 Volt (in)"
351351
label in2 "PMIC-8 ASIC3_HVDD_PL0 Volt (out1)"
352352
label in3 "PMIC-8 ASIC3_DVDD_PL0 Volt (out2)"
@@ -360,7 +360,7 @@ bus "i2c-59" "i2c-9-mux (chan_id 52)"
360360
label curr3 "PMIC-8 ASIC1_HVDD_PL0 Curr (out1)"
361361
label curr4 "PMIC-8 ASIC1_DVDD_PL0 Curr (out2)"
362362

363-
chip "xdpe1a2g7-i2c-59-6c"
363+
chip "xdpe1a2g7b-i2c-59-6c"
364364
label in1 "PMIC-9 PVIN1_HVDD_DVDD_ASIC3 Volt (in)"
365365
label in2 "PMIC-9 ASIC3_HVDD_PL1 Volt (out1)"
366366
label in3 "PMIC-9 ASIC3_DVDD_PL1 Volt (out2)"

0 commit comments

Comments
 (0)