From patchwork Mon Oct 17 13:57:50 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: 9379341 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 418416086B for ; Mon, 17 Oct 2016 14:00:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33AF529204 for ; Mon, 17 Oct 2016 14:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27AEA2921C; Mon, 17 Oct 2016 14:00:25 +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=ham 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 B644129204 for ; Mon, 17 Oct 2016 14:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933303AbcJQOAS (ORCPT ); Mon, 17 Oct 2016 10:00:18 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.219]:28445 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933213AbcJQOAL (ORCPT ); Mon, 17 Oct 2016 10:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1476712806; l=1402; s=domk; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From; bh=KZ9RxxMW1f0nzvFuoSZ5papVj/KQUSC1y7d9AOqFoxU=; b=LsCybJ5a16mFAkPeqDzvTrtz6RDgXCu+vkB4siZI47aoRYF1xZUzB83D93Gk0cs/kw8 wC8Q+X64Zx14akk+KGxiORjV7tusQTnLGAYESQwcD1dW2fnVOyFpV77jIzU4NZsIjd/Vt TTX6NlU4IoNoo/HSTzXuH4skjTM25cfFa4w= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcZa0CjPwrtwsa7s0mYZj78qgN7BSk0grc= X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE09BB.dip0.t-ipconnect.de [87.174.9.187]) by smtp.strato.de (RZmta 39.6 DYNA|AUTH) with ESMTPA id Y04fees9HDxx2Tm; Mon, 17 Oct 2016 15:59:59 +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" , "H. Nikolaus Schaller" , Mark Brown , Jonathan Cameron 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, kernel@pyra-handheld.com Subject: [PATCH v4 2/8] drivers:input:tsc2007: send pendown and penup only once like ads7846(+tsc2046) driver does Date: Mon, 17 Oct 2016 15:57:50 +0200 Message-Id: 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index c1d9593..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); @@ -227,7 +228,11 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) sx, sy, rt); /* report event */ - input_report_key(input, BTN_TOUCH, 1); + if (!ts->pendown) { + input_report_key(input, BTN_TOUCH, 1); + ts->pendown = true; + } + touchscreen_report_pos(ts->input, &ts->prop, (unsigned int) sx, (unsigned int) sy, @@ -250,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();