imx233: don"t be smart when waiting for voltage stabilisation

Unfortunately the hardware is not very helpful when changing voltage: in DCDC
mode we have the DC_OK_IRQ but in linear regulator mode, the only available
bit doesn't work when lowering the voltages. At the moment, simply sleep for a
little while before a better solution is found.

Change-Id: I89335873e9e42e5c6e9131f40db7839b008c021c
This commit is contained in:
Amaury Pouly 2014-02-10 22:34:18 +01:00
parent e1003b1536
commit 68163e8f49

View file

@ -383,13 +383,7 @@ void imx233_power_set_regulator(enum imx233_regulator_t reg, unsigned value_mv,
* Otherwise it is unreliable (doesn't work when lowering voltage on linregs)
* It usually takes between 0.5ms and 2.5ms */
#if IMX233_SUBTARGET >= 3700
if(!BF_RD(POWER_5VCTRL, ENABLE_DCDC))
panicf("regulator %d: wait for voltage stabilize in linreg mode !", reg);
unsigned timeout = current_tick + (HZ * 20) / 1000;
while(!BF_RD(POWER_CTRL, DC_OK_IRQ) || !TIME_AFTER(current_tick, timeout))
yield();
if(!BF_RD(POWER_CTRL, DC_OK_IRQ))
panicf("regulator %d: failed to stabilize", reg);
sleep(1);
#else
if(!BF_RD(POWER_5VCTRL, EN_DCDC1) || !BF_RD(POWER_5VCTRL, EN_DCDC2))
panicf("regulator %d: wait for voltage stabilize in linreg mode !", reg);