diff options
author | Antti Palosaari <crope@iki.fi> | 2011-11-13 00:19:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-24 17:50:57 -0200 |
commit | 522fdf731946301ab7a5ecf854cbe89462397b81 (patch) | |
tree | f8d7dd93f90d91d9e92d07b87e1403dc289dd0fc /drivers/media/common/tuners/tda18218.c | |
parent | 022568f05891b6a371f0fdbab9abccf9239276a2 (diff) |
[media] tda18218: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18218.c')
-rw-r--r-- | drivers/media/common/tuners/tda18218.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c index aacfe2387e28..1c865950ddf4 100644 --- a/drivers/media/common/tuners/tda18218.c +++ b/drivers/media/common/tuners/tda18218.c @@ -141,19 +141,21 @@ static int tda18218_set_params(struct dvb_frontend *fe, switch (params->u.ofdm.bandwidth) { case BANDWIDTH_6_MHZ: LP_Fc = 0; - LO_Frac = params->frequency + 4000000; + priv->if_frequency = 4000000; break; case BANDWIDTH_7_MHZ: LP_Fc = 1; - LO_Frac = params->frequency + 3500000; + priv->if_frequency = 3500000; break; case BANDWIDTH_8_MHZ: default: LP_Fc = 2; - LO_Frac = params->frequency + 4000000; + priv->if_frequency = 4000000; break; } + LO_Frac = params->frequency + priv->if_frequency; + /* band-pass filter */ if (LO_Frac < 188000000) BP_Filter = 3; @@ -206,6 +208,14 @@ error: return ret; } +static int tda18218_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) +{ + struct tda18218_priv *priv = fe->tuner_priv; + *frequency = priv->if_frequency; + dbg("%s: if=%d", __func__, *frequency); + return 0; +} + static int tda18218_sleep(struct dvb_frontend *fe) { struct tda18218_priv *priv = fe->tuner_priv; @@ -268,6 +278,8 @@ static const struct dvb_tuner_ops tda18218_tuner_ops = { .sleep = tda18218_sleep, .set_params = tda18218_set_params, + + .get_if_frequency = tda18218_get_if_frequency, }; struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, |