Skip to content

Commit

Permalink
Input: appletouch - another fix for idle reset logic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Soeren Sonnenburg authored and Dmitry Torokhov committed Oct 13, 2007
1 parent aefca8b commit 937ad5c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,18 +502,23 @@ static void atp_complete(struct urb* urb)

/* reset the accumulator on release */
memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
}

/* Geyser 3 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 */

/* Geyser 3 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 (!key && atp_is_geyser_3(dev)) {
if (atp_is_geyser_3(dev)) {
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);
Expand Down

0 comments on commit 937ad5c

Please sign in to comment.