From 5e3e4eb1bf212d9ae4997ebcbe2fdfb348b70213 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 2 Aug 2011 22:22:46 -0700 Subject: 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 --- drivers/input/input-polldev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/input/input-polldev.c') diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c index b1aabde87523..b253973881b8 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) dev->open(dev); /* Only start polling if polling is enabled */ - if (dev->poll_interval > 0) - queue_delayed_work(system_freezable_wq, &dev->work, 0); + if (dev->poll_interval > 0) { + dev->poll(dev); + input_polldev_queue_work(dev); + } return 0; } -- cgit v1.2.3 From d2d8442d0094a7d4b585e2bbde31e3775dba7eb1 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 3 Jul 2011 13:53:48 -0400 Subject: drivers/input: Add module.h to modular drivers implicitly using it A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in input dir are actually calling out for explicitly in advance. Signed-off-by: Paul Gortmaker --- drivers/input/input-polldev.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/input/input-polldev.c') diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c index b253973881b8..7dfe1009fae0 100644 --- a/drivers/input/input-polldev.c +++ b/drivers/input/input-polldev.c @@ -14,6 +14,7 @@ #include #include #include +#include #include MODULE_AUTHOR("Dmitry Torokhov "); -- cgit v1.2.3