Input: evdev - Add ioctl to block suspend while event queue is not empty.
authorArve Hjønnevåg <arve@android.com>
Fri, 17 Oct 2008 22:20:55 +0000 (15:20 -0700)
committerRohan Somvanshi <rsomvanshi@nvidia.com>
Fri, 3 Feb 2012 13:55:30 +0000 (05:55 -0800)
commit6bc5e3cc4858726819db7af65a6991c52c41f31c
treedb741efdfae0c2ded0cd9af37d207c919ce8fb9a
parent41b21130fd7c9ad2b241b3e6174f0c8e4ea111b7
Input: evdev - Add ioctl to block suspend while event queue is not empty.

Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block
suspend while the event queue is not empty. This allows userspace code to
process input events while the device appears to be asleep.

The current code holds the wakelock for up 5 seconds for every input
device and client. This can prevent suspend if sensor with a high data
rate is active, even when that sensor is not capable of waking the
device once it is suspended.

(cherry picked from commit 4dc43d7079bdae572212368e1d29abea0177c932 from
android.googlesource.com/common.git)

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I160d2afe77aa76c9d2bbe01cd4b81434201361a9
Reviewed-on: http://git-master/r/78895
Reviewed-by: Automatic_Commit_Validation_User
drivers/input/evdev.c
include/linux/input.h