Skip to content

Commit

Permalink
iio: adc: ad7606: Allow reconfigration after reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Beniamin Bia authored and Jonathan Cameron committed Jul 28, 2019
1 parent a0c648c commit c5d9313
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/iio/adc/ad7606.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit c5d9313

Please sign in to comment.