Mailing List archive

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

[linux-dvb] Re: refactoring



>  > >  It
>  > >creates and registeres i2c_client structs for both demod + pll and then
>  > >passes around just a i2c_client ptr (instead of a fe-specific struct)
>  > > to many functions, like this one here:
>  > >
>  > >   static int pll_dtt759x_set_tv_freq(struct i2c_client *c, u32 freq,
>  > >                 int bandwidth);
>  > >
>  > >It's absolutely no problem to move that to some other -- say -- pll-lib
>  > >module and then have other frontend driver reuse it.
>  >
>  > I have to say that I prefer Andrew's approach much more, it's simply
>  > more professional + easier to understand and maintain.
>
> No, it also has disadvantages. It is less modular and you need to
> write lots of code to support each frontend specifically in each driver.
> I have several drivers where I, instead of just supporting an I2C
> driver, would have to write tons of new code for frontend support on
> top of that if I used that approach.

There are disadantages and advantages to each. One of the primary ideas for 
this refactoring was to remove the spaghetti card-specific code from the 
demodulators and move it to the card drivers. 

The alternative is to have the card specific code in the demodulator driver 
mixed in with all the other support for other cards - just look at the old 
stv0299. Either way you have to have that code *somewhere*. I prefer such 
code in the card-specific driver code, and not in the shared demodulator 
library.

Remember you are looking at a work in progress.




Home | Main Index | Thread Index