V4L/DVB (6839): tuner: add set_config to struct analog_tuner_ops
authorMichael Krufky <mkrufky@linuxtv.org>
Sun, 16 Dec 2007 22:27:23 +0000 (19:27 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:03:53 +0000 (19:03 -0200)
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-core.c
drivers/media/video/tuner-driver.h

index 355f9810facf9cbdc7c49f3b7af558c27f7cfb9c..9134b997ef239bc0e12b755a063b91c4c3f8d157 100644 (file)
@@ -154,6 +154,19 @@ static int fe_has_signal(struct dvb_frontend *fe)
        return strength;
 }
 
+static int fe_set_config(struct dvb_frontend *fe, void *priv_cfg)
+{
+       struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops;
+       struct tuner *t = fe->analog_demod_priv;
+
+       if (fe_tuner_ops->set_config)
+               return fe_tuner_ops->set_config(fe, priv_cfg);
+
+       tuner_warn("Tuner frontend module has no way to set config\n");
+
+       return 0;
+}
+
 static void tuner_status(struct dvb_frontend *fe);
 
 static struct analog_tuner_ops tuner_core_ops = {
@@ -161,6 +174,7 @@ static struct analog_tuner_ops tuner_core_ops = {
        .standby        = fe_standby,
        .release        = fe_release,
        .has_signal     = fe_has_signal,
+       .set_config     = fe_set_config,
        .tuner_status   = tuner_status
 };
 
index 65ced435018aa18a902ddfe6117ddaa20cea4e29..7f43dc68ab2ec4d06d733a7cdd4515adb93e4950 100644 (file)
@@ -45,6 +45,9 @@ struct analog_tuner_ops {
        void (*standby)(struct dvb_frontend *fe);
        void (*release)(struct dvb_frontend *fe);
        int  (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
+
+       /** This is to allow setting tuner-specific configuration */
+       int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
 };
 
 struct tuner {