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>pull/10/head
parent
6ff91fa303
commit
859b079392
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue