All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Richard Hughes <hughsient@gmail.com>
Cc: 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 22:00:16 +0300	[thread overview]
Message-ID: <497A13C0.5020604@suse.de> (raw)
In-Reply-To: <1232729843.3504.6.camel@hughsie-work.lan>

Hi Richard,

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.

Regards,
Alex.


Richard Hughes wrote:
> When I insert the power lead or attach my T61 to the powered dock, the
> battery power supply status goes like this:
> 
> 0.00s Discharging
> {dock}
> 0.10s Fully charged
> 1.00s Charging
> 
> This causes userspace (in my case gnome-power-manager) to pop up a
> dialog telling me the battery is full, and the icon flickers to fully
> green, then 10% green and charging.
> 
> This seems to have existed as long as the power supply class was being
> used by the acpi battery, but we've always relied on a userspace fudge.
> 
> This is tested with 2.6.27.9-159.fc10.i686, although I seem to get the
> same thing with git from kernel.org.
> 
> Is this a known issue? Does anybody have any insight into what causes
> this? I'm fully willing to test patches or debug this further myself.
> 
> Thanks,
> 
> Richard.
> 
> 


  reply	other threads:[~2009-01-23 19:00 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 [this message]
2009-01-23 22:02   ` Henrique de Moraes Holschuh
2009-01-23 23:39     ` Richard Hughes
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=497A13C0.5020604@suse.de \
    --to=astarikovskiy@suse.de \
    --cc=hughsient@gmail.com \
    --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 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.