diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-15 18:44:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-16 20:39:28 -0400 |
commit | c8832e8f4293b1c9fce92a92e2506572f5b11775 (patch) | |
tree | 3b0c9ba9a6edf54966cb594368d377e4ca21b57e /drivers/media/dvb-frontends/rtl2832.c | |
parent | b5e2b97b0ba474dd2abd672be320d1f1030800e8 (diff) |
[media] rtl2832: Fix IF calculus
Spectrum is inverted. So, we need to invert it when calculating the
value for the IF register
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Diffstat (limited to 'drivers/media/dvb-frontends/rtl2832.c')
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 2f5a2b504932..facb84841518 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c | |||
@@ -396,7 +396,11 @@ static int rtl2832_set_if(struct dvb_frontend *fe, u32 if_freq) | |||
396 | pset_iffreq = if_freq % priv->cfg.xtal; | 396 | pset_iffreq = if_freq % priv->cfg.xtal; |
397 | pset_iffreq *= 0x400000; | 397 | pset_iffreq *= 0x400000; |
398 | pset_iffreq = div_u64(pset_iffreq, priv->cfg.xtal); | 398 | pset_iffreq = div_u64(pset_iffreq, priv->cfg.xtal); |
399 | pset_iffreq = -pset_iffreq; | ||
399 | pset_iffreq = pset_iffreq & 0x3fffff; | 400 | pset_iffreq = pset_iffreq & 0x3fffff; |
401 | dev_dbg(&priv->i2c->dev, "%s: if_frequency=%d pset_iffreq=%08x\n", | ||
402 | __func__, if_freq, (unsigned)pset_iffreq); | ||
403 | |||
400 | ret = rtl2832_wr_demod_reg(priv, DVBT_EN_BBIN, en_bbin); | 404 | ret = rtl2832_wr_demod_reg(priv, DVBT_EN_BBIN, en_bbin); |
401 | if (ret) | 405 | if (ret) |
402 | return ret; | 406 | return ret; |