Signed-off-by: Soeren Sonnenburg diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index a1804bf..aa2bb4e 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -127,7 +127,8 @@ MODULE_DEVICE_TABLE (usb, atp_table); * Threshold for the touchpad sensors. Any change less than ATP_THRESHOLD is * ignored. */ -#define ATP_THRESHOLD 5 +#define ATP_THRESHOLD 5 +#define ATP_IDLE_LIMIT 2 /* MacBook Pro (Geyser 3 & 4) initialization constants */ #define ATP_GEYSER3_MODE_READ_REQUEST_ID 1 @@ -502,18 +503,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) { + if (dev->idlecount == ATP_IDLE_LIMIT) { dev->valid = 0; schedule_work(&dev->work); } } + else + dev->idlecount=0; } input_report_key(dev->input, BTN_LEFT, key);