summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBeniamin Bia <beniamin.bia@analog.com>2019-07-18 09:27:32 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-07-28 10:54:32 +0300
commitc5d93137af93c228392d133b3b00a0edae80dd40 (patch)
tree9fbaa3bb259e56b23bdb9d99b0b626f6f1ad2d62 /drivers
parenta0c648c07ce50744d0f6ddb58b483e87907e9122 (diff)
downloadlinux-c5d93137af93c228392d133b3b00a0edae80dd40.tar.xz
iio: adc: ad7606: Allow reconfigration after reset
According to datasheet, ad7616 require at least 15ms after a restart to fully reconfigure and being able to receive new commands via spi. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/adc/ad7606.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index 9eec3db01a17..a6034cf7238a 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -594,6 +594,10 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
if (ret)
dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
+ /* AD7616 requires al least 15ms to reconfigure after a reset */
+ if (msleep_interruptible(15))
+ return -ERESTARTSYS;
+
st->write_scale = ad7606_write_scale_hw;
st->write_os = ad7606_write_os_hw;