aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorZoran Markovic <zoran.markovic@linaro.org>2013-08-02 16:38:02 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-08-27 21:42:48 -0400
commit948dcf96622814d2a850a12851d27824530a9747 (patch)
tree8008f2495a9ce1da410bb94fe1231c6503b01236 /include/linux/power_supply.h
parenta2c0206ad6a32b9f7287c87f20060ba59222f3b3 (diff)
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 <dwmw2@infradead.org> Cc: Arve Hjonnevag <arve@android.com> Cc: Todd Poynor <toddpoynor@google.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r--include/linux/power_supply.h3
1 files changed, 3 insertions, 0 deletions
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 @@
15 15
16#include <linux/workqueue.h> 16#include <linux/workqueue.h>
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/spinlock.h>
18 19
19struct device; 20struct device;
20 21
@@ -194,6 +195,8 @@ struct power_supply {
194 /* private */ 195 /* private */
195 struct device *dev; 196 struct device *dev;
196 struct work_struct changed_work; 197 struct work_struct changed_work;
198 spinlock_t changed_lock;
199 bool changed;
197#ifdef CONFIG_THERMAL 200#ifdef CONFIG_THERMAL
198 struct thermal_zone_device *tzd; 201 struct thermal_zone_device *tzd;
199 struct thermal_cooling_device *tcd; 202 struct thermal_cooling_device *tcd;