From patchwork Fri Nov 13 20:35:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 7614351 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7DF05BF90C for ; Fri, 13 Nov 2015 20:37:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACD99206EE for ; Fri, 13 Nov 2015 20:37:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5B47206DC for ; Fri, 13 Nov 2015 20:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932879AbbKMUgE (ORCPT ); Fri, 13 Nov 2015 15:36:04 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:25322 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932627AbbKMUgA (ORCPT ); Fri, 13 Nov 2015 15:36:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1447446959; l=1488; s=domk; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From; bh=pjzaigVqOsg/qeKx4MlndDI1WvzriEak44YKZ3UrHuU=; b=cMAToZcEwtKR98E0YOZ0QuHqI05fjbBoYhQUGm+Ky7hg2HvlHChLio2NFSMk+Skd0R+ Z3zkRPkctR1PrO8hK7nsaKHIds7pnUMpZi0HMIfEaT/5o5fbj/04KJpuqh6VlqZKuVh4z Y669Nh21S6XaJXYIPWlQtNK4w1LkHEy/LgQ= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKIDwoJUOY X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE024B.dip0.t-ipconnect.de [87.174.2.75]) by smtp.strato.de (RZmta 37.14 DYNA|AUTH) with ESMTPA id 2049e9rADKZwzG6; Fri, 13 Nov 2015 21:35:58 +0100 (CET) From: "H. Nikolaus Schaller" To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Russell King , Dmitry Torokhov , "H. Nikolaus Schaller" , Hans Verkuil , Mauro Carvalho Chehab , Sebastian Reichel , Haibo Chen , Andrey Gelman , Igor Grinberg , Aaron Sierra , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, gta04-owner@goldelico.com, linux-input@vger.kernel.org Subject: [PATCH v2 2/8] drivers:input:tsc2007: send pendown and penup only once like ads7846(+tsc2046) driver does Date: Fri, 13 Nov 2015 21:35:53 +0100 Message-Id: X-Mailer: git-send-email 2.5.1 In-Reply-To: References: 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=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 this should reduce unnecessary input events. Signed-off-by: H. Nikolaus Schaller --- drivers/input/touchscreen/tsc2007.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index e0c7173..1a8a79d 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c @@ -94,6 +94,7 @@ struct tsc2007 { wait_queue_head_t wait; bool stopped; + bool pendown; int (*get_pendown_state)(struct device *); void (*clear_penirq)(void); @@ -251,7 +252,10 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) dev_dbg(&ts->client->dev, "shaped point(%4d,%4d), pressure (%4u)\n", tc.x, tc.y, rt); - input_report_key(input, BTN_TOUCH, 1); + if (!ts->pendown) { + input_report_key(input, BTN_TOUCH, 1); + ts->pendown = true; + } input_report_abs(input, ABS_X, tc.x); input_report_abs(input, ABS_Y, tc.y); input_report_abs(input, ABS_PRESSURE, rt); @@ -272,9 +276,13 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) dev_dbg(&ts->client->dev, "UP\n"); - input_report_key(input, BTN_TOUCH, 0); - input_report_abs(input, ABS_PRESSURE, 0); - input_sync(input); + if (ts->pendown) { + input_report_key(input, BTN_TOUCH, 0); + input_report_abs(input, ABS_PRESSURE, 0); + input_sync(input); + + ts->pendown = false; + } if (ts->clear_penirq) ts->clear_penirq();