Re: [PATCH 1/2] iio: st_sensors: Retry ID verification on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 24, 2022 at 6:54 PM Matti Lehtimäki
<matti.lehtimaki@xxxxxxxxx> wrote:
>
> Some sensors do not always start fast enough to read a valid ID from
> registers at first attempt. Let's retry at most 3 times with short sleep
> in between to fix random timing issues.

...

> +               for (i = 0; i < VERIFY_ID_RETRY_COUNT; i++) {
> +                       err = regmap_read(sdata->regmap,
> +                                         sdata->sensor_settings->wai_addr, &wai);
> +
> +                       if (!err && sdata->sensor_settings->wai == wai)
> +                               return 0;
> +
> +                       msleep(20);

NIH regmap_read_poll_timeout()


> +               }

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux