All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  2:00 ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-11  2:00 UTC (permalink / raw)
  To: jic23, ch.naveen, kgene.kim
  Cc: linux-iio, linux-samsung-soc, linux-kernel, linux-arm-kernel,
	Chanwoo Choi, Kyungmin Park

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 <jic23@kernel.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 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


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  2:00 ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-11  2:00 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A, ch.naveen-Sze3O3UU22JBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Chanwoo Choi,
	Kyungmin Park

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 <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  2:00 ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-11  2:00 UTC (permalink / raw)
  To: linux-arm-kernel

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 <jic23@kernel.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: linux-iio at vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 23+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-04-11  9:41 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: jic23, ch.naveen, kgene.kim, linux-iio, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park


Hi,

On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
> This patch control special clock for ADC in Exynos series's FSYS block.

s/control/controls/

> If special clock of ADC is registerd on clock list of common clk framework,
> Exynos ADC drvier have to control this clock.

s/drvier/driver/

> 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 <jic23@kernel.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: linux-iio@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  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);

Please disable clocks in the reverse of order in which they were enabled.

>  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);

ditto

>  	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);

ditto

>  	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);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 23+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-04-11  9:41 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: jic23-DgEjT+Ai2ygdnm+yROfE0A, ch.naveen-Sze3O3UU22JBDgjK7y7TUQ,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Kyungmin Park


Hi,

On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
> This patch control special clock for ADC in Exynos series's FSYS block.

s/control/controls/

> If special clock of ADC is registerd on clock list of common clk framework,
> Exynos ADC drvier have to control this clock.

s/drvier/driver/

> 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 <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Cc: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  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);

Please disable clocks in the reverse of order in which they were enabled.

>  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);

ditto

>  	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);

ditto

>  	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);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 23+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-04-11  9:41 UTC (permalink / raw)
  To: linux-arm-kernel


Hi,

On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
> This patch control special clock for ADC in Exynos series's FSYS block.

s/control/controls/

> If special clock of ADC is registerd on clock list of common clk framework,
> Exynos ADC drvier have to control this clock.

s/drvier/driver/

> 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 <jic23@kernel.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: linux-iio at vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  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);

Please disable clocks in the reverse of order in which they were enabled.

>  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);

ditto

>  	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);

ditto

>  	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);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
  2014-04-11  2:00 ` Chanwoo Choi
@ 2014-04-11 10:05   ` Sylwester Nawrocki
  -1 siblings, 0 replies; 23+ messages in thread
From: Sylwester Nawrocki @ 2014-04-11 10:05 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: jic23, ch.naveen, kgene.kim, linux-iio, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park, devicetree

Hi Chanwoo,

On 11/04/14 04:00, Chanwoo Choi wrote:
> 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.

I think a new compatible should be added for the ADC device for Exynos3250
and the required clocks should be handled properly, based on compatible
value. This could be handled, e.g. through some flags in driver's data
selected based on the compatible property value.

And the new clocks should be documented in Documentation/devicetree/bindings
/arm/samsung/exynos-adc.txt.

> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: linux-iio@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  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);
>  
> 

Regards,
Sylwester

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 10:05   ` Sylwester Nawrocki
  0 siblings, 0 replies; 23+ messages in thread
From: Sylwester Nawrocki @ 2014-04-11 10:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chanwoo,

On 11/04/14 04:00, Chanwoo Choi wrote:
> 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.

I think a new compatible should be added for the ADC device for Exynos3250
and the required clocks should be handled properly, based on compatible
value. This could be handled, e.g. through some flags in driver's data
selected based on the compatible property value.

And the new clocks should be documented in Documentation/devicetree/bindings
/arm/samsung/exynos-adc.txt.

> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: linux-iio at vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  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);
>  
> 

Regards,
Sylwester

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
  2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
@ 2014-04-11 10:56     ` Tomasz Figa
  -1 siblings, 0 replies; 23+ messages in thread
From: Tomasz Figa @ 2014-04-11 10:56 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Chanwoo Choi
  Cc: jic23, ch.naveen, kgene.kim, linux-iio, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park

Hi,

On 11.04.2014 11:41, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>> This patch control special clock for ADC in Exynos series's FSYS block.
>
> s/control/controls/
>
>> If special clock of ADC is registerd on clock list of common clk framework,
>> Exynos ADC drvier have to control this clock.
>
> s/drvier/driver/
>
>> 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 <jic23@kernel.org>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> Cc: linux-iio@vger.kernel.org
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>   drivers/iio/adc/exynos_adc.c | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)

