All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 15/16] arm:trats:pmic: Support for charging battery at Samsung's TRATS board
Date: Fri, 14 Sep 2012 10:32:13 -0700	[thread overview]
Message-ID: <20120914173213.GE22028@bill-the-cat> (raw)
In-Reply-To: <1347637215-4830-16-git-send-email-l.majewski@samsung.com>

On Fri, Sep 14, 2012 at 05:40:14PM +0200, Lukasz Majewski wrote:

> The battery connected to Samsung's Trats development board is now
> charged when voltage drops below threshold.
[snip]
> @@ -247,6 +250,40 @@ int power_board_init(void)
>  	pmic_init_max8997();
>  	power_fg_init(I2C_9);
>  	power_muic_init(I2C_5);
> +
> +	chrg = power_chrg_get_type();
> +	debug("CHARGER TYPE: %d\n", chrg);
> +
> +	if (!pmic_charger_bat_present()) {
> +		puts("No battery detected\n");
> +		return -1;
> +	}
> +
> +	power_check_battery(&bat);
> +
> +	if (bat.state == CHARGE && chrg == CHARGER_USB) {
> +		puts("CHARGER ENABLE\n");
> +		if (pmic_charger_state(CHARGER_ENABLE, 450))
> +			return -1;
> +
> +		for (k = 0; pmic_charger_bat_present() &&
> +			     power_chrg_get_type() &&
> +			     bat.state_of_chrg < 5; k++) {
> +			udelay(10000000);
> +			puts(".");
> +			power_update_battery(&bat);
> +
> +			if (k == 100) {
> +				printf(" %d [V]\n", bat.voltage_uV);
> +				k = 0;
> +			}
> +
> +		}
> +
> +		puts("CHARGER DISABLE\n");
> +		pmic_charger_state(CHARGER_DISABLE, 0);
> +	}

If I read this right we'll pause in the middle of start up to charge the
battery for possibly a long time right?  And this could be a while loop
even, yes?  If so to the first one, this really should be under some
sort of CONFIG option.  I know the value of showing proof of concept
type examples in development boards but that should still be an opt-in
thing I would think.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120914/f5af9820/attachment.pgp>

  reply	other threads:[~2012-09-14 17:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 15:39 [U-Boot] [PATCH 00/16] pmic: Redesign PMIC framework to support multiple instances of devices Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 01/16] pmic:i2c: Handle PMIC I2C transmission comprising of two bytes Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 02/16] pmic:i2c: Add I2C byte order to PMIC framework Lukasz Majewski
2012-09-17  9:33   ` Stefano Babic
2012-09-17 20:41     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 03/16] pmic:max8997: Switch the MAX8997 PMIC to be used with multibus I2C Lukasz Majewski
2012-09-17  9:36   ` Stefano Babic
2012-09-17 20:46     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 04/16] pmic: Extend PMIC framework to support multiple instances of PMIC devices Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 05/16] pmic: Introduce power_board_init() method at ./lib/board.c file Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 06/16] pmic: Enable power_board_init() support at TRATS Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 07/16] pmic:chrg: Common information about charger and battery (power_chrg.h) Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 08/16] pmic:muic: Support for MUIC built into MAX8997 device Lukasz Majewski
2012-09-17  9:51   ` Stefano Babic
2012-09-17 21:05     ` Lukasz Majewski
2012-10-02 12:49     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 09/16] pmic:fuel-gauge: Support for MAX17042 fuel-gauge Lukasz Majewski
2012-09-14 17:23   ` Tom Rini
2012-09-17 20:59     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 10/16] pmic:max8997: Function for calculating LDO internal register value Lukasz Majewski
2012-09-14 17:24   ` Tom Rini
2012-09-17 20:57     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 11/16] arm:trats:pmic: Default PMIC(MAX8997) initialization for Samsung's TRATS board Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 12/16] arm:trats:pmic: Enable MUIC (MAX8997) at " Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 13/16] arm:trats:pmic: Enable fuel-gauge (MAX17042) " Lukasz Majewski
2012-09-14 17:26   ` Tom Rini
2012-09-17 20:56     ` Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 14/16] pmic:max8997: Support for MAX8997 internal charger control Lukasz Majewski
2012-09-14 15:40 ` [U-Boot] [PATCH 15/16] arm:trats:pmic: Support for charging battery at Samsung's TRATS board Lukasz Majewski
2012-09-14 17:32   ` Tom Rini [this message]
2012-09-17 20:55     ` Lukasz Majewski
2012-09-17 21:27       ` Tom Rini
2012-09-14 15:40 ` [U-Boot] [PATCH 16/16] arm:trats:pmic: Power consumption reduction state for " Lukasz Majewski
2012-09-14 17:35 ` [U-Boot] [PATCH 00/16] pmic: Redesign PMIC framework to support multiple instances of devices Tom Rini
2012-09-17 20:49   ` Lukasz Majewski

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=20120914173213.GE22028@bill-the-cat \
    --to=trini@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.