Mailing List archive

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

[linux-dvb] Re: no pwm entry in sysfs



Johannes Stezenbach wrote:

Holger Waechtler wrote:

Heikki Manninen wrote:

So, wrong answer to my question: How should I be able to have the pwm
entries for Fujitsu-Siemens DVB-C cards in sysfs?

If there is no such way anymore, please let us know.

As far I remember from the discussion on the linux-dvb mailing list this has been removed in the overhauling process because it unecessairily complicated the code and the proper solution is trivial to implement -- workarounds for broken EEPROMs that are easy to fix in userspace really don't belong in kernelspace.

I don't remember such a discussion.

My guess is that it was removed because frontend drivers aren't
i2c_clients anymore, so there is no sysfs directory for them.

you can directly write to any address on every i2c bus, you don't need any i2c client registered at all:

---- /usr/src/linux-2.6.XXX/Documentation/i2c/dev-interface
Next thing, open the device file, as follows:
int file;
int adapter_nr = 2; /* probably dynamically determined */
char filename[20];

sprintf(filename,"/dev/i2c-%d",adapter_nr);
if ((file = open(filename,O_RDWR)) < 0) {
/* ERROR HANDLING; you can check errno to see what went wrong */
exit(1);
}

When you have opened the device, you must specify with what device
address you want to communicate:
int addr = 0x40; /* The I2C address */
if (ioctl(file,I2C_SLAVE,addr) < 0) {
/* ERROR HANDLING; you can check errno to see what went wrong */
exit(1);
}
----

For EEPROMs the i2c address is usually something between 0x50...0x55.

Holger





Home | Main Index | Thread Index