regulator: pfuze100: add set_suspend_disable for LDO ops

Add a set_suspend_disable callback to pfuze100_ldo_regulator_ops to
support the regulator-off-in-suspend DTS property for the VGEN LDO
regulators. This allows unused LDO regulators to be properly disabled
during system suspend, reducing power consumption.

The callback is only used by the LDO ops, so name it accordingly:
pfuze100_ldo_set_suspend_disable. It uses the per-regulator
stby_reg/stby_mask that already describe the standby control for
each LDO, so it works for every LDO covered by these ops.

Signed-off-by: Joy Zou <joy.zou@oss.nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260731-b4-regulator-pf01-v2-2-a406c8737fdb@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Joy Zou 2026-07-31 18:21:44 +08:00 committed by Mark Brown
parent 03eab318ce
commit 7595f50ff8
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -158,6 +158,25 @@ static int pfuze100_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
return ret;
}
static int pfuze100_ldo_set_suspend_disable(struct regulator_dev *rdev)
{
struct pfuze_chip *pfuze100 = rdev_get_drvdata(rdev);
int id = rdev_get_id(rdev);
struct pfuze_regulator *desc = &pfuze100->regulator_descs[id];
/*
* Set the standby bit so the LDO output is turned off when the PMIC
* receives a STANDBY event, using the per-regulator stby_reg/stby_mask
* that describe the standby control for each LDO.
*
* The stby_mask only covers the VGENxSTBY bit. The VGENxLPWR stays at
* its reset value of 0, so the LDO is switched off rather than put
* into low-power mode.
*/
return regmap_update_bits(pfuze100->regmap, desc->stby_reg,
desc->stby_mask, desc->stby_mask);
}
static const struct regulator_ops pfuze100_ldo_regulator_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
@ -165,6 +184,7 @@ static const struct regulator_ops pfuze100_ldo_regulator_ops = {
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_suspend_disable = pfuze100_ldo_set_suspend_disable,
};
static const struct regulator_ops pfuze100_fixed_regulator_ops = {