Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271857
b: refs/heads/master
c: 59152b1
h: refs/heads/master
i:
  271855: 3bb2359
v: v3
  • Loading branch information
tvboxspy authored and Mauro Carvalho Chehab committed Sep 21, 2011
1 parent 71619ba commit 11f8dbe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6783fe5f16c2fa9b474f096f66b3c8101fc48714
refs/heads/master: 59152b1cf1182fd671dafa056cebeed95d0b1468
29 changes: 21 additions & 8 deletions trunk/drivers/media/dvb/frontends/stv0288.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ static int stv0288_set_symbolrate(struct dvb_frontend *fe, u32 srate)
if ((srate < 1000000) || (srate > 45000000))
return -EINVAL;

stv0288_writeregI(state, 0x22, 0);
stv0288_writeregI(state, 0x23, 0);
stv0288_writeregI(state, 0x2b, 0xff);
stv0288_writeregI(state, 0x2c, 0xf7);

temp = (unsigned int)srate / 1000;

temp = temp * 32768;
Expand Down Expand Up @@ -461,6 +466,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,

char tm;
unsigned char tda[3];
u8 reg, time_out = 0;

dprintk("%s : FE_SET_FRONTEND\n", __func__);

Expand Down Expand Up @@ -488,22 +494,29 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
/* Carrier lock control register */
stv0288_writeregI(state, 0x15, 0xc5);

tda[0] = 0x2b; /* CFRM */
tda[2] = 0x0; /* CFRL */
for (tm = -6; tm < 7;) {
for (tm = -9; tm < 7;) {
/* Viterbi status */
if (stv0288_readreg(state, 0x24) & 0x8)
break;

tda[2] += 40;
if (tda[2] < 40)
reg = stv0288_readreg(state, 0x24);
if (reg & 0x8)
break;
if (reg & 0x80) {
time_out++;
if (time_out > 10)
break;
tda[2] += 40;
if (tda[2] < 40)
tm++;
} else {
tm++;
tda[2] = 0;
time_out = 0;
}
tda[1] = (unsigned char)tm;
stv0288_writeregI(state, 0x2b, tda[1]);
stv0288_writeregI(state, 0x2c, tda[2]);
udelay(30);
}

state->tuner_frequency = c->frequency;
state->fec_inner = FEC_AUTO;
state->symbol_rate = c->symbol_rate;
Expand Down

0 comments on commit 11f8dbe

Please sign in to comment.