All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/7] power: supply: cpcap-battery: Fix low battery check
Date: Sun, 5 May 2019 21:14:12 +0200	[thread overview]
Message-ID: <20190505191412.GA4050@amd> (raw)
In-Reply-To: <20190407181254.64537-3-tony@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On Sun 2019-04-07 11:12:49, Tony Lindgren wrote:
> We need to check current instead of the charge counter to see if
> a charger is connected. The charge counter shows the cumulated value
> instead of the current charge current and can be negative or positive.
> 

Acked-by: Pavel Machek <pavel@ucw.cz>

> Signed-off-by: Tony Lindgren <tony@atomide.com>


> ---
>  drivers/power/supply/cpcap-battery.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
> --- a/drivers/power/supply/cpcap-battery.c
> +++ b/drivers/power/supply/cpcap-battery.c
> @@ -562,11 +562,11 @@ static irqreturn_t cpcap_battery_irq_thread(int irq, void *data)
>  
>  	switch (d->action) {
>  	case CPCAP_BATTERY_IRQ_ACTION_BATTERY_LOW:
> -		if (latest->counter_uah >= 0)
> +		if (latest->current_ua >= 0)
>  			dev_warn(ddata->dev, "Battery low at 3.3V!\n");
>  		break;
>  	case CPCAP_BATTERY_IRQ_ACTION_POWEROFF:
> -		if (latest->counter_uah >= 0) {
> +		if (latest->current_ua >= 0) {
>  			dev_emerg(ddata->dev,
>  				  "Battery empty at 3.1V, powering off\n");
>  			orderly_poweroff(true);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2019-05-05 19:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07 18:12 [PATCH 0/7] Some fixes and improvments for cpcap battery and charger Tony Lindgren
2019-04-07 18:12 ` [PATCH 1/7] power: supply: cpcap-battery: Fix division by zero Tony Lindgren
2019-04-08 12:01   ` Pavel Machek
2019-04-07 18:12 ` [PATCH 2/7] power: supply: cpcap-battery: Fix low battery check Tony Lindgren
2019-05-05 19:14   ` Pavel Machek [this message]
2019-04-07 18:12 ` [PATCH 3/7] power: supply: cpcap-battery: Fix signed counter sample register Tony Lindgren
2019-04-08 12:03   ` Pavel Machek
2019-04-07 18:12 ` [PATCH 4/7] power: supply: cpcap-battery: Fix coulomb counter calibration register use Tony Lindgren
2019-04-08 12:03   ` Pavel Machek
2019-04-07 18:12 ` [PATCH 5/7] power: supply: cpcap-battery: Use accumulator for current and power average Tony Lindgren
2019-04-07 18:12 ` [PATCH 6/7] power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings Tony Lindgren
2019-04-08 12:04   ` Pavel Machek
2019-04-07 18:12 ` [PATCH 7/7] power: supply: cpcap-charger: " Tony Lindgren
2019-04-15 21:31 ` [PATCH 0/7] Some fixes and improvments for cpcap battery and charger Sebastian Reichel
2019-05-18 18:33 ` Tony Lindgren

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=20190505191412.GA4050@amd \
    --to=pavel@ucw.cz \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /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.