[PATCH v2 2/3] regulator: pfuze100: add set_suspend_disable for LDO ops

From: Joy Zou

Date: Fri Jul 31 2026 - 06:38:19 EST


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@xxxxxxxxxxx>
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
---
Changes in v2:
- Rename the callback to pfuze100_ldo_set_suspend_disable since it is
only wired into the LDO ops.
- Use the per-regulator stby_reg/stby_mask instead of a hardcoded
VGENxSTBY/VGENxLPWR bit.
- Link to v1: https://patch.msgid.link/20260716-b4-regulator-pf01-v1-0-8c1519d54bd4@xxxxxxxxxxx
---
drivers/regulator/pfuze100-regulator.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index 7d56c22b5e40..d3a0e2505524 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -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 = {

--
2.34.1