Input: add open and close methods for polled devices

Optional open and close methods for preparing and closing
the device.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Samu Onkalo
2009-10-18 00:38:57 -07:00
committed by Dmitry Torokhov
parent bc09dcadc1
commit b0aba1e66c
3 changed files with 13 additions and 7 deletions

View File

@ -80,8 +80,8 @@ static int input_open_polled_device(struct input_dev *input)
if (error)
return error;
if (dev->flush)
dev->flush(dev);
if (dev->open)
dev->open(dev);
queue_delayed_work(polldev_wq, &dev->work,
msecs_to_jiffies(dev->poll_interval));
@ -95,6 +95,9 @@ static void input_close_polled_device(struct input_dev *input)
cancel_delayed_work_sync(&dev->work);
input_polldev_stop_workqueue();
if (dev->close)
dev->close(dev);
}
/**