public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Starikovskiy <aystarik@gmail.com>
To: Ash Milsted <thatistosayiseenem@gawab.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: 2.6.24-rc1 acpi battery driver -> sysfs interface does not update correctly
Date: Wed, 24 Oct 2007 22:53:08 +0400	[thread overview]
Message-ID: <471F9494.8080503@gmail.com> (raw)
In-Reply-To: <3e7b9f4b0710241114u73ad1d4bl34070b4fd2b18d63@mail.gmail.com>

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

Ash Milsted wrote:
> Hello,
> 
> I just tried out the new RC on my laptop system, initially neglecting
> to enable ACPI_PROCFS support. Thus I was thrust into using the new
> sysfs interface for the battery.c driver. ..
> 
> Unfortunately the charge values etc do not seem to update periodically
> - only (un)plugging the AC power updates the status if ACPI_PROCFS is
> disabled.
> If ACPI_PROCFS is enabled then a read to /proc/acpi/battery/state gets
> the up-to-date data, and a subsequent read to the sysfs equivalents
> gives the same results - otherwise sysfs stays stale.
> 
> If you need any more info please say so - this is on an ageing Toshiba
> Satellite 1110.
Could you please test this patch?

> 
> Thanks,
> 
> Ash
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


[-- Attachment #2: run_update_battery_from_sysfs_read.patch --]
[-- Type: text/x-diff, Size: 1092 bytes --]

ACPI: battery: run acpi_battery_update from sysfs read

From: Alexey Starikovskiy <astarikovskiy@suse.de>

Update battery information at sysfs read.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---

 drivers/acpi/battery.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 681e26b..02a396d 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -130,6 +130,8 @@ static int acpi_battery_technology(struct acpi_battery *battery)
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 }
 
+static int acpi_battery_update(struct acpi_battery *battery);
+
 static int acpi_battery_get_property(struct power_supply *psy,
 				     enum power_supply_property psp,
 				     union power_supply_propval *val)
@@ -139,6 +141,7 @@ static int acpi_battery_get_property(struct power_supply *psy,
 	if ((!acpi_battery_present(battery)) &&
 	     psp != POWER_SUPPLY_PROP_PRESENT)
 		return -ENODEV;
+	acpi_battery_update(battery);
 	switch (psp) {
 	case POWER_SUPPLY_PROP_STATUS:
 		if (battery->state & 0x01)

  reply	other threads:[~2007-10-24 18:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 18:14 2.6.24-rc1 acpi battery driver -> sysfs interface does not update correctly Ash Milsted
2007-10-24 18:53 ` Alexey Starikovskiy [this message]
2007-10-24 19:52   ` Ash Milsted
2007-10-24 20:23     ` Ash Milsted
2007-10-24 20:32       ` Alexey Starikovskiy
2007-10-24 21:17         ` Ash Milsted
2007-10-24 21:49           ` Alexey Starikovskiy
2007-10-24 22:28             ` Ash Milsted
2007-10-24 22:37               ` Ash Milsted
2007-10-25  3:08                 ` Alexey Starikovskiy
2007-10-25  9:31                   ` Ash Milsted
2007-10-27 16:52                     ` Ash Milsted
2007-10-27 17:22                       ` Alexey Starikovskiy
2007-10-28 12:06                         ` Ash Milsted
     [not found]                           ` <3e7b9f4b0710280524u1898296ase70f70c9cd03ced0@mail.gmail.com>
2007-10-28 12:33                             ` [PATCH] ACPI: battery: Support for non-spec name for LiIon technology Alexey Starikovskiy
2007-10-28 12:40                             ` 2.6.24-rc1 acpi battery driver -> sysfs interface does not update correctly Alexey Starikovskiy
2007-10-28 12:58                           ` Alexey Starikovskiy
2007-10-28 14:03                             ` Ash Milsted
2007-10-28 14:27                               ` Alexey Starikovskiy

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=471F9494.8080503@gmail.com \
    --to=aystarik@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=thatistosayiseenem@gawab.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