linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: imx-anatop: Set default voltage selector for vddpu
@ 2014-10-06 19:33 Markus Pargmann
  2014-10-06 19:33 ` [PATCH 2/2] regulator: imx-anatop: Fail on invalid voltage selector Markus Pargmann
  2014-10-07 11:51 ` [PATCH 1/2] regulator: imx-anatop: Set default voltage selector for vddpu Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Pargmann @ 2014-10-06 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

The code reads the default voltage selector from its register. If the
bootloader disables the regulator, the default voltage selector will be
0 which results in faulty behaviour of this regulator driver.

This patch sets a default voltage selector for vddpu if it is not set in
the register.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 drivers/regulator/anatop-regulator.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 4f730af70e7c..30e8d7ad5813 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -283,6 +283,14 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 			sreg->sel = 0;
 			sreg->bypass = true;
 		}
+
+		/*
+		 * In case vddpu was disabled by the bootloader, we need to set
+		 * a sane default until imx6-cpufreq was probed and changes the
+		 * voltage to the correct value. In this case we set 1.25V.
+		 */
+		if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
+			sreg->sel = 22;
 	} else {
 		rdesc->ops = &anatop_rops;
 	}
-- 
2.1.0

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

end of thread, other threads:[~2014-10-07 11:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 19:33 [PATCH 1/2] regulator: imx-anatop: Set default voltage selector for vddpu Markus Pargmann
2014-10-06 19:33 ` [PATCH 2/2] regulator: imx-anatop: Fail on invalid voltage selector Markus Pargmann
2014-10-07 11:52   ` Mark Brown
2014-10-07 11:51 ` [PATCH 1/2] regulator: imx-anatop: Set default voltage selector for vddpu Mark Brown

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).