[media] qt1010: remove fake implementaion of get_bandwidth()
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 21 Dec 2011 10:39:33 +0000 (07:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 31 Dec 2011 10:26:35 +0000 (08:26 -0200)
This driver implements a fake get_bandwidth() callback. In
reallity, the tuner driver won't adjust its low-pass
filter based on a bandwidth, and were just providing a fake
method for demods to read whatever was "set".

This code is useless, as none of the drivers that use
this tuner seems to require a get_bandwidth() callback.

While here, convert set_params to use the DVBv5 way to pass
parameters to tuners.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/qt1010.c
drivers/media/common/tuners/qt1010_priv.h

index cd461c2a4c38e789b1afcc91c10f38d7fc1c73a6..bd433adc492e8dac5077726606ff3dc2dd1f1f7e 100644 (file)
@@ -85,6 +85,7 @@ static void qt1010_dump_regs(struct qt1010_priv *priv)
 static int qt1010_set_params(struct dvb_frontend *fe,
                             struct dvb_frontend_parameters *params)
 {
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        struct qt1010_priv *priv;
        int err;
        u32 freq, div, mod1, mod2;
@@ -144,13 +145,11 @@ static int qt1010_set_params(struct dvb_frontend *fe,
 #define FREQ2  4000000 /* 4 MHz Quartz oscillator in the stick? */
 
        priv = fe->tuner_priv;
-       freq = params->frequency;
+       freq = c->frequency;
        div = (freq + QT1010_OFFSET) / QT1010_STEP;
        freq = (div * QT1010_STEP) - QT1010_OFFSET;
        mod1 = (freq + QT1010_OFFSET) % FREQ1;
        mod2 = (freq + QT1010_OFFSET) % FREQ2;
-       priv->bandwidth =
-               (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
        priv->frequency = freq;
 
        if (fe->ops.i2c_gate_ctrl)
@@ -321,6 +320,7 @@ static int qt1010_init(struct dvb_frontend *fe)
 {
        struct qt1010_priv *priv = fe->tuner_priv;
        struct dvb_frontend_parameters params;
+       struct dtv_frontend_properties *c = &fe->dtv_property_cache;
        int err = 0;
        u8 i, tmpval, *valptr = NULL;
 
@@ -397,7 +397,7 @@ static int qt1010_init(struct dvb_frontend *fe)
                if ((err = qt1010_init_meas2(priv, i, &tmpval)))
                        return err;
 
-       params.frequency = 545000000; /* Sigmatek DVB-110 545000000 */
+       c->frequency = 545000000; /* Sigmatek DVB-110 545000000 */
                                      /* MSI Megasky 580 GL861 533000000 */
        return qt1010_set_params(fe, &params);
 }
@@ -416,13 +416,6 @@ static int qt1010_get_frequency(struct dvb_frontend *fe, u32 *frequency)
        return 0;
 }
 
-static int qt1010_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
-{
-       struct qt1010_priv *priv = fe->tuner_priv;
-       *bandwidth = priv->bandwidth;
-       return 0;
-}
-
 static int qt1010_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        *frequency = 36125000;
@@ -443,7 +436,6 @@ static const struct dvb_tuner_ops qt1010_tuner_ops = {
 
        .set_params    = qt1010_set_params,
        .get_frequency = qt1010_get_frequency,
-       .get_bandwidth = qt1010_get_bandwidth,
        .get_if_frequency = qt1010_get_if_frequency,
 };
 
index 090cf475f099ea567f5ea7899f684952b62f7795..2c42d3f016366d5f7cb8b11baebee9d1342a3ea3 100644 (file)
@@ -99,7 +99,6 @@ struct qt1010_priv {
        u8 reg25_init_val;
 
        u32 frequency;
-       u32 bandwidth;
 };
 
 #endif