From 948dcf96622814d2a850a12851d27824530a9747 Mon Sep 17 00:00:00 2001 From: Zoran Markovic Date: Fri, 2 Aug 2013 13:38:02 -0700 Subject: power_supply: Prevent suspend until power supply events are processed This patch, originally authored by Arve Hjonnevag and Todd Poynor, prevents the system from entering suspend mode until the power supply plug, unplug, or any other change of state event is fully processed. This guarantees that the screen lights up and displays the battery charging state. The implementation uses the power supply wakeup_source object. Cc: David Woodhouse Cc: Arve Hjonnevag Cc: Todd Poynor Cc: John Stultz Signed-off-by: Zoran Markovic Signed-off-by: Anton Vorontsov --- include/linux/power_supply.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/power_supply.h') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 804b90643a85..5c2600630dc9 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -15,6 +15,7 @@ #include #include +#include struct device; @@ -194,6 +195,8 @@ struct power_supply { /* private */ struct device *dev; struct work_struct changed_work; + spinlock_t changed_lock; + bool changed; #ifdef CONFIG_THERMAL struct thermal_zone_device *tzd; struct thermal_cooling_device *tcd; -- cgit v1.2.3