Skip to content

Commit e420633

Browse files
committed
iio: adc: ad7124: fix chip ID mismatch
The ad7124_soft_reset() function has the assumption that the chip will assert the "power-on reset" bit in the STATUS register after a software reset without any delay. The POR bit =0 is used to check if the chip initialization is done. A chip ID mismatch probe error appears intermittently when the probe continues too soon and the ID register does not contain the expected value. Fix by adding a 200us delay after the software reset command is issued. Fixes: b3af341 ("iio: adc: Add ad7124 support") Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
1 parent 8bce508 commit e420633

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/adc/ad7124.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ static int ad7124_soft_reset(struct ad7124_state *st)
763763
if (ret < 0)
764764
return ret;
765765

766+
fsleep(200);
766767
timeout = 100;
767768
do {
768769
ret = ad_sd_read_reg(&st->sd, AD7124_STATUS, 1, &readval);

0 commit comments

Comments
 (0)