From nobody Mon Feb 9 21:38:23 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90E03410D0C for ; Wed, 4 Feb 2026 14:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770214630; cv=none; b=U9S3THyLYmGMwoWX7S/BwRdlWeOndloVIjauF/Q17Qiq1Rxq2hV09y7/+dGsQE+Hz82kD4qrmdTdKgFQDcyErwvx6XIkUM5GRU6/Rdp5ELzKjLNjiMzmTtdu76/C2RyY/oDYAdTvVD8Q7AwMyVXF35GST+Ei0l+FWRIbbjMkn10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770214630; c=relaxed/simple; bh=J8VEEpGK6fQEXh7dQ+A+V/sWX8djg2HIkzMrWlPT06o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V/dxFqLsZIudNDfXgZIeX8PFeEWvAR2UfDF8eDCp761mO6qaTMG6XjV4sOJ98chUDiwkKeNmQlJ9XDwqFNDhUkeOAus87kKaPq3PF41sJ9iHww2Es9MYQRGoMO4VpWjyqNYHz9pIQWKjSCD7icpLkIFos3EiswRxBOiHGU1DBaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vndR1-0001Qr-HP; Wed, 04 Feb 2026 15:00:47 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac] helo=dude04) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vndR1-0045FO-28; Wed, 04 Feb 2026 15:00:47 +0100 Received: from ore by dude04 with local (Exim 4.98.2) (envelope-from ) id 1vndR0-00000001dgU-36GH; Wed, 04 Feb 2026 15:00:46 +0100 From: Oleksij Rempel To: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Oleksij Rempel , Andy Shevchenko , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Andy Shevchenko , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , David Jander Subject: [PATCH v5 07/13] iio: dac: ds4424: use fsleep() instead of usleep_range() Date: Wed, 4 Feb 2026 15:00:39 +0100 Message-ID: <20260204140045.390677-8-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260204140045.390677-1-o.rempel@pengutronix.de> References: <20260204140045.390677-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Andy Shevchenko --- changes v5: - Add Reviewed-by: Andy .. - Remove "(usleep or msleep)" from the commit message - s/1000/1 * USEC_PER_MSEC - Include 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 #include #include +#include =20 #include #include @@ -243,7 +244,13 @@ static int ds4424_probe(struct i2c_client *client) return ret; } =20 - 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 =3D ds4424_verify_chip(indio_dev); if (ret < 0) goto fail; --=20 2.47.3