summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2014-02-06 13:13:23 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:15 +0900
commit5041a3d21e33b600d056ba6bd967862731146831 (patch)
tree3c24aee454f8d1b86e9feb1fd60dc2bba572f2a9 /drivers/iio
parent7226f38f52e85a71efe6f6201f85473da2d887b2 (diff)
downloadlinux-3.10-5041a3d21e33b600d056ba6bd967862731146831.tar.gz
linux-3.10-5041a3d21e33b600d056ba6bd967862731146831.tar.bz2
linux-3.10-5041a3d21e33b600d056ba6bd967862731146831.zip
iio: adc: exynos_adc: Control special clock for ADC
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. - 'adc' clock: bus clock for ADC - 'sclk_tsadc' clock: special clock for ADC which provide clock to internal ADC Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/exynos_adc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index b3d03d33594..60abe56f8b4 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -87,6 +87,7 @@ struct exynos_adc {
void __iomem *regs;
void __iomem *enable_reg;
struct clk *clk;
+ struct clk *sclk;
unsigned int irq;
struct regulator *vdd;
@@ -99,6 +100,7 @@ struct exynos_adc {
static const struct of_device_id exynos_adc_match[] = {
{ .compatible = "samsung,exynos-adc-v1", .data = (void *)ADC_V1 },
{ .compatible = "samsung,exynos-adc-v2", .data = (void *)ADC_V2 },
+ { .compatible = "samsung,exynos3250-adc-v2", .data = (void *)ADC_V2 },
{},
};
MODULE_DEVICE_TABLE(of, exynos_adc_match);
@@ -312,6 +314,13 @@ static int exynos_adc_probe(struct platform_device *pdev)
goto err_irq;
}
+ info->sclk = devm_clk_get(&pdev->dev, "sclk_adc");
+ 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",
@@ -345,6 +354,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);
@@ -361,6 +371,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:
@@ -379,6 +390,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);
@@ -405,6 +417,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);
@@ -423,6 +436,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);