From: Tai-hwa Liang <avatar@sentelic.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Subject: [PATCH] Input: sentelic - filtering out erratic movement
Date: Sat,  2 Jun 2012 22:23:41 +0800	[thread overview]
Message-ID: <1338647021-11013-1-git-send-email-avatar@sentelic.com> (raw)
It turns out that certain hardware sometime generates unexpected movement
during normal operation. This patch tries to filter out these erratic
movements which will cause unexpected cursor jumping to the top-left corner.
Bugzilla:	https://bugzilla.kernel.org/show_bug.cgi?id=43197
Reported-by:	Aleksey Spiridonov <leks13@leks13.ru>
Tested-by:	Aleksey Spiridonov <leks13@leks13.ru>
Signed-off-by: Tai-hwa Liang <avatar@sentelic.com>
---
 drivers/input/mouse/sentelic.c |    8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index 3f5649f..48967a4 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -721,6 +721,14 @@ 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) {
+			/*
+			 * filtering out erratic movement which will cause
+			 * unexpected cursor jumping to top-left corner
+			 */
+			packet[3] &= 0xf0;
+		}
 		abs_x = GET_ABS_X(packet);
 		abs_y = GET_ABS_Y(packet);
 
-- 
1.7.10
next             reply	other threads:[~2012-06-02 14:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02 14:23 Tai-hwa Liang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-07-06  5:49 [PATCH] Input: sentelic - filtering out erratic movement Tai-hwa Liang
2012-07-08  0:30 ` Tai-hwa Liang
2012-07-25  7:08 ` Dmitry Torokhov
2012-07-25 10:22   ` Tai-hwa Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=1338647021-11013-1-git-send-email-avatar@sentelic.com \
    --to=avatar@sentelic.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).