ACPI / battery: wakeup the system only when necessary
authorZhang Rui <rui.zhang@intel.com>
Wed, 28 May 2014 07:23:38 +0000 (15:23 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 30 May 2014 11:45:25 +0000 (13:45 +0200)
commite0d1f09e311fafa33b4bfd942c852671ce25ae58
tree8616a1b7cdff33967a4a55e90b83ecce764f9735
parent9113e260767b1cb44f8da0e5922e1a9a5417c4b8
ACPI / battery: wakeup the system only when necessary

ACPI Battery device receives notifications from firmware frequently,
and most of these notifications are some general events, like battery
remaining capacity change, etc, which should not wake the system up
if the system is in suspend/hibernate state.

This causes a problem that the system wakes up from suspend to freeze
shortly, because there is an ACPI battery notification every 10 seconds.

Fix the problem in this patch by registering ACPI battery device'
own wakeup source, and waking up the system only when the battery remaining
capacity is critical low, or lower than the alarm capacity set via _BTP.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=76221
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c