mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback
@ 2026-11-12 16:09 Jesse Casco
  0 siblings, 0 replies; only message in thread
From: Jesse Casco @ 2026-11-12 16:09 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Kamal Wadhwa, linux-arm-msm, linux-kernel

rpmh_regulator_init_vreg() registers the regulator, and
set_machine_constraints() applies regulator-initial-mode (or the mode
derived from regulator-system-load) through ->set_mode(), caching it in
vreg->mode. Probe then calls rpmh_regulator_determine_initial_mode()
unconditionally, which for an enabled regulator overwrites vreg->mode
with the RPMh boot readback (mapping a raw mode of 0 to the lowest
supported mode).

Skip rpmh_regulator_determine_initial_mode() when registration has
already set vreg->mode. Leaving vreg->bypassed clear also matches the
non-bypass mode request that ->set_mode() just sent.

Fixes: 09d99ff7fc3c ("regulator: qcom-rpmh: readback voltage/bypass/mode set during bootup")
Cc: stable@vger.kernel.org
Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
---
 drivers/regulator/qcom-rpmh-regulator.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 08e39499be86..da4764ffa632 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -1961,6 +1961,10 @@ static int rpmh_regulator_probe(struct platform_device *pdev)
 		if (ret < 0)
 			return ret;
 
+		/* Keep a mode already applied by set_machine_constraints() */
+		if (vreg->mode != REGULATOR_MODE_INVALID)
+			continue;
+
 		ret = rpmh_regulator_determine_initial_mode(vreg);
 		if (ret < 0)
 			dev_err(dev, "failed to read initial mode for %s\n",

base-commit: a2a6f6b0b394eda55bd3483ecafbdc8228819a98
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-12 16:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 16:09 [PATCH] regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback Jesse Casco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®