diff options
author | Jonghwa Lee <jonghwa3.lee@samsung.com> | 2014-10-15 18:54:21 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-10-15 23:35:43 -0700 |
commit | 76fc7c3b0d4b26e6387cfc75361124e87789e28d (patch) | |
tree | 479584cd8f13ea6458828ee6ccbb86bcb3278e43 | |
parent | 26afb9395cd2a38c9155fd238b5872efe4e70071 (diff) | |
download | linux-3.10-76fc7c3b0d4b26e6387cfc75361124e87789e28d.tar.gz linux-3.10-76fc7c3b0d4b26e6387cfc75361124e87789e28d.tar.bz2 linux-3.10-76fc7c3b0d4b26e6387cfc75361124e87789e28d.zip |
power: charger-manager: Hold wakeup event until userspace notice.
This is workaround to let userspace notice about battery's status
chaiging during suspend and resume. It holds wakeup event to prevent
system goes into sleep. Holding wakeup event time is heuristic value
and it could be varied.
To make this works, it needs CONFIG_PM_AUTOSLEEP kernel option.
Change-Id: I22a818e69632574a2d684cd957f62b3329d57c8f
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
-rw-r--r-- | drivers/power/charger-manager.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index 0a258ee22b0..04b170d984c 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c @@ -1632,7 +1632,13 @@ static void cm_suspend_complete(struct device *dev) schedule_work(&setup_polling); } - _cm_monitor(cm); + if (_cm_monitor(cm)) { + /* FIXME: + * To notify charger manager's uevent to userspace, + * it holds wakeup event for few seconds. + */ + pm_wakeup_event(cm->dev, 3 * HZ); + } device_set_wakeup_capable(cm->dev, false); } |