Andrew de Quincey wrote:
On Friday 14 April 2006 13:57, Andrew de Quincey wrote:
OK, after consulting with Manu a bit, my original idea isn't going to work
well. Here is an updated patch.
The initialisation sequence would now be:
struct dvb_frontend *fe = stv0299_attach();
stb6100_attach(fe);
The stb6100 attaches itself to the stv0299 using the (*attach_tuner)()
callback.
After that, the stv0299 is then responsible for controlling the PLL - so
this really just becomes a standardised/expanded way of how we do it
already.
Main reason being - many of the enhanced demod tuning algorithms will need
to control the tuner directly - my idea of the frontend loop doing this
just isn't flexible enough.
Yet another change. This new patch exposes the tuner function pointers to the
world (as a part of dvb_frontend_ops) so that the card driver can override
them..
For example many of the tda10045 cards have an extra chip on them which needs
to be set correctly for the bandwidth - this would be done by the card driver
overriding the tuner's set_bandwidth() function pointer with its own
implementation.
Looks nice, switching over ..
Thanks,
Manu
------------------------------------------------------------------------
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-core/dvb_frontend.h
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Fri Apr 14 14:07:09 2006 +0100
@@ -49,6 +49,21 @@ struct dvb_frontend_tune_settings {
struct dvb_frontend;
+struct dvb_tuner_ops {
+ int (*release)(struct dvb_frontend *fe, void*tuner_priv);
+
+ int (*init)(struct dvb_frontend *fe, void *tuner_priv);
+ int (*sleep)(struct dvb_frontend *fe, void *tuner_priv);
+
+ int (*set_frequency)(struct dvb_frontend *fe, void *tuner_priv, u32 frequency);
+ int (*get_frequency)(struct dvb_frontend *fe, void *tuner_priv, u32 *frequency);
+ int (*set_bandwidth)(struct dvb_frontend *fe, void *tuner_priv, u32 bandwidth);
+ int (*get_bandwidth)(struct dvb_frontend *fe, void *tuner_priv, u32 *bandwidth);
+
+#define TUNER_STATUS_LOCKED 1
+ int (*get_status)(struct dvb_frontend *fe, void *tuner_priv, u32 *status);
+};
+
struct dvb_frontend_ops {
struct dvb_frontend_info info;
@@ -86,7 +101,12 @@ struct dvb_frontend_ops {
int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, long arg);
int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable);
+
+ int (*attach_tuner)(struct dvb_frontend *fe, void *tuner_priv);
+
+ struct dvb_tuner_ops tuner_ops;
};
+
#define MAX_EVENT 8
_______________________________________________
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb