From bee42c631116d61edbec7853b8791598369571b3 Mon Sep 17 00:00:00 2001 From: Abdurrahman Hussain Date: Fri, 19 Jun 2026 23:44:57 -0700 Subject: [PATCH] hwmon: (pmbus/xdpe1a2g7b) Add regulator support 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 Link: https://lore.kernel.org/r/20260619-xdpe1a2g7b-v1-1-428c3847be0d@nexthop.ai Signed-off-by: Guenter Roeck --- 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 b308fcee7405..68fadd8fe589 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -822,6 +822,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)