lkml.org 
[lkml]   [2007]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.6.24-rc1 regression] AC adapter state does not change after resume
Andrey Borzenkov wrote:
> I suspect new ACPI AC adapter code but have to add some printk's to be sure.
>
> To reproduce - plug in AC cord, suspend, unplug, resume - kpowersave and sysfs
> still show AC adapter online. Or other way round.
>
> -andrey
Please check if this patch helps.

Regards,
Alex.
ACPI: AC: Update AC state on sysfs read

From: Alexey Starikovskiy <astarikovskiy@suse.de>

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

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

diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index e03de37..bb618c8 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -91,6 +91,9 @@ static int get_ac_property(struct power_supply *psy,
union power_supply_propval *val)
{
struct acpi_ac *ac = to_acpi_ac(psy);
+
+ if (acpi_ac_get_state(ac))
+ return 0;
switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ac->state;
\
 
 \ /
  Last update: 2007-10-30 22:13    [W:0.081 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site