Re: [PATCH 2/2] media: i2c: ov7251: Introduce 1 ms delay between regulators and en GPIO

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

 



On Wed, Jan 22, 2025 at 11:54:11AM +0000, Sakari Ailus wrote:
> On Mon, Jan 20, 2025 at 07:23:07PM +0200, Andy Shevchenko wrote:
> > On Mon, Jan 20, 2025 at 12:11:23PM +0200, Sakari Ailus wrote:
> > > Lift the xshutdown (enable) GPIO 1 ms after enabling the regulators, as
> > > required by the sensor's power-up sequence.

...

> > > +	usleep_range(1000, 1100);
> > 
> > Why not fsleep() ?
> 
> Could be, but fsleep() uses a range that is as large as the delay is.

fsleep() is recommended way as it knows much better the implementation details
of the delay APIs and which one to choose based on input. As recently stated by
the fix series to delay APIs the fsleep() will give up to 25% on top of the
asked delay, meaning in this case somewhat 250us. Taking it into account the
resulting values I do not think usleep_range() should be here. I.o.w. I do not
see enough justification for _not_ using fsleep().

Also note that fsleep() ranges try to keep balance between oversleep and power
consumption. Your delay is rather tough as sometimes 100us is almost the time
needed to go to the deep sleep for the CPU package and return from it.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux