From patchwork Mon Feb 24 14:39:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Borleis X-Patchwork-Id: 3709571 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 023339F2ED for ; Mon, 24 Feb 2014 14:37:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD1FF2015A for ; Mon, 24 Feb 2014 14:37:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA21A20131 for ; Mon, 24 Feb 2014 14:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473AbaBXOhM (ORCPT ); Mon, 24 Feb 2014 09:37:12 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:34331 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbaBXOhM convert rfc822-to-8bit (ORCPT ); Mon, 24 Feb 2014 09:37:12 -0500 Received: from thebe.hi.pengutronix.de ([2001:6f8:1178:2:5e26:aff:fe2b:7cc4]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WHweS-00012e-4g; Mon, 24 Feb 2014 15:37:00 +0100 From: Juergen Beisert Organization: Pengutronix e.K. To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] staging/iio/adc/MXS/LRADC: fix touchscreen statemachine Date: Mon, 24 Feb 2014 15:39:53 +0100 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) Cc: Dan Carpenter , devel@driverdev.osuosl.org, marex@denx.de, fabio.estevam@freescale.com, linux-iio@vger.kernel.org, Alexandre Belloni , jic23@cam.ac.uk, linux-input@vger.kernel.org References: <1379946998-23041-1-git-send-email-jbe@pengutronix.de> <201402241416.24270.jbe@pengutronix.de> <20140224133316.GI26722@mwanda> In-Reply-To: <20140224133316.GI26722@mwanda> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201402241539.53707.jbe@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:5e26:aff:fe2b:7cc4 X-SA-Exim-Mail-From: jbe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Releasing the touchscreen lets the internal statemachine left in a wrong state. Due to this the release coordinate will be reported again by accident when the next touchscreen event happens. This change sets up the correct state when waiting for the next touchscreen event. Signed-off-by: Juergen Beisert Tested-by: Alexandre Belloni diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 7fc66a6..514844e 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -757,6 +757,7 @@ static void mxs_lradc_finish_touch_event(struct mxs_lradc *lradc, bool valid) } /* if it is released, wait for the next touch via IRQ */ + lradc->cur_plate = LRADC_TOUCH; mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, LRADC_CTRL1); mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); }