aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/wakelock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/wakelock.c')
-rw-r--r--kernel/power/wakelock.c29
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);