summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/stb0899_algo.c
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2013-06-02 19:59:00 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-09 01:14:17 +0200
commit0c1d2b14d09b862ccd6300d774eb579161635710 (patch)
treeca80497dfd440f79d65a9a5c45e5d744f82ee581 /drivers/media/dvb-frontends/stb0899_algo.c
parent[media] stb0899: allow minimum symbol rate of 2000000 (diff)
downloadlinux-0c1d2b14d09b862ccd6300d774eb579161635710.tar.xz
linux-0c1d2b14d09b862ccd6300d774eb579161635710.zip
[media] stb0899: store successful inversion for next run
Usually, inversion doesn't change in a system. Storing the last successful inversion value speeds up tuning of DVB-S2 transponders. Signed-off-by: Reinhard Nißl <rnissl@gmx.de> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stb0899_algo.c')
-rw-r--r--drivers/media/dvb-frontends/stb0899_algo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/stb0899_algo.c b/drivers/media/dvb-frontends/stb0899_algo.c
index e0d31a2ea578..4b49efb67931 100644
--- a/drivers/media/dvb-frontends/stb0899_algo.c
+++ b/drivers/media/dvb-frontends/stb0899_algo.c
@@ -1488,9 +1488,15 @@ enum stb0899_status stb0899_dvbs2_algo(struct stb0899_state *state)
offsetfreq = offsetfreq / ((1 << 30) / 1000);
offsetfreq *= (internal->master_clk / 1000000);
+
+ /* store current inversion for next run */
reg = STB0899_READ_S2REG(STB0899_S2DEMOD, DMD_CNTRL2);
if (STB0899_GETFIELD(SPECTRUM_INVERT, reg))
- offsetfreq *= -1;
+ internal->inversion = IQ_SWAP_ON;
+ else
+ internal->inversion = IQ_SWAP_OFF;
+
+ offsetfreq *= internal->inversion;
internal->freq = internal->freq - offsetfreq;
internal->srate = stb0899_dvbs2_get_srate(state);