aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stb0899_drv.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2008-02-03 17:37:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:23 -0500
commit40e8ce3dba8e9437ed48c88c268615dc0a4bebb2 (patch)
treeb5588068dfd4ff2e7a16c420f98110a5be6ce711 /drivers/media/dvb/frontends/stb0899_drv.c
parented3d150eacfa87087f705a908a2586bdec5bf9b7 (diff)
V4L/DVB (9457): 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 Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stb0899_drv.c')
-rw-r--r--drivers/media/dvb/frontends/stb0899_drv.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c
index 196a837f11ce..333b983b04ab 100644
--- a/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/drivers/media/dvb/frontends/stb0899_drv.c
@@ -1241,7 +1241,7 @@ static int stb0899_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
1241 return 0; 1241 return 0;
1242} 1242}
1243 1243
1244static int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) 1244int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
1245{ 1245{
1246 int i2c_stat; 1246 int i2c_stat;
1247 struct stb0899_state *state = fe->demodulator_priv; 1247 struct stb0899_state *state = fe->demodulator_priv;
@@ -1255,10 +1255,15 @@ static int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
1255 i2c_stat |= STB0899_I2CTON; 1255 i2c_stat |= STB0899_I2CTON;
1256 if (stb0899_write_reg(state, STB0899_I2CRPT, i2c_stat) < 0) 1256 if (stb0899_write_reg(state, STB0899_I2CRPT, i2c_stat) < 0)
1257 goto err; 1257 goto err;
1258 } else {
1259 dprintk(state->verbose, FE_DEBUG, 1, "Disabling I2C Repeater ...");
1260 i2c_stat &= ~STB0899_I2CTON;
1261 if (stb0899_write_reg(state, STB0899_I2CRPT, i2c_stat) < 0)
1262 goto err;
1258 } 1263 }
1259 return 0; 1264 return 0;
1260err: 1265err:
1261 dprintk(state->verbose, FE_ERROR, 1, "I2C Repeater enable failed"); 1266 dprintk(state->verbose, FE_ERROR, 1, "I2C Repeater control failed");
1262 return -EREMOTEIO; 1267 return -EREMOTEIO;
1263} 1268}
1264 1269
@@ -1592,10 +1597,17 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1592 internal->derot_percent = 30; 1597 internal->derot_percent = 30;
1593 1598
1594 /* What to do for tuners having no bandwidth setup ? */ 1599 /* What to do for tuners having no bandwidth setup ? */
1600 /* enable tuner I/O */
1601 stb0899_i2c_gate_ctrl(&state->frontend, 1);
1602
1595 if (state->config->tuner_set_bandwidth) 1603 if (state->config->tuner_set_bandwidth)
1596 state->config->tuner_set_bandwidth(fe, (13 * (stb0899_carr_width(state) + SearchRange)) / 10); 1604 state->config->tuner_set_bandwidth(fe, (13 * (stb0899_carr_width(state) + SearchRange)) / 10);
1597 if (state->config->tuner_get_bandwidth) 1605 if (state->config->tuner_get_bandwidth)
1598 state->config->tuner_get_bandwidth(fe, &internal->tuner_bw); 1606 state->config->tuner_get_bandwidth(fe, &internal->tuner_bw);
1607
1608 /* disable tuner I/O */
1609 stb0899_i2c_gate_ctrl(&state->frontend, 0);
1610
1599 /* Set DVB-S1 AGC */ 1611 /* Set DVB-S1 AGC */
1600 stb0899_write_reg(state, STB0899_AGCRFCFG, 0x11); 1612 stb0899_write_reg(state, STB0899_AGCRFCFG, 0x11);
1601 1613
@@ -1624,11 +1636,17 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1624 internal->srate = i_params->srate; 1636 internal->srate = i_params->srate;
1625 internal->srch_range = SearchRange; 1637 internal->srch_range = SearchRange;
1626 1638
1639 /* enable tuner I/O */
1640 stb0899_i2c_gate_ctrl(&state->frontend, 1);
1641
1627 if (state->config->tuner_set_bandwidth) 1642 if (state->config->tuner_set_bandwidth)
1628 state->config->tuner_set_bandwidth(fe, (stb0899_carr_width(state) + SearchRange)); 1643 state->config->tuner_set_bandwidth(fe, (stb0899_carr_width(state) + SearchRange));
1629 if (state->config->tuner_get_bandwidth) 1644 if (state->config->tuner_get_bandwidth)
1630 state->config->tuner_get_bandwidth(fe, &internal->tuner_bw); 1645 state->config->tuner_get_bandwidth(fe, &internal->tuner_bw);
1631 1646
1647 /* disable tuner I/O */
1648 stb0899_i2c_gate_ctrl(&state->frontend, 0);
1649
1632// pParams->SpectralInv = pSearch->IQ_Inversion; 1650// pParams->SpectralInv = pSearch->IQ_Inversion;
1633 1651
1634 /* Set DVB-S2 AGC */ 1652 /* Set DVB-S2 AGC */