This change alters DT bindings for Exynos ADC, so documentation must be 
modified appropriately.

>>
>> 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;
>> +	}
>> +

Is there any reason why we should have a warning on SoCs which don't 
have this clock? I think this clock should be acquired only for affected 
SoCs.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 10:56     ` Tomasz Figa
  0 siblings, 0 replies; 23+ messages in thread
From: Tomasz Figa @ 2014-04-11 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 11.04.2014 11:41, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>> This patch control special clock for ADC in Exynos series's FSYS block.
>
> s/control/controls/
>
>> If special clock of ADC is registerd on clock list of common clk framework,
>> Exynos ADC drvier have to control this clock.
>
> s/drvier/driver/
>
>> 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 <jic23@kernel.org>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> Cc: linux-iio at vger.kernel.org
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>   drivers/iio/adc/exynos_adc.c | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)

This change alters DT bindings for Exynos ADC, so documentation must be 
modified appropriately.

>>
>> 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;
>> +	}
>> +

Is there any reason why we should have a warning on SoCs which don't 
have this clock? I think this clock should be acquired only for affected 
SoCs.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
  2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
  (?)
@ 2014-04-11 22:45     ` 최찬우
  -1 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:45 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Chanwoo Choi, jic23, ch.naveen, Kukjin Kim, linux-iio,
	linux-samsung-soc, linux-kernel, linux-arm-kernel, Kyungmin Park

Hi Bartlomiej,

On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
>
> Hi,
>
> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>> This patch control special clock for ADC in Exynos series's FSYS block.
>
> s/control/controls/

I'll fix it.

>
>> If special clock of ADC is registerd on clock list of common clk framework,
>> Exynos ADC drvier have to control this clock.
>
> s/drvier/driver/

I'll fix it.

>
>> 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 <jic23@kernel.org>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> Cc: linux-iio@vger.kernel.org
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  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);
>
> Please disable clocks in the reverse of order in which they were enabled.

Is it necessary? I don't think that.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 22:45     ` 최찬우
  0 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:45 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Chanwoo Choi, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	ch.naveen-Sze3O3UU22JBDgjK7y7TUQ, Kukjin Kim,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park

Hi Bartlomiej,

On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
<b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
>
> Hi,
>
> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>> This patch control special clock for ADC in Exynos series's FSYS block.
>
> s/control/controls/

I'll fix it.

>
>> If special clock of ADC is registerd on clock list of common clk framework,
>> Exynos ADC drvier have to control this clock.
>
> s/drvier/driver/

I'll fix it.

>
>> 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 <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>> Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Cc: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> ---
>>  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);
>
> Please disable clocks in the reverse of order in which they were enabled.

Is it necessary? I don't think that.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 22:45     ` 최찬우
  0 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Bartlomiej,

On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
>
> Hi,
>
> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>> This patch control special clock for ADC in Exynos series's FSYS block.
>
> s/control/controls/

I'll fix it.

>
>> If special clock of ADC is registerd on clock list of common clk framework,
>> Exynos ADC drvier have to control this clock.
>
> s/drvier/driver/

I'll fix it.

>
>> 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 <jic23@kernel.org>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> Cc: linux-iio at vger.kernel.org
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  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);
>
> Please disable clocks in the reverse of order in which they were enabled.

Is it necessary? I don't think that.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
  2014-04-11 10:05   ` Sylwester Nawrocki
@ 2014-04-11 22:49     ` 최찬우
  -1 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:49 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: Chanwoo Choi, devicetree, linux-samsung-soc, linux-iio,
	linux-kernel, Kyungmin Park, Kukjin Kim, linux-arm-kernel,
	ch.naveen, jic23

Hi Sylwester,

On Fri, Apr 11, 2014 at 7:05 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> Hi Chanwoo,
>
> On 11/04/14 04:00, Chanwoo Choi wrote:
>> 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.
>
> I think a new compatible should be added for the ADC device for Exynos3250
> and the required clocks should be handled properly, based on compatible
> value. This could be handled, e.g. through some flags in driver's data
> selected based on the compatible property value.

