Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29888
b: refs/heads/master
c: e9f9c0d
h: refs/heads/master
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 104ac0c commit 31884dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 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: 085542dc8611d969ef698120c98288e24d5f4f9d
refs/heads/master: e9f9c0d87b1d532b82618bc154246e2dba20934b
26 changes: 16 additions & 10 deletions trunk/drivers/media/dvb/frontends/sp8870.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
sp8870_microcontroller_stop(state);

// set tuner parameters
sp8870_writereg(state, 0x206, 0x001);
state->config->pll_set(fe, p);
sp8870_writereg(state, 0x206, 0x000);
if (fe->ops->tuner_ops.set_params) {
fe->ops->tuner_ops.set_params(fe, p);
if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
}

// sample rate correction bit [23..17]
sp8870_writereg(state, 0x0319, 0x000A);
Expand Down Expand Up @@ -349,13 +350,6 @@ static int sp8870_init (struct dvb_frontend* fe)
sp8870_writereg(state, 0x0D00, 0x010);
sp8870_writereg(state, 0x0D01, 0x000);

/* setup PLL */
if (state->config->pll_init) {
sp8870_writereg(state, 0x206, 0x001);
state->config->pll_init(fe);
sp8870_writereg(state, 0x206, 0x000);
}

return 0;
}

Expand Down Expand Up @@ -541,6 +535,17 @@ static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend
return 0;
}

static int sp8870_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
struct sp8870_state* state = fe->demodulator_priv;

if (enable) {
return sp8870_writereg(state, 0x206, 0x001);
} else {
return sp8870_writereg(state, 0x206, 0x000);
}
}

static void sp8870_release(struct dvb_frontend* fe)
{
struct sp8870_state* state = fe->demodulator_priv;
Expand Down Expand Up @@ -597,6 +602,7 @@ static struct dvb_frontend_ops sp8870_ops = {

.init = sp8870_init,
.sleep = sp8870_sleep,
.i2c_gate_ctrl = sp8870_i2c_gate_ctrl,

.set_frontend = sp8870_set_frontend,
.get_tune_settings = sp8870_get_tune_settings,
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/media/dvb/frontends/sp8870.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ struct sp8870_config
/* the demodulator's i2c address */
u8 demod_address;

/* PLL maintenance */
int (*pll_init)(struct dvb_frontend* fe);
int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);

/* request firmware for device */
int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
};
Expand Down

0 comments on commit 31884dc

Please sign in to comment.