aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-08-03 01:22:46 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-08-09 04:32:45 -0400
commit5e3e4eb1bf212d9ae4997ebcbe2fdfb348b70213 (patch)
tree2371dd2e1b22dbf59506a33d87006cd983b31a1b /drivers/input
parent11205bb63e5c2e5174f377595103005b00c68370 (diff)
Input: polldev - immediately poll device upon opening
To allow open/ioctl(EVIOCGABS)/close use pattern for polled devices read the device in context of open() call instead of offloading the first read to a workqueue. This will ensure that once call to open() returns device would have cached reasonably recent axis values that can be retrieved via appropriate ioctl. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/input-polldev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c
index b1aabde8752..b253973881b 100644
--- a/drivers/input/input-polldev.c
+++ b/drivers/input/input-polldev.c
@@ -49,8 +49,10 @@ static int input_open_polled_device(struct input_dev *input)
49 dev->open(dev); 49 dev->open(dev);
50 50
51 /* Only start polling if polling is enabled */ 51 /* Only start polling if polling is enabled */
52 if (dev->poll_interval > 0) 52 if (dev->poll_interval > 0) {
53 queue_delayed_work(system_freezable_wq, &dev->work, 0); 53 dev->poll(dev);
54 input_polldev_queue_work(dev);
55 }
54 56
55 return 0; 57 return 0;
56} 58}