]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad7192: replace usleep_range() with fsleep()
authorStepan Ionichev <sozdayvek@gmail.com>
Mon, 11 May 2026 02:55:44 +0000 (07:55 +0500)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:38 +0000 (10:59 +0100)
The AD7192 datasheet (Rev. A, page 34, RESET section) says:
"When a reset is initiated, the user must allow a period of
500 us before accessing any of the on-chip registers."

Use fsleep(500) instead of usleep_range(500, 1000).

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/ad7192.c

index 8b1664f6b102c8e9f9083281bd1140a8fc035eeb..ba27614c89b4d6a68b9a60c71173e5d164979f12 100644 (file)
@@ -576,7 +576,12 @@ static int ad7192_setup(struct iio_dev *indio_dev, struct device *dev)
        ret = ad_sd_reset(&st->sd);
        if (ret < 0)
                return ret;
-       usleep_range(500, 1000); /* Wait for at least 500us */
+
+       /*
+        * Per AD7192 datasheet (Rev. A, page 34, RESET section), allow
+        * 500 us after a reset before accessing on-chip registers.
+        */
+       fsleep(500);
 
        /* write/read test for device presence */
        ret = ad_sd_read_reg(&st->sd, AD7192_REG_ID, 1, &id);