From patchwork Tue Apr 19 18:17:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 718651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JIHnhY021516 for ; Tue, 19 Apr 2011 18:17:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753469Ab1DSSRs (ORCPT ); Tue, 19 Apr 2011 14:17:48 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:43454 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753445Ab1DSSRs (ORCPT ); Tue, 19 Apr 2011 14:17:48 -0400 Received: from finisterre.wolfsonmicro.main (unknown [87.246.78.26]) by opensource2.wolfsonmicro.com (Postfix) with ESMTPSA id 899C31105AE; Tue, 19 Apr 2011 19:17:46 +0100 (BST) Received: from broonie by finisterre.wolfsonmicro.main with local (Exim 4.74) (envelope-from ) id 1QCFUr-0003MN-5W; Tue, 19 Apr 2011 19:17:57 +0100 From: Mark Brown To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, patches@opensource.wolfsonmicro.com, Mark Brown Subject: [PATCH 3/3] Input: wm831x-ts - Move BTN_TOUCH reporting to data transfer Date: Tue, 19 Apr 2011 19:17:54 +0100 Message-Id: <1303237074-12878-3-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303237074-12878-1-git-send-email-broonie@opensource.wolfsonmicro.com> References: <1303237074-12878-1-git-send-email-broonie@opensource.wolfsonmicro.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 18:17:49 +0000 (UTC) Don't report BTN_TOUCH until we've got data as some less robust applications can be confused by getting a touch event by itself and it doesn't seem unreasonable for them to expect coordinates along with a touch. Signed-off-by: Mark Brown --- drivers/input/touchscreen/wm831x-ts.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 78e8705..9175d49 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c @@ -148,6 +148,8 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0); schedule_work(&wm831x_ts->pd_data_work); + } else { + input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1); } input_sync(wm831x_ts->input_dev); @@ -174,9 +176,6 @@ static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data) WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA, WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena); - input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1); - input_sync(wm831x_ts->input_dev); - wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1, WM831X_TCHPD_EINT, WM831X_TCHPD_EINT);