Re: [PATCH] regulator: pca9450: Support regulator-off-in-suspend

Mark Brown <[email protected]> Tue, 28 Jul 2026 19:18:09 +0100
Newsgroups dev.linux.lists.imx,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Fri, Jul 24, 2026 at 05:13:22PM -0300, Fabio Estevam wrote:

> The PCA9450 uses each regulator's ENMODE field to control whether the
> regulator remains enabled when the PMIC transitions from RUN to STANDBY
> mode.

> Implement set_suspend_disable() for the buck regulators and LDO3-LDO5
> by programming ENMODE to 10b. This keeps the regulator enabled in RUN
> mode, turns it off when PMIC_STBY_REQ is asserted, and enables it again
> when the PMIC returns to RUN mode.

> +static int pca9450_buck_set_suspend_disable(struct regulator_dev *rdev)
> +{
> +	return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg,
> +				  rdev->desc->enable_mask,
> +				  BUCK_ENMODE_ONREQ_STBYREQ);
> +}
> +
> +static int pca9450_ldo_set_suspend_disable(struct regulator_dev *rdev)
> +{
> +	return regmap_update_bits(rdev->regmap, rdev->desc->enable_reg,
> +				  rdev->desc->enable_mask,
> +				  LDO_ENMODE_ONREQ_STBYREQ);
> +}

This is the same register that is used to control runtime enable, I
can't see how the runtime and suspend enable operations avoid corrupting
each other's state?
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpo8mEACgkQJNaLcl1U
h9BCCAf6A5B9Y0xt7dLLL1mO+6SSb0uwdSJPLUUXKhHn8YFbjCqomnZ+8aHbRLVY
ytZChFWjk2DPh+Du+DtN01UPbURTHbs8Mw4hy7N0iLiRvpniRA/jxCAGDiCaaHFk
88T4L7Od6RTWN0uy124T8H/T8ezPnL/vMMXv9p0vXLtSXbC7xRrsowXTMwyF2WPq
Voyyfanr2N24hUR7VS1Td6x9zK5aESfoqm0J3YeRAUcmT1bsQoQSLoZ6KmN+hMSt
nwt8Dqjt2EqKPMy0PAihltKwx4xvjxj/oeJpFyqb1iQ0VOHyzUoDhTggBH11sRBG
s5dduD4jj7RTNX6U1QSWXphsjircCw==
=1p8F
-----END PGP SIGNATURE-----