Thread (121 messages) 121 messages, 7 authors, 2021-01-12
STALE2013d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 08/48] regulator: Make regulator_sync_voltage() usable by coupled regulators

From: Dmitry Osipenko <digetx@gmail.com>
Date: 2020-12-17 18:09:18
Also in: dri-devel, linux-clk, linux-media, linux-tegra, lkml
Subsystem: the rest, voltage and current regulator framework · Maintainers: Linus Torvalds, Liam Girdwood, Mark Brown

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

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/regulator/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ca03d8e70bd1..576efb815eb8 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4131,6 +4131,12 @@ int regulator_sync_voltage(struct regulator *regulator)
 	if (ret < 0)
 		goto out;
 
+	/* balance only if there are regulators coupled */
+	if (rdev->coupling_desc.n_coupled > 1) {
+		ret = regulator_balance_voltage(rdev, PM_SUSPEND_ON);
+		goto out;
+	}
+
 	ret = _regulator_do_set_voltage(rdev, min_uV, max_uV);
 
 out:
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help