Must be "samsung,exynos-adc-v2" for
future controllers.
- reg: Contains ADC register address range (base address and
- length).
+ length) and the address of the phy enable register.
- interrupts: Contains the interrupt information for the timer. The
format is being dependent on which interrupt controller
the Samsung device uses.
adc: adc@12D10000 {
compatible = "samsung,exynos-adc-v1";
- reg = <0x12D10000 0x100>;
+ reg = <0x12D10000 0x100>, <0x10040718 0x4>;
interrupts = <0 106 0>;
#io-channel-cells = <1>;
io-channel-ranges;
struct exynos_adc {
void __iomem *regs;
+ void __iomem *enable_reg;
struct clk *clk;
unsigned int irq;
struct regulator *vdd;
info = iio_priv(indio_dev);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
info->regs = devm_request_and_ioremap(&pdev->dev, mem);
if (!info->regs) {
ret = -ENOMEM;
goto err_iio;
}
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
+ if (!info->enable_reg) {
+ ret = -ENOMEM;
+ goto err_iio;
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq resource?\n");
goto err_iio;
}
+ writel(1, info->enable_reg);
+
info->clk = devm_clk_get(&pdev->dev, "adc");
if (IS_ERR(info->clk)) {
dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
exynos_adc_remove_devices);
regulator_disable(info->vdd);
clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
iio_device_unregister(indio_dev);
free_irq(info->irq, info);
iio_device_free(indio_dev);
}
clk_disable_unprepare(info->clk);
+ writel(0, info->enable_reg);
regulator_disable(info->vdd);
return 0;
if (ret)
return ret;
+ writel(1, info->enable_reg);
clk_prepare_enable(info->clk);
exynos_adc_hw_init(info);