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