From patchwork Thu Jul 26 04:11:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tai-hwa Liang X-Patchwork-Id: 1240231 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C4B503FC5A for ; Thu, 26 Jul 2012 04:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750836Ab2GZELR (ORCPT ); Thu, 26 Jul 2012 00:11:17 -0400 Received: from hermod.sentelic.com ([203.69.18.19]:25566 "EHLO hermod.sentelic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736Ab2GZELR (ORCPT ); Thu, 26 Jul 2012 00:11:17 -0400 Received: from yggdrasil.sentelic.com (yggdrasil.sentelic.com [203.69.18.18]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hermod.sentelic.com (qmail) with ESMTPS id 40A0B64F090; Thu, 26 Jul 2012 12:11:13 +0800 (CST) Received: by yggdrasil.sentelic.com (qmail, from userid 7787) id EB38B8A6DC9; Thu, 26 Jul 2012 12:11:11 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sentelic.com; s=test; t=1343275871; bh=sqHj8oQe0wu4jgubBws4MD8sahdAFl8vn9cJw+Se9yg=; h=From:To:Cc:Subject:Date; b=ZMeTa0ChrN6nshSo5b/RcE+rPv0gTUiFQ8iGR0owjxnfjB0d9SztMXoeVz0eorQiI cHslfOTWDH9BLAH27uxRx89c5RyNWCDE+vrnlO7frm7FoRQDVdlsjr6Qz1XUPzoOwr gwc358RHYmc7J12GFMQfN0z3e+Ek9VFJERWGLbQ4= Received: from pandemonium.ecosine.com.tw (pandemonium.sentelic.com [192.168.32.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by yggdrasil.sentelic.com (qmail) with ESMTPS id 19BC38A5D4C; Thu, 26 Jul 2012 12:11:08 +0800 (CST) From: Tai-hwa Liang To: Dmitry Torokhov Cc: linux-input@vger.kernel.org Subject: [PATCH 1/2] Input: sentelic - filtering out erratic movement Date: Thu, 26 Jul 2012 12:11:06 +0800 Message-Id: <1343275867-5179-1-git-send-email-avatar@sentelic.com> X-Mailer: git-send-email 1.7.10 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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-and-tested-by: Aleksey Spiridonov Tested-by: Eddie Dunn Tested-by: Jakub Luzny Tested-by: Olivier Goffart Signed-off-by: Tai-hwa Liang --- 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..060edef 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 the top-left corner + */ + return PSMOUSE_FULL_PACKET; + } abs_x = GET_ABS_X(packet); abs_y = GET_ABS_Y(packet);