mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 19:53:59 +08:00
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>
This commit is contained in:
parent
14e4020630
commit
46249ea60f
@ -504,25 +504,22 @@ static void atp_complete(struct urb* urb)
|
|||||||
memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
|
memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Geyser 3 will continue to send packets continually after
|
input_report_key(dev->input, BTN_LEFT, key);
|
||||||
|
input_sync(dev->input);
|
||||||
|
|
||||||
|
/* Many Geysers will continue to send packets continually after
|
||||||
the first touch unless reinitialised. Do so if it's been
|
the first touch unless reinitialised. Do so if it's been
|
||||||
idle for a while in order to avoid waking the kernel up
|
idle for a while in order to avoid waking the kernel up
|
||||||
several hundred times a second */
|
several hundred times a second */
|
||||||
|
|
||||||
if (atp_is_geyser_3(dev)) {
|
if (!x && !y && !key) {
|
||||||
if (!x && !y && !key) {
|
dev->idlecount++;
|
||||||
dev->idlecount++;
|
if (dev->idlecount == 10) {
|
||||||
if (dev->idlecount == 10) {
|
dev->valid = 0;
|
||||||
dev->valid = 0;
|
schedule_work(&dev->work);
|
||||||
schedule_work(&dev->work);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
} else
|
||||||
dev->idlecount = 0;
|
dev->idlecount = 0;
|
||||||
}
|
|
||||||
|
|
||||||
input_report_key(dev->input, BTN_LEFT, key);
|
|
||||||
input_sync(dev->input);
|
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
|
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
|
||||||
|
Loading…
Reference in New Issue
Block a user