diff options
author | Marek Vasut <marex@denx.de> | 2012-08-06 11:34:55 (GMT) |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-09-01 12:58:25 (GMT) |
commit | fdb00b81277d4ad2c5a88132d62a5c288741863a (patch) | |
tree | e09aa4c2736235e34afc722747b2b071517209cb | |
parent | 1b0f5597fbb4c9cdfc72ac9db74a83ca290f3946 (diff) | |
download | u-boot-fsl-qoriq-fdb00b81277d4ad2c5a88132d62a5c288741863a.tar.xz |
MX28: Shuffle around the power management code
Move some function calls to a more appropriate place, so they're
called only when needed.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
-rw-r--r-- | arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index 35106ba..4b917bd 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -661,17 +661,14 @@ void mxs_power_configure_power_source(void) mxs_src_power_init(); - batt_ready = mxs_is_batt_ready(); - if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) { - batt_good = mxs_is_batt_good(); + batt_ready = mxs_is_batt_ready(); if (batt_ready) { /* 5V source detected, good battery detected. */ mxs_batt_boot(); } else { - if (batt_good) { - /* 5V source detected, low battery detceted. */ - } else { + batt_good = mxs_is_batt_good(); + if (!batt_good) { /* 5V source detected, bad battery detected. */ writel(LRADC_CONVERSION_AUTOMATIC, &lradc_regs->hw_lradc_conversion_clr); |