summaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/tda18212.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-11-13 11:20:08 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-24 17:53:30 -0200
commit835bf82ce4b64e280ca6c4da67c819a1065693bc (patch)
tree2ea070bf6081c88381a7872b719a60e979643ee8 /drivers/media/common/tuners/tda18212.c
parented9405140e1ad1602352d525afede193ebfd67d7 (diff)
downloadlinux-835bf82ce4b64e280ca6c4da67c819a1065693bc.tar.gz
linux-835bf82ce4b64e280ca6c4da67c819a1065693bc.tar.bz2
linux-835bf82ce4b64e280ca6c4da67c819a1065693bc.zip
[media] tda18212: 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/tda18212.c')
-rw-r--r--drivers/media/common/tuners/tda18212.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c
index 6374a1e010bf..b1750d21b486 100644
--- a/drivers/media/common/tuners/tda18212.c
+++ b/drivers/media/common/tuners/tda18212.c
@@ -25,6 +25,8 @@
struct tda18212_priv {
struct tda18212_config *cfg;
struct i2c_adapter *i2c;
+
+ u32 if_frequency;
};
#define dbg(fmt, arg...) \
@@ -235,6 +237,9 @@ static int tda18212_set_params(struct dvb_frontend *fe,
if (ret)
goto error;
+ /* actual IF rounded as it is on register */
+ priv->if_frequency = buf[3] * 50 * 1000;
+
exit:
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
@@ -246,6 +251,15 @@ error:
goto exit;
}
+static int tda18212_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
+{
+ struct tda18212_priv *priv = fe->tuner_priv;
+
+ *frequency = priv->if_frequency;
+
+ return 0;
+}
+
static int tda18212_release(struct dvb_frontend *fe)
{
kfree(fe->tuner_priv);
@@ -265,6 +279,7 @@ static const struct dvb_tuner_ops tda18212_tuner_ops = {
.release = tda18212_release,
.set_params = tda18212_set_params,
+ .get_if_frequency = tda18212_get_if_frequency,
};
struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe,