Re: [PATCH 3/3] iio: adc: ti-ads7924: Use fsleep for reset pulse

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 09:23:07 EST


On Thu, Dec 03, 2026 at 02:39:22PM +0100, Rickard Andersson wrote:
>
> The reset pulse in ads7924_reset is generated with mdelay, which
> busy-waits. ads7924_reset is only called from probe,

In all your commit messages please refer to the functions as func().
Exempli gratia, mdelay(), ads7924_reset().

> which runs in process context, so sleeping is allowed.
>
> Replace mdelay with fsleep to make whole reset function
> being able to sleep.

...

> if (data->reset_gpio) {
> gpiod_set_value_cansleep(data->reset_gpio, 1); /* Assert. */
> /* Educated guess: assert time not specified in datasheet... */
> - mdelay(100);
> + fsleep(100 * USEC_PER_MSEC);
> gpiod_set_value_cansleep(data->reset_gpio, 0); /* Deassert. */

When such a long delay (usually >= 20ms) in in place we use msleep() directly.

--
With Best Regards,
Andy Shevchenko