From patchwork Thu Mar 28 10:13:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 2355931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 09DA03FD40 for ; Thu, 28 Mar 2013 10:16:49 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UL9qD-0000jb-Lc; Thu, 28 Mar 2013 10:13:53 +0000 Received: from mail.free-electrons.com ([94.23.35.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UL9qA-0000jE-OX for linux-arm-kernel@lists.infradead.org; Thu, 28 Mar 2013 10:13:51 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id C8830855; Thu, 28 Mar 2013 11:13:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (128-79-216-144.hfc.dyn.abo.bbox.fr [128.79.216.144]) by mail.free-electrons.com (Postfix) with ESMTPSA id 48BF67D5; Thu, 28 Mar 2013 11:13:49 +0100 (CET) From: Alexandre Belloni To: linux-iio@vger.kernel.org Subject: [PATCH] iio: mxs-lradc: Do hardware initialization earlier Date: Thu, 28 Mar 2013 11:13:03 +0100 Message-Id: <1364465583-19835-1-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130328_061350_893436_097DE939 X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , Marek Vasut , brian@crystalfontz.com, jimwall@q.com, Alexandre Belloni , Jonathan Cameron , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We need to initialize hardware before registering the touchscreen. Else, we end up setting registers in mxs_lradc_ts_open(), getting called just after registering the touchscreen with input_register_device() and by the end of mxs_lradc_probe(), we reset the LRADC block hence losing the correct configuration. Cc: Fabio Estevam Cc: Jonathan Cameron Cc: Marek Vasut Signed-off-by: Alexandre Belloni --- drivers/staging/iio/adc/mxs-lradc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 55a459b..e927e3f 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device *pdev) INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work); + /* Configure the hardware. */ + mxs_lradc_hw_init(lradc); + /* Check if touchscreen is enabled in DT. */ ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires", &ts_wires); @@ -995,9 +998,6 @@ static int mxs_lradc_probe(struct platform_device *pdev) goto err_ts; } - /* Configure the hardware. */ - mxs_lradc_hw_init(lradc); - return 0; err_ts: