From patchwork Tue Sep 24 15:57:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Salisbury X-Patchwork-Id: 277531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id DD9AF2C00CB for ; Wed, 25 Sep 2013 01:57:58 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VOUzj-0001pj-B6; Tue, 24 Sep 2013 15:57:47 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VOUzd-0001pZ-BO for kernel-team@lists.ubuntu.com; Tue, 24 Sep 2013 15:57:41 +0000 Received: from 66-189-89-211.dhcp.oxfr.ma.charter.com ([66.189.89.211] helo=salisbury) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1VOUzd-0008Pz-73 for kernel-team@lists.ubuntu.com; Tue, 24 Sep 2013 15:57:41 +0000 Received: by salisbury (Postfix, from userid 1000) id C88C5780362; Tue, 24 Sep 2013 11:57:36 -0400 (EDT) From: Joseph Salisbury To: kernel-team@lists.ubuntu.com Subject: [Raring][Saucy][PATCH 1/1] Input: cypress_ps2 - Return zero finger count if palm is detected. Date: Tue, 24 Sep 2013 11:57:36 -0400 Message-Id: <007c09ae4ef7f72ffb657de0fb3854fcbc6d88f0.1379968154.git.joseph.salisbury@canonical.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: In-Reply-To: References: X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/1229361 This patch sets the finger count to 0 in the case of palm contact. Signed-off-by: Joseph Salisbury --- drivers/input/mouse/cypress_ps2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index 45b3eda..95b2c40 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -441,7 +441,7 @@ static int cypress_get_finger_count(unsigned char header_byte) case 2: return 5; default: /* Invalid contact (e.g. palm). Ignore it. */ - return -1; + return 0; } } @@ -460,7 +460,7 @@ static int cypress_parse_packet(struct psmouse *psmouse, contact_cnt = cypress_get_finger_count(header_byte); - if (contact_cnt < 0) /* e.g. palm detect */ + if (contact_cnt < 0) return -EINVAL; report_data->contact_cnt = contact_cnt;