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 <abdurrahman@nexthop.ai>
Link: https://lore.kernel.org/r/20260619-xdpe1a2g7b-v1-1-428c3847be0d@nexthop.ai
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Abdurrahman Hussain 2026-06-19 23:44:57 -07:00 committed by Guenter Roeck
parent 6a9ad0ac9b
commit bee42c6311
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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)