Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: sentelic - filter out erratic movement when lifting finger

When lifing finger off the surface some versions of touchpad send movement
packets with very low coordinates, which cause cursor to jump to the upper
left corner of the screen. Let's ignore least significant bits of X and Y
coordinates if higher bits are all zeroes and consider finger not touching
the pad.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43197
Reported-and-tested-by: Aleksey Spiridonov <leks13@leks13.ru>
Tested-by: Eddie Dunn <eddie.dunn@gmail.com>
Tested-by: Jakub Luzny <limoto94@gmail.com>
Tested-by: Olivier Goffart <olivier@woboq.com>
Signed-off-by: Tai-hwa Liang <avatar@sentelic.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Tai-hwa Liang and committed by
Dmitry Torokhov
30ebb7fa 59d1f5c4

+11
+11
drivers/input/mouse/sentelic.c
··· 721 721 722 722 switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { 723 723 case FSP_PKT_TYPE_ABS: 724 + 725 + if ((packet[0] == 0x48 || packet[0] == 0x49) && 726 + packet[1] == 0 && packet[2] == 0) { 727 + /* 728 + * Ignore coordinate noise when finger leaving the 729 + * surface, otherwise cursor may jump to upper-left 730 + * corner. 731 + */ 732 + packet[3] &= 0xf0; 733 + } 734 + 724 735 abs_x = GET_ABS_X(packet); 725 736 abs_y = GET_ABS_Y(packet); 726 737