[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260204140045.390677-8-o.rempel@pengutronix.de>
Date: Wed, 4 Feb 2026 15:00:39 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Jonathan Cameron <jic23@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
kernel@...gutronix.de,
linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org,
devicetree@...r.kernel.org,
Andy Shevchenko <andy@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
David Jander <david@...tonic.nl>
Subject: [PATCH v5 07/13] iio: dac: ds4424: use fsleep() instead of usleep_range()
The DS4422/DS4424 and DS4402/DS4404 datasheets do not specify a minimum
delay between power-up (POR) and the availability of the I2C interface.
The driver previously used `usleep_range(1000, 1200)` to enforce a ~1ms
delay. Replace this with `fsleep(1000)` to allow the kernel to select
the most efficient sleep mechanism while retaining the existing
conservative delay to ensure device readiness.
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
---
changes v5:
- Add Reviewed-by: Andy ..
- Remove "(usleep or msleep)" from the commit message
- s/1000/1 * USEC_PER_MSEC
- Include <linux/time64.h> for USEC_PER_MSEC
changes v4:
- New patch
---
drivers/iio/dac/ds4424.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c
index b6b8ab2d4b1f..00a719d43a17 100644
--- a/drivers/iio/dac/ds4424.c
+++ b/drivers/iio/dac/ds4424.c
@@ -12,6 +12,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
+#include <linux/time64.h>
#include <linux/iio/consumer.h>
#include <linux/iio/driver.h>
@@ -243,7 +244,13 @@ static int ds4424_probe(struct i2c_client *client)
return ret;
}
- usleep_range(1000, 1200);
+ /*
+ * The datasheet does not specify a power-up to I2C ready time.
+ * Maintain the existing conservative 1ms delay to ensure the
+ * device is ready for communication.
+ */
+ fsleep(1 * USEC_PER_MSEC);
+
ret = ds4424_verify_chip(indio_dev);
if (ret < 0)
goto fail;
--
2.47.3
Powered by blists - more mailing lists