Mailing List archive

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

[linux-dvb] Re: Busy waiting in i2c_busy_rise_and_fall (was: Re: Re: full featured card without signal and required video memory investigation)



Oliver Endriss wrote:
> 
> Putting everything together I suggest the following implementation:
> 
>         ...
>         i2c_status_check(saa);
> 
>         /* wait until busy-flag is inactive or error is reported */
>         for (i = timeout; i > 0; i--) {
> 
>                 hprintk("saa7146: i2c_busy_rise_and_fall; fall wait %d\n",i);
> 
>                 /* see if anything can be done while we're waiting */
>                 cond_resched();
>                 udelay(20);
> 
>                 status = i2c_status_check(saa);
> 
>                 /* check busy flag */
>                 if ( 0 == (status & SAA7146_I2C_BUSY))
>                         break;
> 
>                 /* check error flag */
>                 if ( 0 != (status & SAA7146_I2C_ERR))
>                         break;
> 
>         }
>         ...
> 
> Typically my system loops 2..5 times with 275kHz I2C bus speed.
> Shall I add this to CVS?

Yes, please commit.


Johannes


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index