aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorOlivier Grenie <olivier.grenie@dibcom.fr>2009-09-23 12:41:27 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:04 -0500
commiteac1fe1050f223d28ebe5bb73b438d82ffd5b675 (patch)
tree48c0a240111e0a6bd72d6814f8a47df2e67fb3da /drivers/media/dvb
parentf8731f4ddedb78693ae05e40aac5c4817f740518 (diff)
V4L/DVB (13051): DiB7000P: improve rebostness of HAS_LOCK indicator
Update the dib7000p: The status is HAS_LOCK only if the demod is able to decode the TPS. Sometimes, there is a TPS data lock, even if the demod is not able to decode it (ex: no RF signal). For the STK7770P: correct value for the charge pump Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c1
-rw-r--r--drivers/media/dvb/frontends/dib7000p.c15
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index cda60291c06e..3b7e07749c3c 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -1176,6 +1176,7 @@ static struct dib0070_config dib7770p_dib0070_config = {
1176 .clock_khz = 12000, 1176 .clock_khz = 12000,
1177 .clock_pad_drive = 0, 1177 .clock_pad_drive = 0,
1178 .flip_chip = 1, 1178 .flip_chip = 1,
1179 .charge_pump = 2,
1179}; 1180};
1180 1181
1181static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) 1182static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 60e1aaaec5b3..750ae61a20f4 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -108,7 +108,7 @@ static int dib7000p_set_output_mode(struct dib7000p_state *state, int mode)
108 108
109 outreg = 0; 109 outreg = 0;
110 fifo_threshold = 1792; 110 fifo_threshold = 1792;
111 smo_mode = (dib7000p_read_word(state, 235) & 0x0010) | (1 << 1); 111 smo_mode = (dib7000p_read_word(state, 235) & 0x0050) | (1 << 1);
112 112
113 dprintk( "setting output mode for demod %p to %d", 113 dprintk( "setting output mode for demod %p to %d",
114 &state->demod, mode); 114 &state->demod, mode);
@@ -162,18 +162,19 @@ static int dib7000p_set_diversity_in(struct dvb_frontend *demod, int onoff)
162 if (state->div_force_off) { 162 if (state->div_force_off) {
163 dprintk( "diversity combination deactivated - forced by COFDM parameters"); 163 dprintk( "diversity combination deactivated - forced by COFDM parameters");
164 onoff = 0; 164 onoff = 0;
165 } 165 dib7000p_write_word(state, 207, 0);
166 } else
167 dib7000p_write_word(state, 207, (state->div_sync_wait << 4) | (1 << 2) | (2 << 0));
168
166 state->div_state = (u8)onoff; 169 state->div_state = (u8)onoff;
167 170
168 if (onoff) { 171 if (onoff) {
169 dib7000p_write_word(state, 204, 6); 172 dib7000p_write_word(state, 204, 6);
170 dib7000p_write_word(state, 205, 16); 173 dib7000p_write_word(state, 205, 16);
171 /* P_dvsy_sync_mode = 0, P_dvsy_sync_enable=1, P_dvcb_comb_mode=2 */ 174 /* P_dvsy_sync_mode = 0, P_dvsy_sync_enable=1, P_dvcb_comb_mode=2 */
172 dib7000p_write_word(state, 207, (state->div_sync_wait << 4) | (1 << 2) | (2 << 0));
173 } else { 175 } else {
174 dib7000p_write_word(state, 204, 1); 176 dib7000p_write_word(state, 204, 1);
175 dib7000p_write_word(state, 205, 0); 177 dib7000p_write_word(state, 205, 0);
176 dib7000p_write_word(state, 207, 0);
177 } 178 }
178 179
179 return 0; 180 return 0;
@@ -1188,7 +1189,7 @@ static int dib7000p_read_status(struct dvb_frontend *fe, fe_status_t *stat)
1188 *stat |= FE_HAS_VITERBI; 1189 *stat |= FE_HAS_VITERBI;
1189 if (lock & 0x0010) 1190 if (lock & 0x0010)
1190 *stat |= FE_HAS_SYNC; 1191 *stat |= FE_HAS_SYNC;
1191 if (lock & 0x0008) 1192 if ((lock & 0x0038) == 0x38)
1192 *stat |= FE_HAS_LOCK; 1193 *stat |= FE_HAS_LOCK;
1193 1194
1194 return 0; 1195 return 0;
@@ -1332,8 +1333,10 @@ int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 defau
1332 /* designated i2c address */ 1333 /* designated i2c address */
1333 new_addr = (0x40 + k) << 1; 1334 new_addr = (0x40 + k) << 1;
1334 st.i2c_addr = new_addr; 1335 st.i2c_addr = new_addr;
1336 dib7000p_write_word(&st, 1287, 0x0003); /* sram lead in, rdy */
1335 if (dib7000p_identify(&st) != 0) { 1337 if (dib7000p_identify(&st) != 0) {
1336 st.i2c_addr = default_addr; 1338 st.i2c_addr = default_addr;
1339 dib7000p_write_word(&st, 1287, 0x0003); /* sram lead in, rdy */
1337 if (dib7000p_identify(&st) != 0) { 1340 if (dib7000p_identify(&st) != 0) {
1338 dprintk("DiB7000P #%d: not identified\n", k); 1341 dprintk("DiB7000P #%d: not identified\n", k);
1339 return -EIO; 1342 return -EIO;
@@ -1390,6 +1393,8 @@ struct dvb_frontend * dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr,
1390 demod->demodulator_priv = st; 1393 demod->demodulator_priv = st;
1391 memcpy(&st->demod.ops, &dib7000p_ops, sizeof(struct dvb_frontend_ops)); 1394 memcpy(&st->demod.ops, &dib7000p_ops, sizeof(struct dvb_frontend_ops));
1392 1395
1396 dib7000p_write_word(st, 1287, 0x0003); /* sram lead in, rdy */
1397
1393 if (dib7000p_identify(st) != 0) 1398 if (dib7000p_identify(st) != 0)
1394 goto error; 1399 goto error;
1395 1400