From patchwork Fri Sep 23 12:41:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 9348027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B47AD601C2 for ; Fri, 23 Sep 2016 12:44:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6F0A2A2AE for ; Fri, 23 Sep 2016 12:44:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B2A32A8F5; Fri, 23 Sep 2016 12:44:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E27D2A2AE for ; Fri, 23 Sep 2016 12:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034029AbcIWMmY (ORCPT ); Fri, 23 Sep 2016 08:42:24 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162]:51682 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758136AbcIWMlg (ORCPT ); Fri, 23 Sep 2016 08:41:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1474634491; l=1049; s=domk; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From; bh=84TngFA4EVc6JPTgwqb3unnRQHEQV4Fq6obY+h576ks=; b=N+PSiykxQ09av1IbF5HKuOxKhhVjt05ewJ4ciNXbgxRjA8tj/WNCsZNSbfmcMZi/kLo h4FlJXKRmtryC+XWhYBfMqkj1bXu+qqJQN4o0LBYTmxdR9MztqpY5NKFQZuJCuLjd/nuW jb1VRn55TFKcTJEbhOeSY97IlNKskJs2iNA= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKID03PMY/Yg== X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE1F23.dip0.t-ipconnect.de [87.174.31.35]) by smtp.strato.de (RZmta 39.3 DYNA|AUTH) with ESMTPA id h01a85s8NCfK8R3; Fri, 23 Sep 2016 14:41:20 +0200 (CEST) From: "H. Nikolaus Schaller" To: Dmitry Torokhov , Rob Herring , Mark Rutland , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Russell King , Arnd Bergmann , Michael Welling , =?UTF-8?q?Mika=20Penttil=C3=A4?= , Javier Martinez Canillas , Igor Grinberg , Sebastian Reichel , "Andrew F. Davis" Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, letux-kernel@openphoenux.org, linux-iio@vger.kernel.org, "H. Nikolaus Schaller" Subject: [PATCH v3 2/8] drivers:input:tsc2007: send pendown and penup only once like ads7846(+tsc2046) driver does Date: Fri, 23 Sep 2016 14:41:10 +0200 Message-Id: <9eab7072cf800efa30de74ba308ef5a1f943b045.1474634475.git.hns@goldelico.com> X-Mailer: git-send-email 2.7.3 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-Virus-Scanned: ClamAV using ClamSMTP this should reduce unnecessary input events. Signed-off-by: H. Nikolaus Schaller --- drivers/input/touchscreen/tsc2007.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 9a11509..e9d5086 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); @@ -254,9 +255,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();