summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPritesh Raithatha <praithatha@nvidia.com>2012-04-11 18:41:10 +0800
committerSimone Willett <swillett@nvidia.com>2012-05-09 11:33:17 -0700
commit1f6f57a147e01cc0b987185588334ece1d6cf2bb (patch)
tree1086947f25bd19c45917e2937f04dab87ce994eb /drivers
parent446b1ef096686dade535c7316e536d3d743c0331 (diff)
power: bq27x00: start/stop delayed work upon suspend/resume
Cancel delayed work upon suspend and schedule it on resume Bug 917914 Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/95833 (cherry picked from commit a191d13e9dcdae715c9e03e1980857d00c082dc5) Change-Id: Ib8292daed3b4115657b1a66e1382ed7c1c448071 Reviewed-on: http://git-master/r/97080 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com> Tested-by: Sang-Hun Lee <sanlee@nvidia.com> GVS: Gerrit_Virtual_Submit <kchilds@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/power/bq27x00_battery.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index e392f4dc77de..857deb8faa0a 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -885,6 +885,9 @@ static int bq27x00_battery_suspend(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct bq27x00_device_info *di = platform_get_drvdata(pdev);
+ cancel_delayed_work_sync(&di->work);
+ cancel_delayed_work_sync(&di->external_power_changed_work);
+
if (di->chip == BQ27510) {
ret = bq27x00_write(di, BQ27510_CNTL,
BQ27510_CNTL_SET_SLEEP, false);
@@ -920,6 +923,9 @@ static int bq27x00_battery_resume(struct device *dev)
return ret;
}
}
+
+ schedule_delayed_work(&di->work, HZ);
+
return 0;
}