Code cleanups and stability fixes
/kernel/power/earlysuspend.c
blob:ccff8c415bfbda9d0ea5f0763947ab23cf3d6fc4 -> blob:1c26be4e9015bddcf04b0a70bd1f5415b9fe08ff
--- kernel/power/earlysuspend.c
+++ kernel/power/earlysuspend.c
@@ -38,6 +38,7 @@ static DECLARE_WORK(early_suspend_work,
static DECLARE_WORK(late_resume_work, late_resume);
static DEFINE_SPINLOCK(state_lock);
enum {
+ SUSPENDED_ON = 0x0,
SUSPEND_REQUESTED = 0x1,
SUSPENDED = 0x2,
SUSPEND_REQUESTED_AND_SUSPENDED = SUSPEND_REQUESTED | SUSPENDED,
@@ -136,8 +137,12 @@ static void late_resume(struct work_stru
pr_info("[R] late_resume start\n");
mutex_lock(&early_suspend_lock);
spin_lock_irqsave(&state_lock, irqflags);
- if (state == SUSPENDED)
+ if (state == SUSPENDED) {
state &= ~SUSPENDED;
+#ifdef CONFIG_HTC_ONMODE_CHARGING
+ state_onchg &= ~SUSPEND_REQUESTED_AND_SUSPENDED;
+#endif
+ }
else
abort = 1;
spin_unlock_irqrestore(&state_lock, irqflags);