Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285534
b: refs/heads/master
c: 80b5b74
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent cca6072 commit 04b4870
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 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: cf45787ced807791fc02ba9477b1bb320dd14801
refs/heads/master: 80b5b7459de18a3038486eda61d74785634feea3
31 changes: 19 additions & 12 deletions trunk/drivers/media/dvb/frontends/nxt6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,21 @@ static void nxt6000_reset(struct nxt6000_state* state)
nxt6000_writereg(state, OFDM_COR_CTL, val | COREACT);
}

static int nxt6000_set_bandwidth(struct nxt6000_state* state, fe_bandwidth_t bandwidth)
static int nxt6000_set_bandwidth(struct nxt6000_state *state, u32 bandwidth)
{
u16 nominal_rate;
int result;

switch (bandwidth) {

case BANDWIDTH_6_MHZ:
case 6000000:
nominal_rate = 0x55B7;
break;

case BANDWIDTH_7_MHZ:
case 7000000:
nominal_rate = 0x6400;
break;

case BANDWIDTH_8_MHZ:
case 8000000:
nominal_rate = 0x7249;
break;

Expand Down Expand Up @@ -457,8 +456,9 @@ static int nxt6000_init(struct dvb_frontend* fe)
return 0;
}

static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param)
static int nxt6000_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct nxt6000_state* state = fe->demodulator_priv;
int result;

Expand All @@ -467,13 +467,20 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}

if ((result = nxt6000_set_bandwidth(state, param->u.ofdm.bandwidth)) < 0)
result = nxt6000_set_bandwidth(state, p->bandwidth_hz);
if (result < 0)
return result;
if ((result = nxt6000_set_guard_interval(state, param->u.ofdm.guard_interval)) < 0)

result = nxt6000_set_guard_interval(state, p->guard_interval);
if (result < 0)
return result;
if ((result = nxt6000_set_transmission_mode(state, param->u.ofdm.transmission_mode)) < 0)

result = nxt6000_set_transmission_mode(state, p->transmission_mode);
if (result < 0)
return result;
if ((result = nxt6000_set_inversion(state, param->inversion)) < 0)

result = nxt6000_set_inversion(state, p->inversion);
if (result < 0)
return result;

msleep(500);
Expand Down Expand Up @@ -566,7 +573,7 @@ struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config,
}

static struct dvb_frontend_ops nxt6000_ops = {

.delsys = { SYS_DVBT },
.info = {
.name = "NxtWave NXT6000 DVB-T",
.type = FE_OFDM,
Expand All @@ -592,7 +599,7 @@ static struct dvb_frontend_ops nxt6000_ops = {

.get_tune_settings = nxt6000_fe_get_tune_settings,

.set_frontend_legacy = nxt6000_set_frontend,
.set_frontend = nxt6000_set_frontend,

.read_status = nxt6000_read_status,
.read_ber = nxt6000_read_ber,
Expand Down

0 comments on commit 04b4870

Please sign in to comment.