From 30ebb7fa0e3e92145b859ad6e44aa6dc636b4103 Mon Sep 17 00:00:00 2001 From: Tai-hwa Liang Date: Wed, 19 Sep 2012 11:10:47 -0700 Subject: [PATCH] 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 Tested-by: Eddie Dunn Tested-by: Jakub Luzny Tested-by: Olivier Goffart Signed-off-by: Tai-hwa Liang Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/sentelic.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 3f5649f19082..a261d8576919 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c @@ -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);