diff options
author | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-22 09:48:20 +0200 |
---|---|---|
committer | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-22 14:02:16 +0200 |
commit | 2489007e7d740ccbc3e0a202914e243ad5178787 (patch) | |
tree | b8e6380ea7b1da63474ad68a5dba997e01146043 /kernel/power/wakelock.c | |
parent | 5f67568eb31e3a813c7c52461dcf66ade15fc2e7 (diff) | |
download | kernel_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/wakelock.c')
-rw-r--r-- | kernel/power/wakelock.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index b2e149a..104f6dc 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -22,6 +22,9 @@ #ifdef CONFIG_WAKELOCK_STAT #include <linux/proc_fs.h> #endif +#ifdef CONFIG_FAST_BOOT +#include <linux/delay.h> +#endif #include "power.h" enum { @@ -250,11 +253,18 @@ static long has_wake_lock_locked(int type) } return max_timeout; } +#ifdef CONFIG_FAST_BOOT +extern bool fake_shut_down; +#endif long has_wake_lock(int type) { long ret; unsigned long irqflags; +#ifdef CONFIG_FAST_BOOT + if (fake_shut_down) + return 0; +#endif spin_lock_irqsave(&list_lock, irqflags); ret = has_wake_lock_locked(type); if (ret && (debug_mask & DEBUG_WAKEUP) && type == WAKE_LOCK_SUSPEND) @@ -558,6 +568,25 @@ int wake_lock_active(struct wake_lock *lock) } EXPORT_SYMBOL(wake_lock_active); +#ifdef CONFIG_FAST_BOOT +void wakelock_force_suspend(void) +{ + static int cnt; + + if (cnt > 0) { + pr_info("%s: duplicated\n", __func__); + return; + } + cnt++; + + msleep(3000); + pr_info("%s: fake shut down\n", __func__); + queue_work(suspend_work_queue, &suspend_work); + + cnt = 0; +} +#endif + static int wakelock_stats_open(struct inode *inode, struct file *file) { return single_open(file, wakelock_stats_show, NULL); |