[U-Boot] [PATCH 2/2] MX28: Shuffle around the power management code
Stefano Babic
sbabic at denx.de
Mon Aug 20 09:52:49 CEST 2012
On 06/08/2012 23:34, Marek Vasut wrote:
> Move some function calls to a more appropriate place, so they're
> called only when needed.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Fabio Estevam <fabio.estevam at freescale.com>
> ---
> arch/arm/cpu/arm926ejs/mx28/spl_power_init.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
> index 4b09b0c..e06e6d6 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
> @@ -657,17 +657,14 @@ void mx28_power_configure_power_source(void)
>
> mx28_src_power_init();
>
> - batt_ready = mx28_is_batt_ready();
> -
> if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
> - batt_good = mx28_is_batt_good();
> + batt_ready = mx28_is_batt_ready();
> if (batt_ready) {
> /* 5V source detected, good battery detected. */
> mx28_batt_boot();
> } else {
> - if (batt_good) {
> - /* 5V source detected, low battery detceted. */
> - } else {
> + batt_good = mx28_is_batt_good();
> + if (!batt_good) {
> /* 5V source detected, bad battery detected. */
> writel(LRADC_CONVERSION_AUTOMATIC,
> &lradc_regs->hw_lradc_conversion_clr);
>
Applied to u-boot-imx, thanks.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
More information about the U-Boot
mailing list