On Wed, 2007-09-26 at 16:13 -0400, Dmitry Torokhov wrote: > On 9/26/07, Soeren Sonnenburg <[EMAIL PROTECTED]> wrote: > > > > On Mon, 2007-09-24 at 15:22 +0200, Thomas Rohwer wrote: > > > Hello, > > > > > > > could you please re-send the patch? I for some reason have yet to see > > > > it ... > > > > > > here it is again, adressing also the comments from Dmitry. > > > > Thomas, Matthew and Dmitry, > > > > I think there is another bug in this. I mean whenever a mouse button is > > pressed or the mouse is moved the counter should be reset - no? > > > > Currently the idle counter is just increased... > > > > I mean shouldn't it be > > > > if (x || y || key) > > dev->idlecount=0; > > > > if (!x && !y && !key) > > { > > dev->idlecount++; > > if (dev->idlecount == 10) { > > dev->valid = 0; > > schedule_work(&dev->work); > > } > > } > > > > Yes, I think you are right. I guess one could trigger an extra reset > by pressing the button repeatedly witout touching the pad. But because > we won't do reset while the button is pressed we'll never lose release > event. > > I guess we want to fix it but it can wait for 2.6.24. A patch woudl be > appreciated.
Patch is attached. As all these if () conditions made it quite unreadable I moved the block dealing with geyser 3 and above to the very bottom. Still compiles/works for me. Please have a look. Soeren
Signed-off-by: Soeren Sonnenburg <[EMAIL PROTECTED]> diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index a1804bf..78f30b2 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -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);