Commit 24be0c71 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Mark Brown

regulator: Make regulator_sync_voltage() usable by coupled regulators

Make regulator_sync_voltage() to re-balance voltage state of a coupled
regulators instead of changing the voltage directly.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210122174311.28230-1-digetx@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a5872bd3
...@@ -4131,7 +4131,11 @@ int regulator_sync_voltage(struct regulator *regulator) ...@@ -4131,7 +4131,11 @@ int regulator_sync_voltage(struct regulator *regulator)
if (ret < 0) if (ret < 0)
goto out; goto out;
ret = _regulator_do_set_voltage(rdev, min_uV, max_uV); /* balance only, if regulator is coupled */
if (rdev->coupling_desc.n_coupled > 1)
ret = regulator_balance_voltage(rdev, PM_SUSPEND_ON);
else
ret = _regulator_do_set_voltage(rdev, min_uV, max_uV);
out: out:
regulator_unlock(rdev); regulator_unlock(rdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment