Mailing List archive

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

[linux-dvb] Re: [PATCHES] Frontend kernel i2c conversion.



Kenneth Aafløy writes:
 > On Sunday 18 July 2004 00:09, Ralph Metzler wrote:
 > > No, I also considered this before implementing the FE_(UN)REGISTER
 > > stuff but adapters with more than one I2C bus/frontend will not work like
 > > this. It also makes the frontend driver and dvbdev depend on I2C
 > > driver structs even if you are not using I2C.
 > 
 > Hmm, there is no drivers in CVS which has more than one I2C bus, is there?

No, but I know of at least one driver/hardware with more than one I2C bus. 

 
 > > You could of course register a list of i2c pointers (or better void *privs)
 > > with the adapter instead of just one.
 > > Or, to push it back into dvb_frontend, add calls like:
 > > dvb_(un)register_frontend_bus(struct dvb_adapter adapter, void *bus_priv);
 > > where bus_priv of course must not be NULL and can be either
 > > struct i2c_adapter* or anything else uniquely identifying the frontend
 > > driver.
 > 
 > Hmm, this is definatly something to consider. But first I want a working 
 > version with the i2c_adapter as unique identifier.
 > 
 > > Hmm, actually, forget about the last paragraph. There are even more
 > > problems, e.g. with the order of module loading, if the dvb_adapter
 > > is registered after the I2C bus (like with the bt878 cards).
 > 
 > I've split up the dvb_register_frontend in this version, because like you, I 
 > realized that the previous patch would not even work. This new version works 
 > as expected wether or not the dvb adapter has been registered when the i2c 
 > bus is up and running. I have had no opportunity to test the bttv driver, but 
 > it should work with the converted frontend now.


This now definitely only works with one frontend. 

You will also have to lock frontend registering against adapter 
registering now to remove the new possible race conditions. 

 
 > > And don't you also need more module locking because of the missing
 > > registration callbacks?
 > 
 > I don't think so, the i2c frontends will unregister itself before unloading, 
 > also the module refcount is bumped on open in current CVS.

What happens if the bt878 DVB driver is removed and not bttv? Is the
frontend device removed in this case?


Sorry, but to get all this done properly in the way you want to do it
(i.e. without the kernel i2c registration callback) you will basically
have to reimplement the whole dvb_i2c layer again ...



Ralph





Home | Main Index | Thread Index