OK, I'll consider new patch using new compatible string according to
your comment.

>
> And the new clocks should be documented in Documentation/devicetree/bindings
> /arm/samsung/exynos-adc.txt.

OK, I'll modify it. Thanks,

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 22:49     ` 최찬우
  0 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sylwester,

On Fri, Apr 11, 2014 at 7:05 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> Hi Chanwoo,
>
> On 11/04/14 04:00, Chanwoo Choi wrote:
>> 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.
>
> I think a new compatible should be added for the ADC device for Exynos3250
> and the required clocks should be handled properly, based on compatible
> value. This could be handled, e.g. through some flags in driver's data
> selected based on the compatible property value.

OK, I'll consider new patch using new compatible string according to
your comment.

>
> And the new clocks should be documented in Documentation/devicetree/bindings
> /arm/samsung/exynos-adc.txt.

OK, I'll modify it. Thanks,

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
  2014-04-11 10:56     ` Tomasz Figa
@ 2014-04-11 22:52       ` 최찬우
  -1 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:52 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Bartlomiej Zolnierkiewicz, Chanwoo Choi, linux-samsung-soc,
	linux-iio, linux-kernel, Kyungmin Park, Kukjin Kim,
	linux-arm-kernel, ch.naveen, jic23

Hi Tomasz,

On Fri, Apr 11, 2014 at 7:56 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi,
>
>
> On 11.04.2014 11:41, Bartlomiej Zolnierkiewicz wrote:
>>
>>
>> Hi,
>>
>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>>
>>> This patch control special clock for ADC in Exynos series's FSYS block.
>>
>>
>> s/control/controls/
>>
>>> If special clock of ADC is registerd on clock list of common clk
>>> framework,
>>> Exynos ADC drvier have to control this clock.
>>
>>
>> s/drvier/driver/
>>
>>> 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 <jic23@kernel.org>
>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> Cc: linux-iio@vger.kernel.org
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>>   drivers/iio/adc/exynos_adc.c | 13 +++++++++++++
>>>   1 file changed, 13 insertions(+)
>
>
> This change alters DT bindings for Exynos ADC, so documentation must be
> modified appropriately.

OK, I'll add DT modification patch on next posting.

>
>
>>>
>>> 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;
>>> +       }
>>> +
>
>
> Is there any reason why we should have a warning on SoCs which don't have
> this clock? I think this clock should be acquired only for affected SoCs.

You are right.

As Sylwester comment on previous reply, I'll consider to use new compatible name
to handle clock in only proper SoC according to compatible name.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-11 22:52       ` 최찬우
  0 siblings, 0 replies; 23+ messages in thread
From: 최찬우 @ 2014-04-11 22:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tomasz,

On Fri, Apr 11, 2014 at 7:56 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi,
>
>
> On 11.04.2014 11:41, Bartlomiej Zolnierkiewicz wrote:
>>
>>
>> Hi,
>>
>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>>
>>> This patch control special clock for ADC in Exynos series's FSYS block.
>>
>>
>> s/control/controls/
>>
>>> If special clock of ADC is registerd on clock list of common clk
>>> framework,
>>> Exynos ADC drvier have to control this clock.
>>
>>
>> s/drvier/driver/
>>
>>> 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 <jic23@kernel.org>
>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> Cc: linux-iio at vger.kernel.org
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>>   drivers/iio/adc/exynos_adc.c | 13 +++++++++++++
>>>   1 file changed, 13 insertions(+)
>
>
> This change alters DT bindings for Exynos ADC, so documentation must be
> modified appropriately.

OK, I'll add DT modification patch on next posting.

>
>
>>>
>>> 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;
>>> +       }
>>> +
>
>
> Is there any reason why we should have a warning on SoCs which don't have
> this clock? I think this clock should be acquired only for affected SoCs.

You are right.

As Sylwester comment on previous reply, I'll consider to use new compatible name
to handle clock in only proper SoC according to compatible name.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-12  7:49       ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2014-04-12  7:49 UTC (permalink / raw)
  To: 최찬우, Bartlomiej Zolnierkiewicz
  Cc: Chanwoo Choi, ch.naveen, Kukjin Kim, linux-iio,
	linux-samsung-soc, linux-kernel, linux-arm-kernel, Kyungmin Park



