From patchwork Tue Oct 25 19:26:16 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: 9395317 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 C946060233 for ; Tue, 25 Oct 2016 19:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 063542969A for ; Tue, 25 Oct 2016 19:28:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEEDB29726; Tue, 25 Oct 2016 19:28:02 +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 8123D2969A for ; Tue, 25 Oct 2016 19:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755952AbcJYT0r (ORCPT ); Tue, 25 Oct 2016 15:26:47 -0400 Received: from mo4-p04-ob.smtp.rzone.de ([81.169.146.179]:20673 "EHLO mo4-p04-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753871AbcJYT0o (ORCPT ); Tue, 25 Oct 2016 15:26:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1477423601; 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=CSrb66Y0CfC8jZDR495+DAE/5iG9Ff9y1XR3jnNWfjYaq7fub4gL52vcboT36BYgBBy 4eZQRB5GocxEECmzMWBNGvVJe8yfZUF9/wqrL6itMo2x2S1p/nheXmgPLuHsV9br7k1yq QZNwcheN3Meri3TEfAAwVGBjDaLupkxW/VE= X-RZG-CLASS-ID: mo04 X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcZa0CjPwrtwsa7s0mYZj78qgNzGDY9gqCq Received: from localhost.localdomain (p57AE0DB1.dip0.t-ipconnect.de [87.174.13.177]) by smtp.strato.de (RZmta 39.7 DYNA|AUTH) with ESMTPA id w03e16s9PJQW2zz; Tue, 25 Oct 2016 21:26:32 +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 , Hans de Goede , Sangwon Jee 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 v5 2/8] drivers:input:tsc2007: send pendown and penup only once like ads7846(+tsc2046) driver does Date: Tue, 25 Oct 2016 21:26:16 +0200 Message-Id: <5e961a92f11b1509bd0effb96ef560f19839aa9d.1477423581.git.hns@goldelico.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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();