Skip to content

Commit

Permalink
Input: polldev - immediately poll device upon opening
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed Aug 9, 2011
1 parent 11205bb commit 5e3e4eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/input/input-polldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5e3e4eb

Please sign in to comment.