]> Git Repo - linux.git/commitdiff
Input: sentelic - filter out erratic movement when lifting finger
authorTai-hwa Liang <[email protected]>
Wed, 19 Sep 2012 18:10:47 +0000 (11:10 -0700)
committerDmitry Torokhov <[email protected]>
Wed, 19 Sep 2012 21:58:07 +0000 (14:58 -0700)
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 <[email protected]>
Tested-by: Eddie Dunn <[email protected]>
Tested-by: Jakub Luzny <[email protected]>
Tested-by: Olivier Goffart <[email protected]>
Signed-off-by: Tai-hwa Liang <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/mouse/sentelic.c

index 3f5649f190824408a25c495bdfd4da88b8febe9a..a261d857691957a98e732124f6370c6f8280451a 100644 (file)
@@ -721,6 +721,17 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse)
 
        switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) {
        case FSP_PKT_TYPE_ABS:
+
+               if ((packet[0] == 0x48 || packet[0] == 0x49) &&
+                   packet[1] == 0 && packet[2] == 0) {
+                       /*
+                        * Ignore coordinate noise when finger leaving the
+                        * surface, otherwise cursor may jump to upper-left
+                        * corner.
+                        */
+                       packet[3] &= 0xf0;
+               }
+
                abs_x = GET_ABS_X(packet);
                abs_y = GET_ABS_Y(packet);
 
This page took 0.061621 seconds and 4 git commands to generate.