On April 11, 2014 11:45:42 PM GMT+01:00, "최찬우" <cwchoi00@gmail.com> wrote:
>Hi Bartlomiej,
>
>On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
><b.zolnierkie@samsung.com> wrote:
>>
>> Hi,
>>
>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>> This patch control special clock for ADC in Exynos series's FSYS
>block.
>>
>> s/control/controls/
>
>I'll fix it.
>
>>
>>> If special clock of ADC is registerd on clock list of common clk
>framework,
>>> Exynos ADC drvier have to control this clock.
>>
>> s/drvier/driver/
>
>I'll fix it.
>
>>
>>> 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 <jic23@kernel.org>
>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> Cc: linux-iio@vger.kernel.org
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>>  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);
>>
>> Please disable clocks in the reverse of order in which they were
>enabled.
>
>Is it necessary? I don't think that.
It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!
>
>Best Regards,
>Chanwoo Choi

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-12  7:49       ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2014-04-12  7:49 UTC (permalink / raw)
  To: 최찬우, Bartlomiej Zolnierkiewicz
  Cc: Chanwoo Choi, ch.naveen-Sze3O3UU22JBDgjK7y7TUQ, Kukjin Kim,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park



On April 11, 2014 11:45:42 PM GMT+01:00, "최찬우" <cwchoi00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>Hi Bartlomiej,
>
>On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
><b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
>>
>> Hi,
>>
>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>> This patch control special clock for ADC in Exynos series's FSYS
>block.
>>
>> s/control/controls/
>
>I'll fix it.
>
>>
>>> If special clock of ADC is registerd on clock list of common clk
>framework,
>>> Exynos ADC drvier have to control this clock.
>>
>> s/drvier/driver/
>
>I'll fix it.
>
>>
>>> 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 <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>> Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> Cc: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> ---
>>>  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);
>>
>> Please disable clocks in the reverse of order in which they were
>enabled.
>
>Is it necessary? I don't think that.
It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!
>
>Best Regards,
>Chanwoo Choi

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-12  7:49       ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2014-04-12  7:49 UTC (permalink / raw)
  To: linux-arm-kernel



On April 11, 2014 11:45:42 PM GMT+01:00, "???" <cwchoi00@gmail.com> wrote:
>Hi Bartlomiej,
>
>On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
><b.zolnierkie@samsung.com> wrote:
>>
>> Hi,
>>
>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>> This patch control special clock for ADC in Exynos series's FSYS
>block.
>>
>> s/control/controls/
>
>I'll fix it.
>
>>
>>> If special clock of ADC is registerd on clock list of common clk
>framework,
>>> Exynos ADC drvier have to control this clock.
>>
>> s/drvier/driver/
>
>I'll fix it.
>
>>
>>> 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 <jic23@kernel.org>
>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> Cc: linux-iio at vger.kernel.org
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>>  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);
>>
>> Please disable clocks in the reverse of order in which they were
>enabled.
>
>Is it necessary? I don't think that.
It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!
>
>Best Regards,
>Chanwoo Choi

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-14  0:58         ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-14  0:58 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: 최찬우,
	Bartlomiej Zolnierkiewicz, ch.naveen, Kukjin Kim, linux-iio,
	linux-samsung-soc, linux-kernel, linux-arm-kernel, Kyungmin Park

Hi Jonathan,

On 04/12/2014 04:49 PM, Jonathan Cameron wrote:
> 
> 
> On April 11, 2014 11:45:42 PM GMT+01:00, "최찬우" <cwchoi00@gmail.com> wrote:
>> Hi Bartlomiej,
>>
>> On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
>> <b.zolnierkie@samsung.com> wrote:
>>>
>>> Hi,
>>>
>>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>>> This patch control special clock for ADC in Exynos series's FSYS
>> block.
>>>
>>> s/control/controls/
>>
>> I'll fix it.
>>
>>>
>>>> If special clock of ADC is registerd on clock list of common clk
>> framework,
>>>> Exynos ADC drvier have to control this clock.
>>>
>>> s/drvier/driver/
>>
>> I'll fix it.
>>
>>>
>>>> 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 <jic23@kernel.org>
>>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>>> Cc: linux-iio@vger.kernel.org
>>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>>  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);
>>>
>>> Please disable clocks in the reverse of order in which they were
>> enabled.
>>
>> Is it necessary? I don't think that.
> It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!

OK, I'll fix it on next posting(v2). Thanks.

