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);
       }
}

Hello,

I agree that this is makes sense. I was wondering if one can remove the whole
idlecount logic. I tried replacing 10 with 1. This almost works; only if you 
press
the touchpad button, after a reset happened, you first get a usb packet with the
button state still 0 and after that one with button 1. I.e. with count 1 
instead of 10
you reset the device another time in this case. But one could handle this case 
separately.
I am currently working with 2 instead of 10.

I was also wondering when the procedure atp_reinit is executed after using 
schedule_work.
Can it happen that atp_complete is called (even multiple times) before 
atp_reinit is executed?

Sincerely,

Thomas Rohwer

Reply via email to