aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-06-14 20:42:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-06-14 20:42:33 +0000
commit2d5f80251c73e1e44c8fdd047ef49dbe051d65aa (patch)
tree74597f2d6eef2e7a6d6338c978b8910f9f947151 /target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch
parent157a4ab64660aaca2dd51fa4f82239d3738a1dff (diff)
downloadupstream-2d5f80251c73e1e44c8fdd047ef49dbe051d65aa.tar.gz
upstream-2d5f80251c73e1e44c8fdd047ef49dbe051d65aa.tar.bz2
upstream-2d5f80251c73e1e44c8fdd047ef49dbe051d65aa.zip
add the 'goldfish' target, useful for experimenting with virtual phone hardware (includes the emulator)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16459 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch')
-rw-r--r--target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch b/target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch
new file mode 100644
index 0000000000..e85f7a3db6
--- /dev/null
+++ b/target/linux/goldfish/patches-2.6.30/0087-Input-Hold-wake-lock-while-event-queue-is-not-empty.patch
@@ -0,0 +1,67 @@
+From 0d1077627288e51b5604f270eae6cf9f5ccd3871 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
+Date: Fri, 17 Oct 2008 15:20:55 -0700
+Subject: [PATCH 087/134] Input: Hold wake lock while event queue is not empty.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Allows userspace code to process input events while
+the device appears to be asleep.
+
+Signed-off-by: Arve Hjønnevåg <arve@android.com>
+---
+ drivers/input/evdev.c | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+--- a/drivers/input/evdev.c
++++ b/drivers/input/evdev.c
+@@ -19,6 +19,7 @@
+ #include <linux/input.h>
+ #include <linux/major.h>
+ #include <linux/device.h>
++#include <linux/wakelock.h>
+ #include "input-compat.h"
+
+ struct evdev {
+@@ -43,6 +44,7 @@ struct evdev_client {
+ struct fasync_struct *fasync;
+ struct evdev *evdev;
+ struct list_head node;
++ struct wake_lock wake_lock;
+ };
+
+ static struct evdev *evdev_table[EVDEV_MINORS];
+@@ -55,6 +57,7 @@ static void evdev_pass_event(struct evde
+ * Interrupts are disabled, just acquire the lock
+ */
+ spin_lock(&client->buffer_lock);
++ wake_lock_timeout(&client->wake_lock, 5 * HZ);
+ client->buffer[client->head++] = *event;
+ client->head &= EVDEV_BUFFER_SIZE - 1;
+ spin_unlock(&client->buffer_lock);
+@@ -233,6 +236,7 @@ static int evdev_release(struct inode *i
+ mutex_unlock(&evdev->mutex);
+
+ evdev_detach_client(evdev, client);
++ wake_lock_destroy(&client->wake_lock);
+ kfree(client);
+
+ evdev_close_device(evdev);
+@@ -269,6 +273,7 @@ static int evdev_open(struct inode *inod
+ }
+
+ spin_lock_init(&client->buffer_lock);
++ wake_lock_init(&client->wake_lock, WAKE_LOCK_SUSPEND, "evdev");
+ client->evdev = evdev;
+ evdev_attach_client(evdev, client);
+
+@@ -332,6 +337,8 @@ static int evdev_fetch_next_event(struct
+ if (have_event) {
+ *event = client->buffer[client->tail++];
+ client->tail &= EVDEV_BUFFER_SIZE - 1;
++ if (client->head == client->tail)
++ wake_unlock(&client->wake_lock);
+ }
+
+ spin_unlock_irq(&client->buffer_lock);