summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorAnton Ekblad <valderman@gmail.com>2007-10-22 00:59:59 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-22 00:59:59 -0400
commit46249ea60fbb61a72ee6929b831b1f3e6865f024 (patch)
tree88373e1e0c42a3bbd511123d68bf44e2c2916ebf /drivers/input
parent14e4020630b364cc564172a476cd6a6ac4bc7393 (diff)
downloadlinux-46249ea60fbb61a72ee6929b831b1f3e6865f024.tar.gz
linux-46249ea60fbb61a72ee6929b831b1f3e6865f024.tar.bz2
linux-46249ea60fbb61a72ee6929b831b1f3e6865f024.zip
Input: appletouch - apply idle reset logic to all touchpads
Not only Geyser 3 but also Geyser 1 need to be reset after they become idle to stop them from needlessly waking up the kernel. Do idle reset on all touchpads, regardless of their version - if we see 10 empty packets the touchpad needs to be reset; good touchpads should not send empty packets anyway. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/appletouch.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 0117817bf538..f132702d137d 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -504,25 +504,22 @@ static void atp_complete(struct urb* urb)
memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
}
- /* Geyser 3 will continue to send packets continually after
+ input_report_key(dev->input, BTN_LEFT, key);
+ input_sync(dev->input);
+
+ /* Many Geysers will continue to send packets continually after
the first touch unless reinitialised. Do so if it's been
idle for a while in order to avoid waking the kernel up
several hundred times a second */
- if (atp_is_geyser_3(dev)) {
- if (!x && !y && !key) {
- dev->idlecount++;
- if (dev->idlecount == 10) {
- dev->valid = 0;
- schedule_work(&dev->work);
- }
+ if (!x && !y && !key) {
+ dev->idlecount++;
+ if (dev->idlecount == 10) {
+ dev->valid = 0;
+ schedule_work(&dev->work);
}
- else
- dev->idlecount = 0;
- }
-
- input_report_key(dev->input, BTN_LEFT, key);
- input_sync(dev->input);
+ } else
+ dev->idlecount = 0;
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);