diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-09-26 00:01:25 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-09-26 00:01:25 -0400 |
commit | 14134b31ae646220a5a451e38aae1dd023d457cb (patch) | |
tree | 44bf08a1793b372bf27091098167ea0f53c43b43 /drivers/input | |
parent | e15b02138b89d7bc053817e6f7601e92e29d371c (diff) |
Input: polled device power saving
For slow running polling, it saves power to align wakeups on tick boundary.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/input-polldev.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c index b773d4c756a6..92b359894e81 100644 --- a/drivers/input/input-polldev.c +++ b/drivers/input/input-polldev.c | |||
@@ -70,6 +70,7 @@ static int input_open_polled_device(struct input_dev *input) | |||
70 | { | 70 | { |
71 | struct input_polled_dev *dev = input->private; | 71 | struct input_polled_dev *dev = input->private; |
72 | int error; | 72 | int error; |
73 | unsigned long ticks; | ||
73 | 74 | ||
74 | error = input_polldev_start_workqueue(); | 75 | error = input_polldev_start_workqueue(); |
75 | if (error) | 76 | if (error) |
@@ -78,8 +79,10 @@ static int input_open_polled_device(struct input_dev *input) | |||
78 | if (dev->flush) | 79 | if (dev->flush) |
79 | dev->flush(dev); | 80 | dev->flush(dev); |
80 | 81 | ||
81 | queue_delayed_work(polldev_wq, &dev->work, | 82 | ticks = msecs_to_jiffies(dev->poll_interval); |
82 | msecs_to_jiffies(dev->poll_interval)); | 83 | if (ticks >= HZ) |
84 | ticks = round_jiffies(ticks); | ||
85 | queue_delayed_work(polldev_wq, &dev->work, ticks); | ||
83 | 86 | ||
84 | return 0; | 87 | return 0; |
85 | } | 88 | } |