Re: [PATCH 1/2] Use usleep_range() for better precision timings

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

 



Hello Pavel,

09.06.19 00:13, Pavel Machek пише:
> On Sat 2019-06-08 15:13:11, Oleh Kravchenko wrote:
>> Signed-off-by: Oleh Kravchenko <oleg@xxxxxxxxxx>
>> ---
>>  drivers/leds/leds-cr0014114.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c
>> index 0e4262462cb9..91deb40db307 100644
>> --- a/drivers/leds/leds-cr0014114.c
>> +++ b/drivers/leds/leds-cr0014114.c
>> @@ -37,7 +37,7 @@
>>  
>>  /* CR0014114 default settings */
>>  #define CR_MAX_BRIGHTNESS	GENMASK(6, 0)
>> -#define CR_FW_DELAY_MSEC	10
>> +#define CR_FW_DELAY_USEC	10000
>>  #define CR_RECOUNT_DELAY	(HZ * 3600)
>>  
>>  struct cr0014114_led {
>> @@ -92,7 +92,7 @@ static int cr0014114_recount(struct cr0014114 *priv)
>>  
>>  	cmd = CR_NEXT_REENUMERATE;
>>  	for (i = 0; i < priv->count; i++) {
>> -		msleep(CR_FW_DELAY_MSEC);
>> +		usleep_range(CR_FW_DELAY_USEC, CR_FW_DELAY_USEC + 1);
>>  
>>  		ret = spi_write(priv->spi, &cmd, sizeof(cmd));
> 
> Is added precision actually needed/benefical here?

Yes, it's improves synchronization between linux and led board.
At least 24 hours of correct work :)

 
> 									Pavel
> 

-- 
Best regards,
Oleh Kravchenko


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux