diff options
author | Anton Ekblad <valderman@gmail.com> | 2007-10-22 00:59:59 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-10-22 00:59:59 -0400 |
commit | 46249ea60fbb61a72ee6929b831b1f3e6865f024 (patch) | |
tree | 88373e1e0c42a3bbd511123d68bf44e2c2916ebf /drivers/input | |
parent | 14e4020630b364cc564172a476cd6a6ac4bc7393 (diff) |
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.c | 25 |
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) | |||
504 | memset(dev->xy_acc, 0, sizeof(dev->xy_acc)); | 504 | memset(dev->xy_acc, 0, sizeof(dev->xy_acc)); |
505 | } | 505 | } |
506 | 506 | ||
507 | /* Geyser 3 will continue to send packets continually after | 507 | input_report_key(dev->input, BTN_LEFT, key); |
508 | input_sync(dev->input); | ||
509 | |||
510 | /* Many Geysers will continue to send packets continually after | ||
508 | the first touch unless reinitialised. Do so if it's been | 511 | the first touch unless reinitialised. Do so if it's been |
509 | idle for a while in order to avoid waking the kernel up | 512 | idle for a while in order to avoid waking the kernel up |
510 | several hundred times a second */ | 513 | several hundred times a second */ |
511 | 514 | ||
512 | if (atp_is_geyser_3(dev)) { | 515 | if (!x && !y && !key) { |
513 | if (!x && !y && !key) { | 516 | dev->idlecount++; |
514 | dev->idlecount++; | 517 | if (dev->idlecount == 10) { |
515 | if (dev->idlecount == 10) { | 518 | dev->valid = 0; |
516 | dev->valid = 0; | 519 | schedule_work(&dev->work); |
517 | schedule_work(&dev->work); | ||
518 | } | ||
519 | } | 520 | } |
520 | else | 521 | } else |
521 | dev->idlecount = 0; | 522 | dev->idlecount = 0; |
522 | } | ||
523 | |||
524 | input_report_key(dev->input, BTN_LEFT, key); | ||
525 | input_sync(dev->input); | ||
526 | 523 | ||
527 | exit: | 524 | exit: |
528 | retval = usb_submit_urb(dev->urb, GFP_ATOMIC); | 525 | retval = usb_submit_urb(dev->urb, GFP_ATOMIC); |