Mailing List archive

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

[linux-dvb] Re: Proposal for new frontend architecture



On Thursday 23 Sep 2004 18:03, Michael Hunold wrote:
> Hi,
>
> On 23.09.2004 16:40, Gerd Knorr wrote:
> > To throw some real code into the discussion:  I've implemented that as
> > proof-of-concept for cx88-dvb adapter with cx22702 frontent.  The code
> > can be found in the latest video4linux cvs snapshot
> >
> >  => http://dl.bytesex.org/cvs-snapshots/
> >
> > FE_REGISTER is gone, no autoprobing, uses kernel i2c everythere,
> > registeres the clients so it is nicely visible in sysfs.  I've also
> > reworked the driver in general.
>
> I was just about to finish my proof-of-concept on the stv0299 driver.
> Grrr... ;-)
>
> > Havn't tried to split away the pll code yet.  The functions to program
> > the pll are pretty generic now through, they can likely moved to some
> > pll library module (and then shared with other fe drivers) without much
> > trouble.
>
> I still dislike the idea of a functional dependency between the dvb
> driver and the demod driver, so I tried to merge my stv0299 approach
> with your patch. It's only compile-tested, so no guarantee. Please have
> a look at the attached patches.
>
> cx88-dvb.c does an explicit request_module("cx22702") to make sure the
> frontend is there. Next, it uses the new i2c_connect_client() function.
>
> int i2c_connect_client(struct i2c_adapter *adap, int id, void
> *interface, struct i2c_client **client)
>
> It specifies the i2c id it wants to connect to, in this case the cx22702
> id. The i2c core then walks the list of registered drivers and calls
> driver->connect() on the right driver and provides an "interface"
> pointer. This pointer holds a driver-specific structure with additional
> informations or function pointers (for example for the pll stuff). I
> simply put the function arguments from your create function for now. If
> that succeeds, cx88-dvb holds a valid struct i2c_client * to the newly
> created i2c client.
>
> There is currently no i2c_disconnect_client(), cx88-dvb simply calls the
> disconnect function of the driver directly.

Looks interesting - I agree it would be better not to have an explicit 
dependency. The only niggly things I can think of are:

(a) It uses IDs to identify i2c clients - I believe there were reasons to 
avoid this for proprietary drivers - they'd need to have an i2c ID defined in 
the OSS kernel, which isn't right.

(b) It isn't typesafe.

> I added a I2C_NOPROBE flag to the struct i2c_adapter, so auto-probing
> drivers are kept away from this bus.

BTW: theres another place where you need to check for NOPROBE - when a new i2c 
driver is registered, it scans all i2c adapters.




Home | Main Index | Thread Index