diff options
author | Antti Palosaari <crope@iki.fi> | 2011-11-13 09:20:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-24 14:53:30 -0500 |
commit | 835bf82ce4b64e280ca6c4da67c819a1065693bc (patch) | |
tree | 2ea070bf6081c88381a7872b719a60e979643ee8 /drivers/media/common/tuners/tda18212.c | |
parent | ed9405140e1ad1602352d525afede193ebfd67d7 (diff) |
[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.c | 15 |
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 @@ | |||
25 | struct tda18212_priv { | 25 | struct tda18212_priv { |
26 | struct tda18212_config *cfg; | 26 | struct tda18212_config *cfg; |
27 | struct i2c_adapter *i2c; | 27 | struct i2c_adapter *i2c; |
28 | |||
29 | u32 if_frequency; | ||
28 | }; | 30 | }; |
29 | 31 | ||
30 | #define dbg(fmt, arg...) \ | 32 | #define dbg(fmt, arg...) \ |
@@ -235,6 +237,9 @@ static int tda18212_set_params(struct dvb_frontend *fe, | |||
235 | if (ret) | 237 | if (ret) |
236 | goto error; | 238 | goto error; |
237 | 239 | ||
240 | /* actual IF rounded as it is on register */ | ||
241 | priv->if_frequency = buf[3] * 50 * 1000; | ||
242 | |||
238 | exit: | 243 | exit: |
239 | if (fe->ops.i2c_gate_ctrl) | 244 | if (fe->ops.i2c_gate_ctrl) |
240 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ | 245 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ |
@@ -246,6 +251,15 @@ error: | |||
246 | goto exit; | 251 | goto exit; |
247 | } | 252 | } |
248 | 253 | ||
254 | static int tda18212_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) | ||
255 | { | ||
256 | struct tda18212_priv *priv = fe->tuner_priv; | ||
257 | |||
258 | *frequency = priv->if_frequency; | ||
259 | |||
260 | return 0; | ||
261 | } | ||
262 | |||
249 | static int tda18212_release(struct dvb_frontend *fe) | 263 | static int tda18212_release(struct dvb_frontend *fe) |
250 | { | 264 | { |
251 | kfree(fe->tuner_priv); | 265 | kfree(fe->tuner_priv); |
@@ -265,6 +279,7 @@ static const struct dvb_tuner_ops tda18212_tuner_ops = { | |||
265 | .release = tda18212_release, | 279 | .release = tda18212_release, |
266 | 280 | ||
267 | .set_params = tda18212_set_params, | 281 | .set_params = tda18212_set_params, |
282 | .get_if_frequency = tda18212_get_if_frequency, | ||
268 | }; | 283 | }; |
269 | 284 | ||
270 | struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, | 285 | struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, |