summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/at91-sama5d2_adc.c
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2021-09-01 15:30:05 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-09-14 14:00:33 +0300
commiteaefa151f48a3305cf73cbc02890eb63cdb48b16 (patch)
tree2b679b44bbefc816cc995d661ed9040173ed97ff /drivers/iio/adc/at91-sama5d2_adc.c
parentf928670651dac9e09a8a848e0d49d0e83fbb610d (diff)
downloadlinux-eaefa151f48a3305cf73cbc02890eb63cdb48b16.tar.xz
iio: adc: at91-sama5d2_adc: initialize hardware after clock is started
The hw_init hardware init call must happen after the clock is prepared and enabled. Otherwise, writing to the registers might lead to a block or external abort. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Link: https://lore.kernel.org/r/20210901123013.329792-3-eugen.hristev@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/at91-sama5d2_adc.c')
-rw-r--r--drivers/iio/adc/at91-sama5d2_adc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index ea5ca163d879..1f4d461c2c18 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1833,12 +1833,12 @@ static int at91_adc_probe(struct platform_device *pdev)
goto vref_disable;
}
- at91_adc_hw_init(indio_dev);
-
ret = clk_prepare_enable(st->per_clk);
if (ret)
goto vref_disable;
+ at91_adc_hw_init(indio_dev);
+
platform_set_drvdata(pdev, indio_dev);
ret = at91_adc_buffer_and_trigger_init(&pdev->dev, indio_dev);