Best Regards,
Chanwoo Choi



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-14  0:58         ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-14  0:58 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: 최찬우,
	Bartlomiej Zolnierkiewicz, ch.naveen-Sze3O3UU22JBDgjK7y7TUQ,
	Kukjin Kim, linux-iio-u79uwXL29TY76Z2rM5mHXA, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, Kyungmin Park

Hi Jonathan,

On 04/12/2014 04:49 PM, Jonathan Cameron wrote:
> 
> 
> On April 11, 2014 11:45:42 PM GMT+01:00, "최찬우" <cwchoi00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi Bartlomiej,
>>
>> On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
>> <b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
>>>
>>> Hi,
>>>
>>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>>> This patch control special clock for ADC in Exynos series's FSYS
>> block.
>>>
>>> s/control/controls/
>>
>> I'll fix it.
>>
>>>
>>>> If special clock of ADC is registerd on clock list of common clk
>> framework,
>>>> Exynos ADC drvier have to control this clock.
>>>
>>> s/drvier/driver/
>>
>> I'll fix it.
>>
>>>
>>>> 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 <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>>> Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>>> Cc: Naveen Krishna Chatradhi <ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>>> Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>>> ---
>>>>  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);
>>>
>>> Please disable clocks in the reverse of order in which they were
>> enabled.
>>
>> Is it necessary? I don't think that.
> It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!

OK, I'll fix it on next posting(v2). Thanks.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
@ 2014-04-14  0:58         ` Chanwoo Choi
  0 siblings, 0 replies; 23+ messages in thread
From: Chanwoo Choi @ 2014-04-14  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jonathan,

On 04/12/2014 04:49 PM, Jonathan Cameron wrote:
> 
> 
> On April 11, 2014 11:45:42 PM GMT+01:00, "???" <cwchoi00@gmail.com> wrote:
>> Hi Bartlomiej,
>>
>> On Fri, Apr 11, 2014 at 6:41 PM, Bartlomiej Zolnierkiewicz
>> <b.zolnierkie@samsung.com> wrote:
>>>
>>> Hi,
>>>
>>> On Friday, April 11, 2014 11:00:40 AM Chanwoo Choi wrote:
>>>> This patch control special clock for ADC in Exynos series's FSYS
>> block.
>>>
>>> s/control/controls/
>>
>> I'll fix it.
>>
>>>
>>>> If special clock of ADC is registerd on clock list of common clk
>> framework,
>>>> Exynos ADC drvier have to control this clock.
>>>
>>> s/drvier/driver/
>>
>> I'll fix it.
>>
>>>
>>>> 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 <jic23@kernel.org>
>>>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>>>> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>>> Cc: linux-iio at vger.kernel.org
>>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>>  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);
>>>
>>> Please disable clocks in the reverse of order in which they were
>> enabled.
>>
>> Is it necessary? I don't think that.
> It is probably not a bug but it is more obviously correct in the reverse order so that is how it should be done!

OK, I'll fix it on next posting(v2). Thanks.

Best Regards,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-04-14  0:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11  2:00 [PATCH] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC Chanwoo Choi
2014-04-11  2:00 ` Chanwoo Choi
2014-04-11  2:00 ` Chanwoo Choi
2014-04-11  9:41 ` Bartlomiej Zolnierkiewicz
2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
2014-04-11  9:41   ` Bartlomiej Zolnierkiewicz
2014-04-11 10:56   ` Tomasz Figa
2014-04-11 10:56     ` Tomasz Figa
2014-04-11 22:52     ` 최찬우
2014-04-11 22:52       ` 최찬우
2014-04-11 22:45   ` 최찬우
2014-04-11 22:45     ` 최찬우
2014-04-11 22:45     ` 최찬우
2014-04-12  7:49     ` Jonathan Cameron
2014-04-12  7:49       ` Jonathan Cameron
2014-04-12  7:49       ` Jonathan Cameron
2014-04-14  0:58       ` Chanwoo Choi
2014-04-14  0:58         ` Chanwoo Choi
2014-04-14  0:58         ` Chanwoo Choi
2014-04-11 10:05 ` Sylwester Nawrocki
2014-04-11 10:05   ` Sylwester Nawrocki
2014-04-11 22:49   ` 최찬우
2014-04-11 22:49     ` 최찬우

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.