From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] MX28: Shuffle around the power management code
Date: Mon, 20 Aug 2012 09:52:49 +0200 [thread overview]
Message-ID: <5031ECD1.5040200@denx.de> (raw)
In-Reply-To: <1344288895-11934-2-git-send-email-marex@denx.de>
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@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@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
=====================================================================
next prev parent reply other threads:[~2012-08-20 7:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 21:34 [U-Boot] [PATCH 1/2] MX28: Drop the cp15 reconfiguration from SPL Marek Vasut
2012-08-06 21:34 ` [U-Boot] [PATCH 2/2] MX28: Shuffle around the power management code Marek Vasut
2012-08-17 11:05 ` Stefano Babic
2012-08-20 7:52 ` Stefano Babic [this message]
2012-08-17 11:04 ` [U-Boot] [PATCH 1/2] MX28: Drop the cp15 reconfiguration from SPL Stefano Babic
2012-08-20 7:52 ` Stefano Babic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5031ECD1.5040200@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox