diff mbox

[06/11] HACK: android-alarm: wakelock workaround

Message ID 1327981772-12329-7-git-send-email-john.stultz@linaro.org
State Superseded
Headers show

Commit Message

John Stultz Jan. 31, 2012, 3:49 a.m. UTC
Allow Android alarmtimer device to build while wakelocks are still
out of tree.

CC: Arve Hjønnevåg <arve@android.com>
CC: Greg KH <gregkh@suse.de>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 drivers/staging/android/alarm-dev.c |   13 ++++++++++++-
 drivers/staging/android/alarm.c     |   12 +++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
index 21a6200..415368a 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -23,13 +23,24 @@ 
 #include <linux/spinlock.h>
 #include <linux/sysdev.h>
 #include <linux/uaccess.h>
-#include <linux/wakelock.h>
 #include "android_alarm.h"
 
+/* XXX - Hack out wakelocks, while they are out of tree */
+struct wake_lock {
+	int i;
+};
+#define wake_lock(x)
+#define wake_lock_timeout(x, y)
+#define wake_unlock(x)
+#define WAKE_LOCK_SUSPEND 0
+#define wake_lock_init(x, y, z) ((x)->i = 1)
+#define wake_lock_destroy(x)
+
 #define ANDROID_ALARM_PRINT_INFO (1U << 0)
 #define ANDROID_ALARM_PRINT_IO (1U << 1)
 #define ANDROID_ALARM_PRINT_INT (1U << 2)
 
+
 static int debug_mask = ANDROID_ALARM_PRINT_INFO;
 module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP);
 
diff --git a/drivers/staging/android/alarm.c b/drivers/staging/android/alarm.c
index fa7a7d8..29135ed 100644
--- a/drivers/staging/android/alarm.c
+++ b/drivers/staging/android/alarm.c
@@ -22,9 +22,19 @@ 
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/sysdev.h>
-#include <linux/wakelock.h>
 #include "android_alarm.h"
 
+/* XXX - Hack out wakelocks, while they are out of tree */
+struct wake_lock {
+	int i;
+};
+#define wake_lock(x)
+#define wake_lock_timeout(x, y)
+#define wake_unlock(x)
+#define WAKE_LOCK_SUSPEND 0
+#define wake_lock_init(x, y, z) ((x)->i = 1)
+#define wake_lock_destroy(x)
+
 #define ANDROID_ALARM_PRINT_ERROR (1U << 0)
 #define ANDROID_ALARM_PRINT_INIT_STATUS (1U << 1)
 #define ANDROID_ALARM_PRINT_TSET (1U << 2)