Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8832e8f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: default avatarAntti Palosaari <crope@iki.fi>
parent b5e2b97b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -396,7 +396,11 @@ static int rtl2832_set_if(struct dvb_frontend *fe, u32 if_freq)
	pset_iffreq = if_freq % priv->cfg.xtal;
	pset_iffreq *= 0x400000;
	pset_iffreq = div_u64(pset_iffreq, priv->cfg.xtal);
	pset_iffreq = -pset_iffreq;
	pset_iffreq = pset_iffreq & 0x3fffff;
	dev_dbg(&priv->i2c->dev, "%s: if_frequency=%d pset_iffreq=%08x\n",
			__func__, if_freq, (unsigned)pset_iffreq);

	ret = rtl2832_wr_demod_reg(priv, DVBT_EN_BBIN, en_bbin);
	if (ret)
		return ret;