aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/cxd2820r_c.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-11-13 12:41:25 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-24 14:54:04 -0500
commitfda23faaff3b28a987c22da5f3a17b9f3d4acef8 (patch)
treee4dd0371287b0aef94fbd33249181603b11595b5 /drivers/media/dvb/frontends/cxd2820r_c.c
parent8cffcc78996c25a04423e294faa1bb5bba3e420e (diff)
[media] cxd2820r: switch to .get_if_frequency()
All tuners used with cxd2820r offers IF frequency so switch that. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/cxd2820r_c.c')
-rw-r--r--drivers/media/dvb/frontends/cxd2820r_c.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/cxd2820r_c.c b/drivers/media/dvb/frontends/cxd2820r_c.c
index b85f5011e344..c4128773f2ee 100644
--- a/drivers/media/dvb/frontends/cxd2820r_c.c
+++ b/drivers/media/dvb/frontends/cxd2820r_c.c
@@ -28,6 +28,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
28 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 28 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
29 int ret, i; 29 int ret, i;
30 u8 buf[2]; 30 u8 buf[2];
31 u32 if_freq;
31 u16 if_ctl; 32 u16 if_ctl;
32 u64 num; 33 u64 num;
33 struct reg_val_mask tab[] = { 34 struct reg_val_mask tab[] = {
@@ -70,7 +71,17 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
70 priv->delivery_system = SYS_DVBC_ANNEX_AC; 71 priv->delivery_system = SYS_DVBC_ANNEX_AC;
71 priv->ber_running = 0; /* tune stops BER counter */ 72 priv->ber_running = 0; /* tune stops BER counter */
72 73
73 num = priv->cfg.if_dvbc; 74 /* program IF frequency */
75 if (fe->ops.tuner_ops.get_if_frequency) {
76 ret = fe->ops.tuner_ops.get_if_frequency(fe, &if_freq);
77 if (ret)
78 goto error;
79 } else
80 if_freq = 0;
81
82 dbg("%s: if_freq=%d", __func__, if_freq);
83
84 num = if_freq / 1000; /* Hz => kHz */
74 num *= 0x4000; 85 num *= 0x4000;
75 if_ctl = cxd2820r_div_u64_round_closest(num, 41000); 86 if_ctl = cxd2820r_div_u64_round_closest(num, 41000);
76 buf[0] = (if_ctl >> 8) & 0x3f; 87 buf[0] = (if_ctl >> 8) & 0x3f;