Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285542
b: refs/heads/master
c: 827b5f3
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 3df1693 commit a166dd3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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: 16e3d13152797fc2ae66b948cd3229e9551896c3
refs/heads/master: 827b5f3e30296f5ddeedc0c0359b1db77fd499a6
36 changes: 18 additions & 18 deletions trunk/drivers/media/dvb/frontends/mt312.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ static int mt312_read_ucblocks(struct dvb_frontend *fe, u32 *ubc)
return 0;
}

static int mt312_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
static int mt312_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mt312_state *state = fe->demodulator_priv;
int ret;
u8 buf[5], config_val;
Expand All @@ -553,16 +553,16 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
|| (p->inversion > INVERSION_ON))
return -EINVAL;

if ((p->u.qpsk.symbol_rate < fe->ops.info.symbol_rate_min)
|| (p->u.qpsk.symbol_rate > fe->ops.info.symbol_rate_max))
if ((p->symbol_rate < fe->ops.info.symbol_rate_min)
|| (p->symbol_rate > fe->ops.info.symbol_rate_max))
return -EINVAL;

if ((p->u.qpsk.fec_inner < FEC_NONE)
|| (p->u.qpsk.fec_inner > FEC_AUTO))
if ((p->fec_inner < FEC_NONE)
|| (p->fec_inner > FEC_AUTO))
return -EINVAL;

if ((p->u.qpsk.fec_inner == FEC_4_5)
|| (p->u.qpsk.fec_inner == FEC_8_9))
if ((p->fec_inner == FEC_4_5)
|| (p->fec_inner == FEC_8_9))
return -EINVAL;

switch (state->id) {
Expand All @@ -574,7 +574,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
ret = mt312_readreg(state, CONFIG, &config_val);
if (ret < 0)
return ret;
if (p->u.qpsk.symbol_rate >= 30000000) {
if (p->symbol_rate >= 30000000) {
/* Note that 30MS/s should use 90MHz */
if (state->freq_mult == 6) {
/* We are running 60MHz */
Expand Down Expand Up @@ -609,19 +609,19 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
}

/* sr = (u16)(sr * 256.0 / 1000000.0) */
sr = mt312_div(p->u.qpsk.symbol_rate * 4, 15625);
sr = mt312_div(p->symbol_rate * 4, 15625);

/* SYM_RATE */
buf[0] = (sr >> 8) & 0x3f;
buf[1] = (sr >> 0) & 0xff;

/* VIT_MODE */
buf[2] = inv_tab[p->inversion] | fec_tab[p->u.qpsk.fec_inner];
buf[2] = inv_tab[p->inversion] | fec_tab[p->fec_inner];

/* QPSK_CTRL */
buf[3] = 0x40; /* swap I and Q before QPSK demodulation */

if (p->u.qpsk.symbol_rate < 10000000)
if (p->symbol_rate < 10000000)
buf[3] |= 0x04; /* use afc mode */

/* GO */
Expand All @@ -637,7 +637,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
}

static int mt312_get_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
struct dtv_frontend_properties *p)
{
struct mt312_state *state = fe->demodulator_priv;
int ret;
Expand All @@ -646,11 +646,11 @@ static int mt312_get_frontend(struct dvb_frontend *fe,
if (ret < 0)
return ret;

ret = mt312_get_symbol_rate(state, &p->u.qpsk.symbol_rate);
ret = mt312_get_symbol_rate(state, &p->symbol_rate);
if (ret < 0)
return ret;

ret = mt312_get_code_rate(state, &p->u.qpsk.fec_inner);
ret = mt312_get_code_rate(state, &p->fec_inner);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -738,7 +738,7 @@ static void mt312_release(struct dvb_frontend *fe)

#define MT312_SYS_CLK 90000000UL /* 90 MHz */
static struct dvb_frontend_ops mt312_ops = {

.delsys = { SYS_DVBS },
.info = {
.name = "Zarlink ???? DVB-S",
.type = FE_QPSK,
Expand All @@ -761,8 +761,8 @@ static struct dvb_frontend_ops mt312_ops = {
.sleep = mt312_sleep,
.i2c_gate_ctrl = mt312_i2c_gate_ctrl,

.set_frontend_legacy = mt312_set_frontend,
.get_frontend_legacy = mt312_get_frontend,
.set_frontend = mt312_set_frontend,
.get_frontend = mt312_get_frontend,
.get_tune_settings = mt312_get_tune_settings,

.read_status = mt312_read_status,
Expand Down

0 comments on commit a166dd3

Please sign in to comment.