Skip to content

Commit

Permalink
[media] nxt6000: convert set_fontend to use DVBv5 parameters
Browse files Browse the repository at this point in the history
Instead of using dvb_frontend_parameters struct, that were
designed for a subset of the supported standards, use the DVBv5
cache information.

Also, fill the supported delivery systems at dvb_frontend_ops
struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent cf45787 commit 80b5b74
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions 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 80b5b74

Please sign in to comment.