Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285548
b: refs/heads/master
c: 35aa48e
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 2626793 commit 6159afb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 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: 5c6b4e2b32d0578c7fad1afd056c92354cf4c85b
refs/heads/master: 35aa48e74972961c6d6df21da32099f6679ae423
35 changes: 18 additions & 17 deletions trunk/drivers/media/dvb/frontends/stv0297.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,9 @@ static int stv0297_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks)
return 0;
}

static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
static int stv0297_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct stv0297_state *state = fe->demodulator_priv;
int u_threshold;
int initial_u;
Expand All @@ -417,7 +418,7 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
unsigned long timeout;
fe_spectral_inversion_t inversion;

switch (p->u.qam.modulation) {
switch (p->modulation) {
case QAM_16:
case QAM_32:
case QAM_64:
Expand Down Expand Up @@ -519,16 +520,16 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
stv0297_writereg_mask(state, 0x69, 0x0f, 0x00);

/* set parameters */
stv0297_set_qam(state, p->u.qam.modulation);
stv0297_set_symbolrate(state, p->u.qam.symbol_rate / 1000);
stv0297_set_sweeprate(state, sweeprate, p->u.qam.symbol_rate / 1000);
stv0297_set_qam(state, p->modulation);
stv0297_set_symbolrate(state, p->symbol_rate / 1000);
stv0297_set_sweeprate(state, sweeprate, p->symbol_rate / 1000);
stv0297_set_carrieroffset(state, carrieroffset);
stv0297_set_inversion(state, inversion);

/* kick off lock */
/* Disable corner detection for higher QAMs */
if (p->u.qam.modulation == QAM_128 ||
p->u.qam.modulation == QAM_256)
if (p->modulation == QAM_128 ||
p->modulation == QAM_256)
stv0297_writereg_mask(state, 0x88, 0x08, 0x00);
else
stv0297_writereg_mask(state, 0x88, 0x08, 0x08);
Expand Down Expand Up @@ -613,7 +614,7 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
return 0;
}

static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
static int stv0297_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
{
struct stv0297_state *state = fe->demodulator_priv;
int reg_00, reg_83;
Expand All @@ -625,24 +626,24 @@ static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
p->inversion = (reg_83 & 0x08) ? INVERSION_ON : INVERSION_OFF;
if (state->config->invert)
p->inversion = (p->inversion == INVERSION_ON) ? INVERSION_OFF : INVERSION_ON;
p->u.qam.symbol_rate = stv0297_get_symbolrate(state) * 1000;
p->u.qam.fec_inner = FEC_NONE;
p->symbol_rate = stv0297_get_symbolrate(state) * 1000;
p->fec_inner = FEC_NONE;

switch ((reg_00 >> 4) & 0x7) {
case 0:
p->u.qam.modulation = QAM_16;
p->modulation = QAM_16;
break;
case 1:
p->u.qam.modulation = QAM_32;
p->modulation = QAM_32;
break;
case 2:
p->u.qam.modulation = QAM_128;
p->modulation = QAM_128;
break;
case 3:
p->u.qam.modulation = QAM_256;
p->modulation = QAM_256;
break;
case 4:
p->u.qam.modulation = QAM_64;
p->modulation = QAM_64;
break;
}

Expand Down Expand Up @@ -706,8 +707,8 @@ static struct dvb_frontend_ops stv0297_ops = {
.sleep = stv0297_sleep,
.i2c_gate_ctrl = stv0297_i2c_gate_ctrl,

.set_frontend_legacy = stv0297_set_frontend,
.get_frontend_legacy = stv0297_get_frontend,
.set_frontend = stv0297_set_frontend,
.get_frontend = stv0297_get_frontend,

.read_status = stv0297_read_status,
.read_ber = stv0297_read_ber,
Expand Down

0 comments on commit 6159afb

Please sign in to comment.