diff options
author | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-25 15:36:59 +0100 |
---|---|---|
committer | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-25 15:36:59 +0100 |
commit | f93b0d346a465f6659cf8a15632309906f5a5bc5 (patch) | |
tree | 5e157678d33962c7384cd6c88f6d71595144990c | |
parent | 309540bbfae763a1f61934350e8fbd70aa32e30f (diff) |
ccxmx53 da9052: Fix I2C access error before suspend
Move the battery monitoring kernel thread schedule to the end of the
thread. Before the thread was sleeping just after the freezing check.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
-rw-r--r-- | drivers/power/da9052-ccxmx53js-battery.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/power/da9052-ccxmx53js-battery.c b/drivers/power/da9052-ccxmx53js-battery.c index 3ec7b73e9306..d52e1761cf0d 100644 --- a/drivers/power/da9052-ccxmx53js-battery.c +++ b/drivers/power/da9052-ccxmx53js-battery.c @@ -557,13 +557,14 @@ static s32 monitoring_thread(void *data) set_freezable(); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(chg_device->monitoring_interval); + while (monitoring_thread_state == ACTIVE) { /* Make this thread friendly to system suspend and resume */ try_to_freeze(); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(chg_device->monitoring_interval); da9052_charger_status_update(chg_device); @@ -584,6 +585,9 @@ static s32 monitoring_thread(void *data) } } else DA9052_DEBUG("Battery Measurement Fails = %d\n", ret); + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(chg_device->monitoring_interval); } complete_and_exit(&monitoring_thread_notifier, 0); |