From patchwork Tue Sep 24 15:44:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Salisbury X-Patchwork-Id: 2934261 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 39AC09F289 for ; Tue, 24 Sep 2013 15:44:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1586720426 for ; Tue, 24 Sep 2013 15:44:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E32E8202AB for ; Tue, 24 Sep 2013 15:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753439Ab3IXPos (ORCPT ); Tue, 24 Sep 2013 11:44:48 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36127 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753411Ab3IXPor (ORCPT ); Tue, 24 Sep 2013 11:44:47 -0400 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 1VOUn5-0007x3-PR; Tue, 24 Sep 2013 15:44:43 +0000 Received: by salisbury (Postfix, from userid 1000) id 09B997803F6; Tue, 24 Sep 2013 11:44:38 -0400 (EDT) From: Joseph Salisbury To: linux-kernel@vger.kernel.org Cc: dmitry.torokhov@gmail.com, rydberg@euromail.se, kamal@canonical.com, dudl@cypress.com, git@status.e4ward.com, tim.gardner@canonical.com, linux-input@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/1] Input: cypress_ps2 - Return zero finger count if palm is detected. Date: Tue, 24 Sep 2013 11:44:38 -0400 Message-Id: <007c09ae4ef7f72ffb657de0fb3854fcbc6d88f0.1379968154.git.joseph.salisbury@canonical.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Dmitry Torokhov (maintainer:INPUT (KEYBOARD,...,commit_signer:2/2=100%) Cc: Henrik Rydberg (maintainer:INPUT MULTITOUCH...) Cc: Kamal Mostafa (commit_signer:2/2=100%) Cc: Dudley Du (commit_signer:2/2=100%) Cc: Kyle Fazzari (commit_signer:1/2=50%) Cc: Tim Gardner (commit_signer:1/2=50%) Cc: linux-input@vger.kernel.org (open list:INPUT (KEYBOARD,...) Cc: linux-kernel@vger.kernel.org (open list) Cc: stable@vger.kernel.org Tested-by: Kamal Mostafa --- 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;