linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: adding disable options for regulator-always-on and regulator-boots-on
@ 2014-11-03  1:26 Hugh Kang
  2014-11-03 10:00 ` Markus Pargmann
  2014-11-03 12:03 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Hugh Kang @ 2014-11-03  1:26 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Mark Brown, linux-kernel, jonghoon.park, hugh.kang

From: "hugh.kang" <hugh.kang@lge.com>

If a regulator is set by always-on option, the regulator will be set forever.
For example, suppose LDO1 is set to always-on at RevA.dts with including of a.dtsi. After that
RevB.dts may wants to include the same a.dtsi but override the LDO1 always-on option. However,
currently there is no way to delete the always-on option, even when we change the LDO1 option value,
the always-on setting is still remains.

Signed-off-by: hugh.kang <hugh.kang@lge.com>
---
 drivers/regulator/of_regulator.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index ee5e67b..4178dbd 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -52,7 +52,13 @@ static void of_get_regulation_constraints(struct device_node *np,
 		constraints->valid_ops_mask |= REGULATOR_CHANGE_CURRENT;
 
 	constraints->boot_on = of_property_read_bool(np, "regulator-boot-on");
+	if (of_property_read_bool(np, "regulator-disable-boot-on"))
+		constraints->boot_on = false;
+
 	constraints->always_on = of_property_read_bool(np, "regulator-always-on");
+	if (of_property_read_bool(np, "regulator-disable-always-on"))
+		constraints->always_on = false;
+
 	if (!constraints->always_on) /* status change should be possible. */
 		constraints->valid_ops_mask |= REGULATOR_CHANGE_STATUS;
 
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-06  6:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03  1:26 [PATCH] regulator: adding disable options for regulator-always-on and regulator-boots-on Hugh Kang
2014-11-03 10:00 ` Markus Pargmann
2014-11-03 12:03 ` Mark Brown
2014-11-04  8:20   ` Hugh Kang
2014-11-04 14:11     ` Krzysztof Kozłowski
2014-11-04 19:56     ` Mark Brown
2014-11-06  6:39       ` Hugh Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).