Mailing List archive

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

[linux-dvb] Re: Slow i2c problem



From: "Johannes Stezenbach" <js@convergence.de>
> Robert Schlabbach wrote:
> > Yes, rewrite the SAA7146A I2C functions from scratch :)
> > Alternatively, try putting just an extra read of the PSR into
> > the i2c_busy_rise_and_fall() function before the loops, that
> > might work wonders already.
>
> I wouldn't mind if you would post a patch ;-)

Sorry, I'm not even running Linux, so I couldn't test if my patches
worked... But I'd recommend rewriting it from scratch and doing completely
_without_ any delays (except when recovering from I2C bus errors).

Consider this: You can only pass 24 bits at a time. With a 275kHz clock, it
takes less than 0.1 milliseconds to finish that transfer. In the Windows
kernel, the timer resolution is 10 milliseconds. So if you inserted any
kind of delay, you'd end up waiting 100 times the transfer time! Since the
transfer time is so short, a loop that continuously reads the PSR and
checks it IMHO causes less load than going through the rescheduling
mechanism of the kernel.

BTW: The TDA10045H microcode upload is 30555 bytes = 244440 bits. With a
275kHz clock, the theoretical transfer time would be 0.89 seconds. My code
performs the transfer in about 1 second. So it fully exploits the I2C bus
speed :) And I get _zero_ I2C transfer errors with it! Neither on the
Lorenzen DVB-T card, nor on my Siemens-Cable with analog module... :)

Regards,
--
Robert Schlabbach
e-mail: robert_s@gmx.net
Berlin, Germany



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



Home | Main Index | Thread Index