aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authortvboxspy <tvboxspy@gmail.com>2011-07-10 17:37:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-21 13:43:49 -0400
commit59152b1cf1182fd671dafa056cebeed95d0b1468 (patch)
tree443063f5f261735024ef36feef3d24d1067a6879 /drivers/media/dvb/frontends
parent6783fe5f16c2fa9b474f096f66b3c8101fc48714 (diff)
[media] STV0288 frontend provide wider carrier search and DVB-S2 drop out. resend
The following patch provides wider carrier search. As with existing code search starts at MSB aligned. The boundary is widened to start at -9. In order to save time, if no carrier is detected at the start it advances to the next alignment until carrier is found. The stv0288 will detect a DVB-S2 carrier on all steps , a time out of 11 steps is introduced to drop out of the loop. In stv0288_set_symbol carrier and timing loops are restored to default values (inittab) before setting the symbol rate on each tune. A slight drift was noticed with full scan in the higher IF frequencies of each band. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/stv0288.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/stv0288.c b/drivers/media/dvb/frontends/stv0288.c
index 8e0cfadba688..0aa3962ff18b 100644
--- a/drivers/media/dvb/frontends/stv0288.c
+++ b/drivers/media/dvb/frontends/stv0288.c
@@ -127,6 +127,11 @@ static int stv0288_set_symbolrate(struct dvb_frontend *fe, u32 srate)
127 if ((srate < 1000000) || (srate > 45000000)) 127 if ((srate < 1000000) || (srate > 45000000))
128 return -EINVAL; 128 return -EINVAL;
129 129
130 stv0288_writeregI(state, 0x22, 0);
131 stv0288_writeregI(state, 0x23, 0);
132 stv0288_writeregI(state, 0x2b, 0xff);
133 stv0288_writeregI(state, 0x2c, 0xf7);
134
130 temp = (unsigned int)srate / 1000; 135 temp = (unsigned int)srate / 1000;
131 136
132 temp = temp * 32768; 137 temp = temp * 32768;
@@ -461,6 +466,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
461 466
462 char tm; 467 char tm;
463 unsigned char tda[3]; 468 unsigned char tda[3];
469 u8 reg, time_out = 0;
464 470
465 dprintk("%s : FE_SET_FRONTEND\n", __func__); 471 dprintk("%s : FE_SET_FRONTEND\n", __func__);
466 472
@@ -488,22 +494,29 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
488 /* Carrier lock control register */ 494 /* Carrier lock control register */
489 stv0288_writeregI(state, 0x15, 0xc5); 495 stv0288_writeregI(state, 0x15, 0xc5);
490 496
491 tda[0] = 0x2b; /* CFRM */
492 tda[2] = 0x0; /* CFRL */ 497 tda[2] = 0x0; /* CFRL */
493 for (tm = -6; tm < 7;) { 498 for (tm = -9; tm < 7;) {
494 /* Viterbi status */ 499 /* Viterbi status */
495 if (stv0288_readreg(state, 0x24) & 0x8) 500 reg = stv0288_readreg(state, 0x24);
496 break; 501 if (reg & 0x8)
497 502 break;
498 tda[2] += 40; 503 if (reg & 0x80) {
499 if (tda[2] < 40) 504 time_out++;
505 if (time_out > 10)
506 break;
507 tda[2] += 40;
508 if (tda[2] < 40)
509 tm++;
510 } else {
500 tm++; 511 tm++;
512 tda[2] = 0;
513 time_out = 0;
514 }
501 tda[1] = (unsigned char)tm; 515 tda[1] = (unsigned char)tm;
502 stv0288_writeregI(state, 0x2b, tda[1]); 516 stv0288_writeregI(state, 0x2b, tda[1]);
503 stv0288_writeregI(state, 0x2c, tda[2]); 517 stv0288_writeregI(state, 0x2c, tda[2]);
504 udelay(30); 518 udelay(30);
505 } 519 }
506
507 state->tuner_frequency = c->frequency; 520 state->tuner_frequency = c->frequency;
508 state->fec_inner = FEC_AUTO; 521 state->fec_inner = FEC_AUTO;
509 state->symbol_rate = c->symbol_rate; 522 state->symbol_rate = c->symbol_rate;