aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/appletouch.c
diff options
context:
space:
mode:
authorSoeren Sonnenburg <kernel@nn7.de>2007-10-13 00:31:15 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-13 00:31:15 -0400
commit937ad5c1e35191d29d305280525394fe87f4ac4f (patch)
treea40a69b805d6244b7efac3007a4d31aa03b1f0fa /drivers/input/mouse/appletouch.c
parentaefca8ba5f1b95431e33a52736bab128fc4f80d4 (diff)
Input: appletouch - another fix for idle reset logic
Make sure we reset idlecount when we get a good (non-empty) packet. Signed-off-by: Soeren Sonnenburg <kernel@nn7.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/appletouch.c')
-rw-r--r--drivers/input/mouse/appletouch.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index a1804bfdbb8c..0117817bf538 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -502,18 +502,23 @@ static void atp_complete(struct urb* urb)
502 502
503 /* reset the accumulator on release */ 503 /* reset the accumulator on release */
504 memset(dev->xy_acc, 0, sizeof(dev->xy_acc)); 504 memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
505 }
506
507 /* Geyser 3 will continue to send packets continually after
508 the first touch unless reinitialised. Do so if it's been
509 idle for a while in order to avoid waking the kernel up
510 several hundred times a second */
505 511
506 /* Geyser 3 will continue to send packets continually after 512 if (atp_is_geyser_3(dev)) {
507 the first touch unless reinitialised. Do so if it's been 513 if (!x && !y && !key) {
508 idle for a while in order to avoid waking the kernel up
509 several hundred times a second */
510 if (!key && atp_is_geyser_3(dev)) {
511 dev->idlecount++; 514 dev->idlecount++;
512 if (dev->idlecount == 10) { 515 if (dev->idlecount == 10) {
513 dev->valid = 0; 516 dev->valid = 0;
514 schedule_work(&dev->work); 517 schedule_work(&dev->work);
515 } 518 }
516 } 519 }
520 else
521 dev->idlecount = 0;
517 } 522 }
518 523
519 input_report_key(dev->input, BTN_LEFT, key); 524 input_report_key(dev->input, BTN_LEFT, key);