Skip to content

Commit

Permalink
[media] tda18212: implement .get_if_frequency()
Browse files Browse the repository at this point in the history
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent ed94051 commit 835bf82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/media/common/tuners/tda18212.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
struct tda18212_priv {
struct tda18212_config *cfg;
struct i2c_adapter *i2c;

u32 if_frequency;
};

#define dbg(fmt, arg...) \
Expand Down Expand Up @@ -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 */
Expand All @@ -246,6 +251,15 @@ static int tda18212_set_params(struct dvb_frontend *fe,
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);
Expand All @@ -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,
Expand Down

0 comments on commit 835bf82

Please sign in to comment.