[linux-dvb] Thoughts about supporting more complex tuners

Andrew de Quincey adq_dvb at lidskialf.net
Thu Apr 13 23:03:14 CEST 2006


Hi, we're starting to see cards which require more complex tuner code 
(especially with the new Silicon Tuners).. so much so that it begins to make 
sense to write these as their own standalone modules. I've been thinking how 
to incorporate these into the frontend structure. Attached is a first 
attempt.

As you can see, I have added some more ops to the frontend_ops structure and a 
tuner_priv field to the dvb_frontend structure. The idea being that when 
creating the frontend (pretend its stv0299 for the moment) for a card, you do 
the following:

dvb_frontend *fe = stv0299_attach();
acomplextuner_attach(fe);

So the stv0299 initalises the dvb_frontend first and fills out the ops 
function pointers. Then the tuner is attached, and fills out yet more 
function pointers (perhaps even overriding some of the demod ones) depending 
on precisely how the hardware is wired. The card driver can then override 
functions if it wants to (e.g. for DISEQC).

The tuner can control the demodulator's i2c switch (if present) using the 
i2c_gate_ctrl function pointer present in the ops structure (usually filled 
out by the demod attach function).

The frontend loop will be modified as well - instead of just calling 
set_frontend(), it will call tuner_set() beforehand as well.

Finally, if we do this, I would remove all the pll_set()/pll_init() function 
pointers in the demodulator config structures in favour of this method. I 
would however create a wrapper "simpletuner" so that we can continue with 
minimal code for the "simple" PLLs - theres no point in complicating these 
beasts.

Anyway, let me know what you think.. as I said this is a first attempt, so 
anything can be changed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tuner-support.patch
Type: text/x-diff
Size: 1099 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20060413/f69388ce/tuner-support.bin


More information about the linux-dvb mailing list