summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/stb0899_drv.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_drv.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_drv.c')
-rw-r--r--linux/drivers/media/dvb/frontends/stb0899_drv.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/stb0899_drv.c b/linux/drivers/media/dvb/frontends/stb0899_drv.c
index 4beda52fb..a3f019b3c 100644
--- a/linux/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/linux/drivers/media/dvb/frontends/stb0899_drv.c
@@ -1282,7 +1282,7 @@ static int stb0899_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
return 0;
}
-static int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
+int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
int i2c_stat;
struct stb0899_state *state = fe->demodulator_priv;
@@ -1296,10 +1296,15 @@ static int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
i2c_stat |= STB0899_I2CTON;
if (stb0899_write_reg(state, STB0899_I2CRPT, i2c_stat) < 0)
goto err;
+ } else {
+ dprintk(state->verbose, FE_DEBUG, 1, "Disabling I2C Repeater ...");
+ i2c_stat &= ~STB0899_I2CTON;
+ if (stb0899_write_reg(state, STB0899_I2CRPT, i2c_stat) < 0)
+ goto err;
}
return 0;
err:
- dprintk(state->verbose, FE_ERROR, 1, "I2C Repeater enable failed");
+ dprintk(state->verbose, FE_ERROR, 1, "I2C Repeater control failed");
return -EREMOTEIO;
}
@@ -1633,10 +1638,17 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
internal->derot_percent = 30;
/* What to do for tuners having no bandwidth setup ? */
+ /* enable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 1);
+
if (state->config->tuner_set_bandwidth)
state->config->tuner_set_bandwidth(fe, (13 * (stb0899_carr_width(state) + SearchRange)) / 10);
if (state->config->tuner_get_bandwidth)
state->config->tuner_get_bandwidth(fe, &internal->tuner_bw);
+
+ /* disable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 0);
+
/* Set DVB-S1 AGC */
stb0899_write_reg(state, STB0899_AGCRFCFG, 0x11);
@@ -1665,11 +1677,17 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
internal->srate = i_params->srate;
internal->srch_range = SearchRange;
+ /* enable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 1);
+
if (state->config->tuner_set_bandwidth)
state->config->tuner_set_bandwidth(fe, (stb0899_carr_width(state) + SearchRange));
if (state->config->tuner_get_bandwidth)
state->config->tuner_get_bandwidth(fe, &internal->tuner_bw);
+ /* disable tuner I/O */
+ stb0899_i2c_gate_ctrl(&state->frontend, 0);
+
// pParams->SpectralInv = pSearch->IQ_Inversion;
/* Set DVB-S2 AGC */