diff options
author | Zoran Markovic <zoran.markovic@linaro.org> | 2013-08-02 13:38:02 -0700 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:51 +0900 |
commit | 9c8b6a88f2f885488b15e717bc06c4a7a50ad9da (patch) | |
tree | a5eb9f64f1e55995d8d9ad5f124a006815102826 /include/linux | |
parent | c30b5aa258374273ed1c4ee0d203a5404adc9c0b (diff) | |
download | linux-3.10-9c8b6a88f2f885488b15e717bc06c4a7a50ad9da.tar.gz linux-3.10-9c8b6a88f2f885488b15e717bc06c4a7a50ad9da.tar.bz2 linux-3.10-9c8b6a88f2f885488b15e717bc06c4a7a50ad9da.zip |
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.
Change-Id: I541e6a5d0567f2a731f14abc16fda30256ae93fe
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')
-rw-r--r-- | include/linux/power_supply.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 3828cefb4f6..69dab3084e1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -15,6 +15,7 @@ #include <linux/workqueue.h> #include <linux/leds.h> +#include <linux/spinlock.h> 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; |