regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback
PATCH 1/1 regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback
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.
--- drivers/regulator/qcom-rpmh-regulator.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/regulator/qcom-rpmh-regulator.c +4 -0
@@ -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
Signature · 1 line
2.56.0
Mark Brown
maintainerQuoted 1 line · Jesse Casco
regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.5
Thanks!
[1/1] regulator: qcom-rpmh: Don't overwrite the initial mode with the boot readback
https://git.kernel.org/broonie/regulator/c/d979b7807189
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark