[PATCH] hwmon: (pmbus/xdpe1a2g7b) Add regulator support

From: Abdurrahman Hussain

Date: Sat Jun 20 2026 - 02:45:08 EST


Register both dual-loop output channels with the regulator framework by
populating regulator_desc[] and num_regulators in pmbus_driver_info.
This exposes the standard PMBus OPERATION-based on/off control and
status reporting to consumer drivers.

Signed-off-by: Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>
---
The new SENSORS_XDPE1A2G7B_REGULATOR Kconfig and the ifdef-guarded
regulator_desc array mirror the opt-in pattern already used by the
XDPE122 driver (SENSORS_XDPE122_REGULATOR), so the REGULATOR dependency
stays optional for users that only need hwmon monitoring.
---
drivers/hwmon/pmbus/Kconfig | 10 ++++++++++
drivers/hwmon/pmbus/xdpe1a2g7b.c | 11 +++++++++++
2 files changed, 21 insertions(+)

diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index c8cda160b5f8..78146f27585a 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -803,6 +803,16 @@ config SENSORS_XDPE1A2G7B
This driver can also be built as a module. If so, the module will
be called xdpe1a2g7b.

+config SENSORS_XDPE1A2G7B_REGULATOR
+ bool "Regulator support for XDPE1A2G7B and compatibles"
+ depends on SENSORS_XDPE1A2G7B && REGULATOR
+ help
+ If you say yes here you get regulator support for Infineon
+ XDPE1A2G5B and XDPE1A2G7B multi-phase digital controllers.
+
+ This enables the controllers to be used as regulator devices,
+ providing voltage control through the regulator framework.
+
config SENSORS_XDPE122
tristate "Infineon XDPE122 family"
help
diff --git a/drivers/hwmon/pmbus/xdpe1a2g7b.c b/drivers/hwmon/pmbus/xdpe1a2g7b.c
index 971e7b73752e..9455ef443b2b 100644
--- a/drivers/hwmon/pmbus/xdpe1a2g7b.c
+++ b/drivers/hwmon/pmbus/xdpe1a2g7b.c
@@ -57,6 +57,13 @@ static int xdpe1a2g7b_identify(struct i2c_client *client,
return 0;
}

+#if IS_ENABLED(CONFIG_SENSORS_XDPE1A2G7B_REGULATOR)
+static const struct regulator_desc xdpe1a2g7b_reg_desc[] = {
+ PMBUS_REGULATOR("vout", 0),
+ PMBUS_REGULATOR("vout", 1),
+};
+#endif
+
static struct pmbus_driver_info xdpe1a2g7b_info = {
.pages = XDPE1A2G7B_PAGE_NUM,
.identify = xdpe1a2g7b_identify,
@@ -72,6 +79,10 @@ static struct pmbus_driver_info xdpe1a2g7b_info = {
.func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | PMBUS_HAVE_STATUS_INPUT,
+#if IS_ENABLED(CONFIG_SENSORS_XDPE1A2G7B_REGULATOR)
+ .num_regulators = XDPE1A2G7B_PAGE_NUM,
+ .reg_desc = xdpe1a2g7b_reg_desc,
+#endif
};

static int xdpe1a2g7b_probe(struct i2c_client *client)

---
base-commit: 9ecfb2f7287a967b418ba69f10d45ead0d360593
change-id: 20260619-xdpe1a2g7b-a3365760fb20

Best regards,
--
Abdurrahman Hussain <abdurrahman@xxxxxxxxxx>