Skip to content

Commit c5d9313

Browse files
biabeniaminjic23
authored andcommitted
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>
1 parent a0c648c commit c5d9313

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/iio/adc/ad7606.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
594594
if (ret)
595595
dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
596596

597+
/* AD7616 requires al least 15ms to reconfigure after a reset */
598+
if (msleep_interruptible(15))
599+
return -ERESTARTSYS;
600+
597601
st->write_scale = ad7606_write_scale_hw;
598602
st->write_os = ad7606_write_os_hw;
599603

0 commit comments

Comments
 (0)