From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbaDKCAw (ORCPT ); Thu, 10 Apr 2014 22:00:52 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:9159 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbaDKCAt (ORCPT ); Thu, 10 Apr 2014 22:00:49 -0400 X-AuditID: cbfee68e-b7f566d000002344-d5-53474ccfa690 From: Chanwoo Choi To: jic23@kernel.org, ch.naveen@samsung.com, kgene.kim@samsung.com Cc: linux-iio@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Chanwoo Choi , Kyungmin Park 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/fAbGaBm4wSXzriQGxhgXiJdafXMoHYLAKqEhM7l7OA2LwCrhIXp5xlglgmJ/Fh zyN2kAUSAu3sElevv2eBaBCQ+Db5EJDNAZSQldh0AOpqSYmDK26wTGAUXMDIsIpRNLUguaA4 Kb3ISK84Mbe4NC9dLzk/dxMjMHxP/3vWt4Px5gHrQ4zJQOMmMkuJJucDwz+vJN7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yw8t LPjKEC/teZQ9dImlG7Pj3kdPj+9UYinOSDTUYi4qTgQANMY2tNICAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 1.8.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi 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> Return-path: Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Chanwoo Choi , Kyungmin Park List-Id: linux-samsung-soc@vger.kernel.org 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.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); -- 1.8.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: cw00.choi@samsung.com (Chanwoo Choi) Date: Fri, 11 Apr 2014 11:00:40 +0900 Subject: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC Message-ID: <1397181640-18513-1-git-send-email-cw00.choi@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 at 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); -- 1.8.0