diff options
author | Irina Tirdea <irina.tirdea@nxp.com> | 2017-02-12 21:07:31 +0200 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:25:34 +0800 |
commit | 300950fba08e16b7755f94388d4495b05e86065e (patch) | |
tree | 31a4e30d330e25d1f01006863b9145d89d2ebf1e /drivers/regulator | |
parent | 7a859285766a17c1b4e59c4ec96a95a10b79c6d8 (diff) |
MLK-13793-6 regulator: anatop: fix min dropout for bypass mode
In bypass mode, the anatop digital regulators do not have any minimum
dropout value (the input voltage is equal to the output voltage according
to documentation).
Having a min dropout value of 125mV will lead to an increased voltage
for PMIC supplies.
Only set minimum dropout value for ldo enabled mode.
Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index e4915970f05c..7480ccdd93b8 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -38,6 +38,8 @@ #define LDO_POWER_GATE 0x00 #define LDO_FET_FULL_ON 0x1f +#define LDO_MIN_DROPOUT_UV 125000 + struct anatop_regulator { u32 control_reg; struct regmap *anatop; @@ -94,8 +96,12 @@ static int anatop_core_regmap_enable(struct regulator_dev *reg) * The vddpu has to stay at the same voltage level as vddsoc * whenever it's about to be enabled. */ - if (anatop_reg == vddpu && vddsoc) - anatop_reg->sel = vddsoc->bypass ? LDO_FET_FULL_ON : vddsoc->sel; + if (anatop_reg == vddpu && vddsoc) { + anatop_reg->sel = vddsoc->sel; + anatop_reg->bypass = vddsoc->bypass; + if (anatop_reg->bypass) + anatop_reg->rdesc.min_dropout_uV = 0; + } sel = anatop_reg->bypass ? LDO_FET_FULL_ON : anatop_reg->sel; return regulator_set_voltage_sel_regmap(reg, sel); @@ -163,6 +169,10 @@ static int anatop_regmap_set_bypass(struct regulator_dev *reg, bool enable) sel = enable ? LDO_FET_FULL_ON : anatop_reg->sel; anatop_reg->bypass = enable; + if (anatop_reg->bypass) + anatop_reg->rdesc.min_dropout_uV = 0; + else + anatop_reg->rdesc.min_dropout_uV = LDO_MIN_DROPOUT_UV; return regulator_set_voltage_sel_regmap(reg, sel); } @@ -327,7 +337,7 @@ static int anatop_regulator_probe(struct platform_device *pdev) rdesc->vsel_reg = sreg->control_reg; rdesc->vsel_mask = ((1 << sreg->vol_bit_width) - 1) << sreg->vol_bit_shift; - rdesc->min_dropout_uV = 125000; + rdesc->min_dropout_uV = LDO_MIN_DROPOUT_UV; config.dev = &pdev->dev; config.init_data = initdata; @@ -349,6 +359,7 @@ static int anatop_regulator_probe(struct platform_device *pdev) if (sreg->sel == LDO_FET_FULL_ON) { sreg->sel = 0; sreg->bypass = true; + rdesc->min_dropout_uV = 0; } /* |