lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 4/6] mfd: Add RTL8231 core device
On Mon, May 24, 2021 at 11:23 AM Sander Vanheule <sander@svanheule.net> wrote:
> On Mon, 2021-05-24 at 11:02 +0300, Andy Shevchenko wrote:
> > On Mon, May 24, 2021 at 1:34 AM Sander Vanheule <sander@svanheule.net> wrote:

...

> > > + usleep_range(1000, 10000);
> >
> > It's strange to see this big range of minimum and maximum sleep.
> > Usually the ratio should not be bigger than ~3-4 between the values.
>
> I could also change this from a usleep to a polling loop that checks (with a
> loop limit) if the reset bit has self-cleared already.
>
> The datasheet that I have doesn't mention how fast it should self-clear. So I
> checked, and it appears to be done after one loop iteration already. So,
> certainly faster than the current usleep.
>
> Would a polling loop (with maybe like max. 10 iterations) be a good alternative
> for you?

I guess it's the right way to go. Just check the iopoll.h for helpers.
Also regmap has regmap_read_poll_timeout().

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-05-24 12:19    [W:0.173 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site