Skip to contentSkip to conversation

input: polled device power saving

PATCH In review Stephen Hemminger 2 participants 2 messages Sep 12, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: polled device power saving

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

drivers/input/input-polldev.c +5 -2
@@ -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;
 }
maintainer
#1 lore raw

Hi Stephen,

Quoted 2 lines · Stephen Hemminger

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...

Signature · 1 line
Dmitry