summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2008-10-17 15:20:55 -0700
committerBo Yan <byan@nvidia.com>2012-06-22 13:32:23 -0700
commita9d8fb2bb8f84568be29414184ad8e8490d38a4e (patch)
tree296002705e1ee8e5058b88b2243f4973ed92d3a8 /drivers/input
parent22224417965d3842b24455a9e4589d6d39e079e9 (diff)
Input: Hold wake lock while event queue is not empty.
Allows userspace code to process input events while the device appears to be asleep. Change-Id: I506fec24e3ebaba5ec5916d13987209047bb1c36 Signed-off-by: Arve Hjønnevåg <arve@android.com> Reviewed-on: http://git-master/r/110418 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Prashant Malani <pmalani@nvidia.com> Reviewed-by: Prashant Malani <pmalani@nvidia.com> Reviewed-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/evdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 2ee7b3083edd..411cbc81fb18 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -63,6 +63,7 @@ static void evdev_pass_event(struct evdev_client *client,
/* 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 &= client->bufsize - 1;
@@ -321,6 +322,7 @@ static int evdev_open(struct inode *inode, struct file *file)
spin_lock_init(&client->buffer_lock);
snprintf(client->name, sizeof(client->name), "%s-%d",
dev_name(&evdev->dev), task_tgid_vnr(current));
+ wake_lock_init(&client->wake_lock, WAKE_LOCK_SUSPEND, "evdev");
client->evdev = evdev;
evdev_attach_client(evdev, client);