aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/earlysuspend.c
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.com>2012-09-22 09:48:20 +0200
committercodeworkx <codeworkx@cyanogenmod.com>2012-09-22 14:02:16 +0200
commit2489007e7d740ccbc3e0a202914e243ad5178787 (patch)
treeb8e6380ea7b1da63474ad68a5dba997e01146043 /kernel/power/earlysuspend.c
parent5f67568eb31e3a813c7c52461dcf66ade15fc2e7 (diff)
downloadkernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.zip
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.gz
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.bz2
merge opensource jb u5
Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
Diffstat (limited to 'kernel/power/earlysuspend.c')
-rw-r--r--kernel/power/earlysuspend.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/power/earlysuspend.c b/kernel/power/earlysuspend.c
index 1c293ce..e6303fd 100644
--- a/kernel/power/earlysuspend.c
+++ b/kernel/power/earlysuspend.c
@@ -20,6 +20,9 @@
#include <linux/syscalls.h> /* sys_sync */
#include <linux/wakelock.h>
#include <linux/workqueue.h>
+#ifdef CONFIG_ZRAM_FOR_ANDROID
+#include <asm/atomic.h>
+#endif /* CONFIG_ZRAM_FOR_ANDROID */
#include "power.h"
@@ -29,6 +32,11 @@ enum {
DEBUG_VERBOSE = 1U << 3,
};
static int debug_mask = DEBUG_USER_STATE;
+#ifdef CONFIG_ZRAM_FOR_ANDROID
+atomic_t optimize_comp_on = ATOMIC_INIT(0);
+EXPORT_SYMBOL(optimize_comp_on);
+#endif /* CONFIG_ZRAM_FOR_ANDROID */
+
module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP);
static DEFINE_MUTEX(early_suspend_lock);
@@ -94,6 +102,9 @@ static void early_suspend(struct work_struct *work)
mutex_lock(&early_suspend_lock);
spin_lock_irqsave(&state_lock, irqflags);
+#ifdef CONFIG_ZRAM_FOR_ANDROID
+ atomic_set(&optimize_comp_on, 1);
+#endif /* CONFIG_ZRAM_FOR_ANDROID */
if (state == SUSPEND_REQUESTED)
state |= SUSPENDED;
else
@@ -145,6 +156,9 @@ static void late_resume(struct work_struct *work)
mutex_lock(&early_suspend_lock);
spin_lock_irqsave(&state_lock, irqflags);
+#ifdef CONFIG_ZRAM_FOR_ANDROID
+ atomic_set(&optimize_comp_on, 0);
+#endif /* CONFIG_ZRAM_FOR_ANDROID */
if (state == SUSPENDED)
state &= ~SUSPENDED;
else
@@ -174,6 +188,9 @@ abort:
pm_wd_del_timer(&timer);
}
+#ifdef CONFIG_FAST_BOOT
+extern bool fake_shut_down;
+#endif
void request_suspend_state(suspend_state_t new_state)
{
unsigned long irqflags;
@@ -198,6 +215,10 @@ void request_suspend_state(suspend_state_t new_state)
state |= SUSPEND_REQUESTED;
queue_work(suspend_work_queue, &early_suspend_work);
} else if (old_sleep && new_state == PM_SUSPEND_ON) {
+#ifdef CONFIG_FAST_BOOT
+ if (fake_shut_down)
+ fake_shut_down = false;
+#endif
state &= ~SUSPEND_REQUESTED;
wake_lock(&main_wake_lock);
queue_work(suspend_work_queue, &late_resume_work);