summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-01-22 20:43:11 +0300
committerMark Brown <broonie@kernel.org>2021-01-22 17:47:36 +0000
commit24be0c715617ed9bfc63fa9483f8bda1214b9763 (patch)
treecd5bc8d5e8da2ac739310d66bd80b68eee3e91c8 /drivers/regulator
parenta5872bd3398d0ff2ce4c77794bc7837899c69024 (diff)
downloadlinux-stable-24be0c715617ed9bfc63fa9483f8bda1214b9763.tar.gz
linux-stable-24be0c715617ed9bfc63fa9483f8bda1214b9763.tar.bz2
linux-stable-24be0c715617ed9bfc63fa9483f8bda1214b9763.zip
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: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20210122174311.28230-1-digetx@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index fee924158091..1a4745ec0305 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4131,7 +4131,11 @@ int regulator_sync_voltage(struct regulator *regulator)
if (ret < 0)
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:
regulator_unlock(rdev);