regulator: anatop: Set default voltage selector for vddpu
authorMarkus Pargmann <mpa@pengutronix.de>
Mon, 6 Oct 2014 19:33:36 +0000 (21:33 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 20 Oct 2014 11:23:41 +0000 (12:23 +0100)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
drivers/regulator/anatop-regulator.c

index 4f730af70e7c8b650bc7ef144f7c147e523b5eea..30e8d7ad5813431c3ff7bdfdc3fbd300ea036eb7 100644 (file)
@@ -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;
        }