Skip to contentSkip to conversation

patch "iio: adc: ad7124: fix chip ID mismatch" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Sep 3, 2024

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adc: ad7124: fix chip ID mismatch

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 96f9ab0d5933c1c00142dd052f259fce0bc3ced2 Mon Sep 17 00:00:00 2001
From: Dumitru Ceclan <[email protected]>
Date: Wed, 31 Jul 2024 15:37:22 +0300
Subject: 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.

---
 drivers/iio/adc/ad7124.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/ad7124.c +1 -0
index 3beed78496c5..c0b82f64c976 100644
@@ -764,6 +764,7 @@ static int ad7124_soft_reset(struct ad7124_state *st)
 	if (ret < 0)
 		return ret;
 
+	fsleep(200);
 	timeout = 100;
 	do {
 		ret = ad_sd_read_reg(&st->sd, AD7124_STATUS, 1, &readval);
Signature · 1 line
2.46.0