From patchwork Fri Apr 11 02:00:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 3965921 Return-Path: X-Original-To: patchwork-linux-arm@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 C22B0BFF02 for ; Fri, 11 Apr 2014 02:01:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B135E207FE for ; Fri, 11 Apr 2014 02:01:39 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 420A92063B for ; Fri, 11 Apr 2014 02:01:35 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYQmT-0004vi-1b; Fri, 11 Apr 2014 02:01:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYQmQ-0001vy-TP; Fri, 11 Apr 2014 02:01:22 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYQmL-0001vT-BZ for linux-arm-kernel@merlin.infradead.org; Fri, 11 Apr 2014 02:01:17 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYQmG-0002Y7-1H for linux-arm-kernel@lists.infradead.org; Fri, 11 Apr 2014 02:01:16 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3U00DA2G9BUSE0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 11 Apr 2014 11:00:47 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 66.CF.09028.FCC47435; Fri, 11 Apr 2014 11:00:47 +0900 (KST) X-AuditID: cbfee68e-b7f566d000002344-d5-53474ccfa690 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 15.36.29263.FCC47435; Fri, 11 Apr 2014 11:00:47 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.81.195]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3U008E6G9BSD90@mmp2.samsung.com>; Fri, 11 Apr 2014 11:00:47 +0900 (KST) From: Chanwoo Choi To: jic23@kernel.org, ch.naveen@samsung.com, kgene.kim@samsung.com Subject: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC Date: Fri, 11 Apr 2014 11:00:40 +0900 Message-id: <1397181640-18513-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsWyRsSkWPe8j3uwwcRrBhZ3nx9mtLj+5Tmr xYOmVUwWvQuuslmcbXrDbrHp8TVWi3lH3rFYXN41h81ixvl9TA6cHptWdbJ5bF5S79G3ZRWj x+dNcgEsUVw2Kak5mWWpRfp2CVwZ3xYvYS64JV6x98kGlgbG58JdjJwcEgImEj1H+pkhbDGJ C/fWs3UxcnEICSxllHi+7jojTNG32WfYQWwhgemMEqvXK0AUNTFJzPy8EqyITUBLYv+LG2wg toiAk8TPb/fAbGaBm4wSXzriQGxhgXiJdafXMoHYLAKqE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J5akZqemFqQWwWxh4uCUamDk3JtVcH8J wyL3MMFtHH+Phr2ffqNi88+0g1d43t/Ytq9fKinESO/G4145pgmiv5YJvknx6mQ5/+gk18Xj jiH+VoKfcpuSpI/k8EsqHNr6l2GrcmJO6mrX5XMqzs75euFfiJxvh+6bXCEnN5GQK38cyw8t LPjKEC/teZQ9dImlG7Pj3kdPj+9UYinOSDTUYi4qTgQANMY2tNICAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140410_190112_208509_ACDDC583 X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -5.6 (-----) Cc: linux-samsung-soc@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , Kyungmin Park , 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 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This patch control special clock for ADC in Exynos series's FSYS block. If special clock of ADC is registerd on clock list of common clk framework, Exynos ADC drvier have to control this clock. Exynos3250/Exynos4/Exynos5 has 'adc' clock as following: - 'adc' clock: bus clock for ADC Exynos3250 has additional 'sclk_tsadc' clock as following: - 'sclk_tsadc' clock: special clock for ADC which provide clock to internal ADC Exynos 4210/4212/4412 and Exynos5250/5420 has not included 'sclk_tsadc' clock in FSYS_BLK. But, Exynos3250 based on Cortex-A7 has only included 'sclk_tsadc' clock in FSYS_BLK. Cc: Jonathan Cameron Cc: Kukjin Kim Cc: Naveen Krishna Chatradhi Cc: linux-iio@vger.kernel.org Signed-off-by: Chanwoo Choi Signed-off-by: Kyungmin Park --- drivers/iio/adc/exynos_adc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index d25b262..4cd1975 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -88,6 +88,7 @@ struct exynos_adc { void __iomem *regs; void __iomem *enable_reg; struct clk *clk; + struct clk *sclk; unsigned int irq; struct regulator *vdd; @@ -308,6 +309,13 @@ static int exynos_adc_probe(struct platform_device *pdev) goto err_irq; } + info->sclk = devm_clk_get(&pdev->dev, "sclk_tsadc"); + if (IS_ERR(info->sclk)) { + dev_warn(&pdev->dev, "failed getting sclk clock, err = %ld\n", + PTR_ERR(info->sclk)); + info->sclk = NULL; + } + info->vdd = devm_regulator_get(&pdev->dev, "vdd"); if (IS_ERR(info->vdd)) { dev_err(&pdev->dev, "failed getting regulator, err = %ld\n", @@ -341,6 +349,7 @@ static int exynos_adc_probe(struct platform_device *pdev) goto err_iio_dev; clk_prepare_enable(info->clk); + clk_prepare_enable(info->sclk); exynos_adc_hw_init(info); @@ -357,6 +366,7 @@ err_of_populate: exynos_adc_remove_devices); regulator_disable(info->vdd); clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->sclk); err_iio_dev: iio_device_unregister(indio_dev); err_irq: @@ -373,6 +383,7 @@ static int exynos_adc_remove(struct platform_device *pdev) exynos_adc_remove_devices); regulator_disable(info->vdd); clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->sclk); writel(0, info->enable_reg); iio_device_unregister(indio_dev); free_irq(info->irq, info); @@ -398,6 +409,7 @@ static int exynos_adc_suspend(struct device *dev) } clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->sclk); writel(0, info->enable_reg); regulator_disable(info->vdd); @@ -416,6 +428,7 @@ static int exynos_adc_resume(struct device *dev) writel(1, info->enable_reg); clk_prepare_enable(info->clk); + clk_prepare_enable(info->sclk); exynos_adc_hw_init(info);