MLK-13793-3 regulator: anatop: Fix enable for vddpu with LDO bypass
authorIrina Tirdea <irina.tirdea@nxp.com>
Thu, 2 Feb 2017 11:08:30 +0000 (13:08 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:58:08 +0000 (14:58 -0500)
Enabling the vddpu regulator at boot has no efect, since the enable call in
anatop will set it to power gated off. This leads to a hang in the VPU driver
if cpufreq does not get initialized before.

The anatop on i.MX6 requires that vddpu uses the same voltage level as vddsoc.
When it is initialized, vddsoc will have a default selector of 0
(Power gated off), but will use LDO_FET_FULL_ON since it is in bypass mode.
However, the local value saved for the vddsoc selector will remain 0.
When vddpu is enabled, it will use the local selector 0 from vddsoc and
will remain disabled.

Take into consideration the bypass mode when using the vddsoc selector for
vddpu.

Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
drivers/regulator/anatop-regulator.c

index 9d88186..d3fbf6e 100644 (file)
@@ -96,7 +96,7 @@ static int anatop_core_regmap_enable(struct regulator_dev *reg)
         * whenever it's about to be enabled.
         */
        if (anatop_reg == vddpu && vddsoc)
-               anatop_reg->sel = vddsoc->sel;
+               anatop_reg->sel = vddsoc->bypass ? LDO_FET_FULL_ON : vddsoc->sel;
 
        sel = anatop_reg->bypass ? LDO_FET_FULL_ON : anatop_reg->sel;
        return regulator_set_voltage_sel_regmap(reg, sel);