diff options
author | =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com> | 2011-12-02 14:04:42 +0800 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2012-02-14 14:30:09 -0800 |
commit | 9638347548f80e5a3da64236258230a5ec481e67 (patch) | |
tree | b365fd1bd9c5754966fc51a792a8c3aa9857b59c /include | |
parent | db14c1441e2f29cfc0a46a667ed6e1859c35ed88 (diff) |
power_supply: Hold a wake_lock while power supply change notifications are pending
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When connecting usb or the charger the device would often go back to sleep
before the charge led and screen turned on.
Change-Id: I01def6d86ddece0d4e31d2a91d176ed0975b6b9d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/power_supply.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index fa9b962aec1..729c6a977fa 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -14,6 +14,7 @@ #define __LINUX_POWER_SUPPLY_H__ #include <linux/device.h> +#include <linux/wakelock.h> #include <linux/workqueue.h> #include <linux/leds.h> @@ -171,6 +172,9 @@ struct power_supply { /* private */ struct device *dev; struct work_struct changed_work; + spinlock_t changed_lock; + bool changed; + struct wake_lock work_wake_lock; #ifdef CONFIG_LEDS_TRIGGERS struct led_trigger *charging_full_trig; |