summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/stb0899_algo.c
diff options
context:
space:
mode:
authorManu Abraham <manu@linuxtv.org>2008-02-04 02:37:02 +0400
committerManu Abraham <manu@linuxtv.org>2008-02-04 02:37:02 +0400
commita52af51ed4b377cab3886bb48864a036a2b0081c (patch)
tree3d7694278c9d702253f0018beced2fa614251764 /linux/drivers/media/dvb/frontends/stb0899_algo.c
parentaff258c53f552369f3eed1508f809a808e368f1e (diff)
downloadmediapointer-dvb-s2-a52af51ed4b377cab3886bb48864a036a2b0081c.tar.gz
mediapointer-dvb-s2-a52af51ed4b377cab3886bb48864a036a2b0081c.tar.bz2
Optimization, Fix a Bug
* cut down some I/O operations by disabling "disable gate" * budget_av was left with the gate open, thereby more susceptible to RF interference due to I/O operations From: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/stb0899_algo.c')
-rw-r--r--linux/drivers/media/dvb/frontends/stb0899_algo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/frontends/stb0899_algo.c b/linux/drivers/media/dvb/frontends/stb0899_algo.c
index 355c73d5c..e144f3dc2 100644
--- a/linux/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c
@@ -583,6 +583,9 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state)
internal->derot_freq = 0;
internal->status = NOAGC1;
+ /* enable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 1);
+
/* Move tuner to frequency */
dprintk(state->verbose, FE_DEBUG, 1, "Tuner set frequency");
if (state->config->tuner_set_frequency)
@@ -598,6 +601,10 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state)
/* There is signal in the band */
if (config->tuner_get_bandwidth)
config->tuner_get_bandwidth(&state->frontend, &bandwidth);
+
+ /* disable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 0);
+
if (params->srate <= bandwidth / 2)
stb0899_search_tmg(state); /* For low rates (SCPC) */
else
@@ -1338,12 +1345,18 @@ enum stb0899_status stb0899_dvbs2_algo(struct stb0899_state *state)
STB0899_SETFIELD_VAL(FRESRS, reg, 1);
stb0899_write_reg(state, STB0899_TSTRES, reg);
+ /* enable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 1);
+
/* Move tuner to frequency */
if (state->config->tuner_set_frequency)
state->config->tuner_set_frequency(&state->frontend, internal->freq);
if (state->config->tuner_get_frequency)
state->config->tuner_get_frequency(&state->frontend, &internal->freq);
+ /* disable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 0);
+
/* Set IF AGC to acquisition */
reg = STB0899_READ_S2REG(STB0899_S2DEMOD, IF_AGC_CNTRL);
STB0899_SETFIELD_VAL(IF_LOOP_GAIN, reg, 4);