linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: polled device power saving
@ 2007-09-12 11:41 Stephen Hemminger
  2007-09-12 14:51 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2007-09-12 11:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input

For slow running polling, it saves power to align wakeups on tick boundary.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/input/input-polldev.c	2007-06-22 03:36:04.000000000 +0200
+++ b/drivers/input/input-polldev.c	2007-09-12 13:18:59.000000000 +0200
@@ -70,6 +70,7 @@ static int input_open_polled_device(stru
 {
 	struct input_polled_dev *dev = input->private;
 	int error;
+	unsigned long ticks;
 
 	error = input_polldev_start_workqueue();
 	if (error)
@@ -78,8 +79,10 @@ static int input_open_polled_device(stru
 	if (dev->flush)
 		dev->flush(dev);
 
-	queue_delayed_work(polldev_wq, &dev->work,
-			   msecs_to_jiffies(dev->poll_interval));
+	ticks = msecs_to_jiffies(dev->poll_interval);
+	if (ticks >= HZ)
+		ticks = round_jiffies(ticks);
+	queue_delayed_work(polldev_wq, &dev->work, ticks);
 
 	return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] input: polled device power saving
  2007-09-12 11:41 [PATCH] input: polled device power saving Stephen Hemminger
@ 2007-09-12 14:51 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2007-09-12 14:51 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: linux-input

Hi Stephen,

On 9/12/07, Stephen Hemminger <shemminger@linux-foundation.org> wrote:
> For slow running polling, it saves power to align wakeups on tick boundary.
>

Will apply, thank you.

As far as the apanel driver goes - still working through my backlog
caused by a couple of hard drive failures, please bear with me...

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-12 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 11:41 [PATCH] input: polled device power saving Stephen Hemminger
2007-09-12 14:51 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).