提交 14134b31 编写于 作者: S Stephen Hemminger 提交者: Dmitry Torokhov

Input: polled device power saving

For slow running polling, it saves power to align wakeups on tick boundary.
Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 e15b0213
...@@ -70,6 +70,7 @@ static int input_open_polled_device(struct input_dev *input) ...@@ -70,6 +70,7 @@ static int input_open_polled_device(struct input_dev *input)
{ {
struct input_polled_dev *dev = input->private; struct input_polled_dev *dev = input->private;
int error; int error;
unsigned long ticks;
error = input_polldev_start_workqueue(); error = input_polldev_start_workqueue();
if (error) if (error)
...@@ -78,8 +79,10 @@ static int input_open_polled_device(struct input_dev *input) ...@@ -78,8 +79,10 @@ static int input_open_polled_device(struct input_dev *input)
if (dev->flush) if (dev->flush)
dev->flush(dev); dev->flush(dev);
queue_delayed_work(polldev_wq, &dev->work, ticks = msecs_to_jiffies(dev->poll_interval);
msecs_to_jiffies(dev->poll_interval)); if (ticks >= HZ)
ticks = round_jiffies(ticks);
queue_delayed_work(polldev_wq, &dev->work, ticks);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册