Skip to content

Commit

Permalink
Input: sentelic - filter out erratic movement when lifting finger
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tai-hwa Liang authored and Dmitry Torokhov committed Sep 19, 2012
1 parent 59d1f5c commit 30ebb7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/input/mouse/sentelic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 30ebb7f

Please sign in to comment.