]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] tda18271: add tda18271_get_if_frequency
authorMichael Krufky <mkrufky@linuxtv.org>
Thu, 3 Nov 2011 12:59:42 +0000 (09:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 8 Nov 2011 10:25:15 +0000 (08:25 -0200)
Reported-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tda18271-fe.c
drivers/media/common/tuners/tda18271-priv.h

index 63cc4004e211e9654044b612400460bb93832bf9..3347c5b488dd41dd1b3116ab8867a1ed9d982f40 100644 (file)
@@ -994,6 +994,7 @@ static int tda18271_set_params(struct dvb_frontend *fe,
        if (tda_fail(ret))
                goto fail;
 
+       priv->if_freq   = map->if_freq;
        priv->frequency = freq;
        priv->bandwidth = (fe->ops.info.type == FE_OFDM) ?
                params->u.ofdm.bandwidth : 0;
@@ -1050,6 +1051,7 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
        if (tda_fail(ret))
                goto fail;
 
+       priv->if_freq   = map->if_freq;
        priv->frequency = freq;
        priv->bandwidth = 0;
 fail:
@@ -1086,6 +1088,13 @@ static int tda18271_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
        return 0;
 }
 
+static int tda18271_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
+{
+       struct tda18271_priv *priv = fe->tuner_priv;
+       *frequency = (u32)priv->if_freq * 1000;
+       return 0;
+}
+
 /* ------------------------------------------------------------------ */
 
 #define tda18271_update_std(std_cfg, name) do {                                \
@@ -1245,6 +1254,7 @@ static const struct dvb_tuner_ops tda18271_tuner_ops = {
        .set_config        = tda18271_set_config,
        .get_frequency     = tda18271_get_frequency,
        .get_bandwidth     = tda18271_get_bandwidth,
+       .get_if_frequency  = tda18271_get_if_frequency,
 };
 
 struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
index 94340f47562bbe36c01a5035a0633ff1c2149c72..454c152ccaa023d66423591108ca16616c058660 100644 (file)
@@ -122,6 +122,8 @@ struct tda18271_priv {
 
        struct mutex lock;
 
+       u16 if_freq;
+
        u32 frequency;
        u32 bandwidth;
 };