Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174221
b: refs/heads/master
c: b0aba1e
h: refs/heads/master
i:
  174219: c2c5b8b
v: v3
  • Loading branch information
Samu Onkalo authored and Dmitry Torokhov committed Oct 18, 2009
1 parent 921a918 commit b8f3021
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc09dcadc1a3da87d58aa70ebc8e9441205be75c
refs/heads/master: b0aba1e66c38d64be2c7dbf4b08c71857031ab67
7 changes: 5 additions & 2 deletions trunk/drivers/input/input-polldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/misc/wistron_btns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ static int __devinit setup_input_dev(void)
if (!wistron_idev)
return -ENOMEM;

wistron_idev->flush = wistron_flush;
wistron_idev->open = wistron_flush;
wistron_idev->poll = wistron_poll;
wistron_idev->poll_interval = POLL_INTERVAL_DEFAULT;

Expand Down
11 changes: 7 additions & 4 deletions trunk/include/linux/input-polldev.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

/**
* struct input_polled_dev - simple polled input device
* @private: private driver data
* @flush: driver-supplied method that flushes device's state upon
* opening (optional)
* @private: private driver data.
* @open: driver-supplied method that prepares device for polling
* (enabled the device and maybe flushes device state).
* @close: driver-supplied method that is called when device is no
* longer being polled. Used to put device into low power mode.
* @poll: driver-supplied method that polls the device and posts
* input events (mandatory).
* @poll_interval: specifies how often the poll() method shoudl be called.
Expand All @@ -30,7 +32,8 @@
struct input_polled_dev {
void *private;

void (*flush)(struct input_polled_dev *dev);
void (*open)(struct input_polled_dev *dev);
void (*close)(struct input_polled_dev *dev);
void (*poll)(struct input_polled_dev *dev);
unsigned int poll_interval; /* msec */

Expand Down

0 comments on commit b8f3021

Please sign in to comment.