public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Hughes <hughsient@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>,
	linux-acpi <linux-acpi@vger.kernel.org>, mjg <mjg@redhat.com>,
	Matthias Clasen <mclasen@redhat.com>
Subject: Re: ACPI battery driver emits POWER_SUPPLY_STATUS_FULL when power lead plugged in
Date: Fri, 23 Jan 2009 23:39:41 +0000	[thread overview]
Message-ID: <1232753981.3504.10.camel@hughsie-work.lan> (raw)
In-Reply-To: <20090123220243.GB26701@khazad-dum.debian.net>

On Fri, 2009-01-23 at 20:02 -0200, Henrique de Moraes Holschuh wrote:
> On Fri, 23 Jan 2009, Alexey Starikovskiy wrote:
> > This is probably related to this piece of code (drivers/acpi/battery.c),
> > similar code exists in drivers/acpi/sbs.c, but it is not relevant to your case:
> > 	case POWER_SUPPLY_PROP_STATUS:
> > 		if (battery->state & 0x01)
> > 			val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
> > 		else if (battery->state & 0x02)
> > 			val->intval = POWER_SUPPLY_STATUS_CHARGING;
> > 		else if (battery->state == 0)
> > 			val->intval = POWER_SUPPLY_STATUS_FULL;
> > 		else
> > 			val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
> > 		break;
> >
> > Actually, state==0 means POWER_SUPPLY_STATUS_NOT_CHARGING, so if that is preferred it could be changed.
> 
> It should be fixed, yes.  Batteries being idle without being full are really
> common in laptops with battery-life-saving functions (charge/stop-charge
> threshold control).

I suspected this might be the case. Is there a way we can get true
battery state out of acpi for the battery? I always thought there could
be two booleans: charging and discharging.

I guess fully charged isn't just !charging and !discharging.

Richard.



  reply	other threads:[~2009-01-23 23:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23 16:57 ACPI battery driver emits POWER_SUPPLY_STATUS_FULL when power lead plugged in Richard Hughes
2009-01-23 19:00 ` Alexey Starikovskiy
2009-01-23 22:02   ` Henrique de Moraes Holschuh
2009-01-23 23:39     ` Richard Hughes [this message]
2009-01-24  0:14       ` Alexey Starikovskiy
2009-01-24 12:41         ` Henrique de Moraes Holschuh
2009-01-24 16:37           ` Alexey Starikovskiy
2009-01-25 10:28             ` [patch] " Richard Hughes
2009-01-25 10:55               ` Alexey Starikovskiy
2009-01-25 13:42               ` Henrique de Moraes Holschuh
2009-01-25 15:13                 ` Richard Hughes
2009-01-25 19:50                   ` Alexey Starikovskiy
2009-01-26  8:43                     ` Richard Hughes
2009-01-28 13:20                 ` [patch] ACPI battery driver emits POWER_SUPPLY_STATUS_FULL when power lead plugged in (resend) Richard Hughes
2009-01-30 14:07                   ` Henrique de Moraes Holschuh
2009-02-08  3:59                     ` Len Brown
2009-02-08 10:08                       ` Richard Hughes

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=1232753981.3504.10.camel@hughsie-work.lan \
    --to=hughsient@gmail.com \
    --cc=astarikovskiy@suse.de \
    --cc=hmh@hmh.eng.br \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mclasen@redhat.com \
    --cc=mjg@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox