Mailing List archive

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

[linux-dvb] Re: write to I2C registers...



Michael Hunold wrote:
Hello Tim,

how may I use the av7110 I2C bus for testing purposes?
I want to change some registers int the analog module ICs.
I have got their i2c addresses but do not know how to change them
from the command prompt. It is laboriously to change the kernel modules and reload them everytime.
Is there a way to write to them directly with a small program?

Unfortunately, not. The linuxtv.org drivers have their own internal i2c
abstraction layer -- there is no way to access the i2c bus from userspace.

AFAIK the Metzlerbros. driver use the common linux i2c kernel interface
structure. There, it should be possible to access the available i2c
busses through the /dev/i2c/ interface provided by the "i2c-dev" driver.
it's pretty easy to add a simple special-debug-device to the dvb-i2c core, then you can pass messages from user space.

Or you can register an additional kernel-i2c adapter using the same master_xfer function. Or use the kernel-i2c <-> dvb_i2c bridge patch from the dbox2 people.


Just in case you are wondering why the linuxtv.org drivers don't use the
linux i2c kernel interface: I was told that the frontends often crashed
when i2c helper drivers probed the av7110 bus to see, if a device was
present there or not. This was simply not usable in production systems,
so they decided to make an internal abstraction layer.

Please correct me if I'm wrong.
no, the main problem was that the i2c-core will probe on all i2c busses in the system, and some graphics drivers (matrox IIRC) had a buggy i2c implementation which did not returned before a very long timeout in case of transmission errrors.

Then it was pretty complicated to distinguish multiple DVB cards and last but not least some i2c driver implementations were simply buggy and did not set start/stop conditions correctly. Since we need only a small subset of the i2c protocol it was much simpler to provide our own thin abstraction layer (the dvb_i2c.c contains only ~290 lines of code).

We now have our own very simple+special solution for our special problem...

Holger



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



Home | Main Index | Thread Index