Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285536
b: refs/heads/master
c: dcc9a12
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 76e4047 commit c4a52a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 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: 6bfc366766e5f81c7f39f36bddd000f336461200
refs/heads/master: dcc9a1299721835ece4e826c445cf8463c110832
28 changes: 15 additions & 13 deletions trunk/drivers/media/dvb/frontends/sp8870.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ static int sp8870_read_data_valid_signal(struct sp8870_state* state)
return (sp8870_readreg(state, 0x0D02) > 0);
}

static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
{
int known_parameters = 1;

*reg0xc05 = 0x000;

switch (p->u.ofdm.constellation) {
switch (p->modulation) {
case QPSK:
break;
case QAM_16:
Expand All @@ -190,7 +190,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
return -EINVAL;
};

switch (p->u.ofdm.hierarchy_information) {
switch (p->hierarchy) {
case HIERARCHY_NONE:
break;
case HIERARCHY_1:
Expand All @@ -209,7 +209,7 @@ static int configure_reg0xc05 (struct dvb_frontend_parameters *p, u16 *reg0xc05)
return -EINVAL;
};

switch (p->u.ofdm.code_rate_HP) {
switch (p->code_rate_HP) {
case FEC_1_2:
break;
case FEC_2_3:
Expand Down Expand Up @@ -245,9 +245,9 @@ static int sp8870_wake_up(struct sp8870_state* state)
return sp8870_writereg(state, 0xC18, 0x00D);
}

static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
struct dvb_frontend_parameters *p)
static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct sp8870_state* state = fe->demodulator_priv;
int err;
u16 reg0xc05;
Expand Down Expand Up @@ -277,15 +277,15 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
sp8870_writereg(state, 0x030A, 0x0000);

// filter for 6/7/8 Mhz channel
if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
if (p->bandwidth_hz == 6000000)
sp8870_writereg(state, 0x0311, 0x0002);
else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
else if (p->bandwidth_hz == 7000000)
sp8870_writereg(state, 0x0311, 0x0001);
else
sp8870_writereg(state, 0x0311, 0x0000);

// scan order: 2k first = 0x0000, 8k first = 0x0001
if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)
if (p->transmission_mode == TRANSMISSION_MODE_2K)
sp8870_writereg(state, 0x0338, 0x0000);
else
sp8870_writereg(state, 0x0338, 0x0001);
Expand Down Expand Up @@ -459,8 +459,9 @@ static int lockups;
/* only for debugging: counter for channel switches */
static int switches;

static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
static int sp8870_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct sp8870_state* state = fe->demodulator_priv;

/*
Expand All @@ -479,7 +480,8 @@ static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_par

for (trials = 1; trials <= MAXTRIALS; trials++) {

if ((err = sp8870_set_frontend_parameters(fe, p)))
err = sp8870_set_frontend_parameters(fe);
if (err)
return err;

for (check_count = 0; check_count < MAXCHECKS; check_count++) {
Expand Down Expand Up @@ -579,7 +581,7 @@ struct dvb_frontend* sp8870_attach(const struct sp8870_config* config,
}

static struct dvb_frontend_ops sp8870_ops = {

.delsys = { SYS_DVBT },
.info = {
.name = "Spase SP8870 DVB-T",
.type = FE_OFDM,
Expand All @@ -600,7 +602,7 @@ static struct dvb_frontend_ops sp8870_ops = {
.sleep = sp8870_sleep,
.i2c_gate_ctrl = sp8870_i2c_gate_ctrl,

.set_frontend_legacy = sp8870_set_frontend,
.set_frontend = sp8870_set_frontend,
.get_tune_settings = sp8870_get_tune_settings,

.read_status = sp8870_read_status,
Expand Down

0 comments on commit c4a52a8

Please sign in to comment.