Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[safe/jmp/linux-2.6] / drivers / media / video / tda8290.c
index bb62d56..55bc89a 100644 (file)
@@ -502,13 +502,22 @@ static void tda8290_init_tuner(struct dvb_frontend *fe)
 
 static void tda829x_release(struct dvb_frontend *fe)
 {
-       if (fe->ops.tuner_ops.release)
-               fe->ops.tuner_ops.release(fe);
+       struct tda8290_priv *priv = fe->analog_demod_priv;
+
+       /* only try to release the tuner if we've
+        * attached it from within this module */
+       if (priv->ver & (TDA18271 | TDA8275 | TDA8275A))
+               if (fe->ops.tuner_ops.release)
+                       fe->ops.tuner_ops.release(fe);
 
        kfree(fe->analog_demod_priv);
        fe->analog_demod_priv = NULL;
 }
 
+static struct tda18271_config tda829x_tda18271_config = {
+       .gate    = TDA18271_GATE_ANALOG,
+};
+
 static int tda829x_find_tuner(struct dvb_frontend *fe)
 {
        struct tda8290_priv *priv = fe->analog_demod_priv;
@@ -570,11 +579,11 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
                return -EREMOTEIO;
        }
 
-       if (data == 0x83) {
+       if ((data == 0x83) || (data == 0x84)) {
                priv->ver |= TDA18271;
                tda18271_attach(fe, priv->tda827x_addr,
                                priv->i2c_props.adap,
-                               TDA18271_GATE_ANALOG);
+                               &tda829x_tda18271_config);
        } else {
                if ((data & 0x3c) == 0)
                        priv->ver |= TDA8275;
@@ -636,9 +645,6 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
 }
 
 static struct analog_demod_ops tda8290_ops = {
-       .info           = {
-               .name   = "TDA8290",
-       },
        .set_params     = tda8290_set_params,
        .has_signal     = tda8290_has_signal,
        .standby        = tda8290_standby,
@@ -647,9 +653,6 @@ static struct analog_demod_ops tda8290_ops = {
 };
 
 static struct analog_demod_ops tda8295_ops = {
-       .info           = {
-               .name   = "TDA8295",
-       },
        .set_params     = tda8295_set_params,
        .has_signal     = tda8295_has_signal,
        .standby        = tda8295_standby,
@@ -722,6 +725,8 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
        }
        tuner_info("type set to %s\n", name);
 
+       fe->ops.analog_ops.info.name = name;
+
        if (priv->ver & TDA8290) {
                tda8290_init_tuner(fe);
                tda8290_init_if(fe);