Messages in this thread Patch in this message | | | Date | Wed, 31 Oct 2007 00:09:32 +0300 | From | Alexey Starikovskiy <> | Subject | Re: [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; | |