From patchwork Mon Sep 23 14:36:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Borleis X-Patchwork-Id: 2928481 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB474BFF05 for ; Mon, 23 Sep 2013 14:37:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D379202C1 for ; Mon, 23 Sep 2013 14:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 576752014B for ; Mon, 23 Sep 2013 14:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753998Ab3IWOgx (ORCPT ); Mon, 23 Sep 2013 10:36:53 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:51054 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752456Ab3IWOgw (ORCPT ); Mon, 23 Sep 2013 10:36:52 -0400 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1VO7Fk-0000kC-V5; Mon, 23 Sep 2013 16:36:44 +0200 Received: from jbe by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1VO7Fj-0005gL-Rw; Mon, 23 Sep 2013 16:36:43 +0200 From: Juergen Beisert To: linux-iio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, marex@denx.de, fabio.estevam@freescale.com, jic23@cam.ac.uk, linux-input@vger.kernel.org Subject: [PATCH 1/9] Staging/iio/adc/touchscreen/MXS: add proper clock handling Date: Mon, 23 Sep 2013 16:36:30 +0200 Message-Id: <1379946998-23041-2-git-send-email-jbe@pengutronix.de> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1379946998-23041-1-git-send-email-jbe@pengutronix.de> References: <1379946998-23041-1-git-send-email-jbe@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c 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=-9.2 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 The delay units inside the LRADC depend on the presence of a 2 kHz clock. This change enables the clock to be able to use the delay unit for the touchscreen part of the driver. Signed-off-by: Juergen Beisert --- arch/arm/boot/dts/imx23.dtsi | 1 + arch/arm/boot/dts/imx28.dtsi | 1 + drivers/staging/iio/adc/mxs-lradc.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi index 28b5ce2..07caf76 100644 --- a/arch/arm/boot/dts/imx23.dtsi +++ b/arch/arm/boot/dts/imx23.dtsi @@ -430,6 +430,7 @@ reg = <0x80050000 0x2000>; interrupts = <36 37 38 39 40 41 42 43 44>; status = "disabled"; + clocks = <&clks 26>; }; spdif@80054000 { diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index 7363fde..175deef 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi @@ -902,6 +902,7 @@ interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>; status = "disabled"; + clocks = <&clks 41>; }; spdif: spdif@80054000 { diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index a08c173..00b61ac 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -134,6 +135,8 @@ struct mxs_lradc { void __iomem *base; int irq[13]; + struct clk *clk; + uint32_t *buffer; struct iio_trigger *trig; @@ -928,6 +931,9 @@ static int mxs_lradc_probe(struct platform_device *pdev) if (IS_ERR(lradc->base)) return PTR_ERR(lradc->base); + lradc->clk = devm_clk_get(&pdev->dev, NULL); + clk_prepare_enable(lradc->clk); + INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work); /* Check if touchscreen is enabled in DT. */ @@ -1020,6 +1026,7 @@ static int mxs_lradc_remove(struct platform_device *pdev) iio_triggered_buffer_cleanup(iio); mxs_lradc_trigger_remove(iio); + clk_disable_unprepare(lradc->clk); return 0; }