Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29887
b: refs/heads/master
c: 085542d
h: refs/heads/master
i:
  29885: 89b16af
  29883: a420301
  29879: 308fe4f
  29871: 1d966f7
  29855: 824d79d
  29823: 99aa9cc
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 0944a93 commit 104ac0c
Show file tree
Hide file tree
Showing 3 changed files with 23 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: 53a8ee3e903659482e009481ab51d6a6572e6a57
refs/heads/master: 085542dc8611d969ef698120c98288e24d5f4f9d
34 changes: 22 additions & 12 deletions trunk/drivers/media/dvb/frontends/sp887x.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,6 @@ static int sp887x_initial_setup (struct dvb_frontend* fe, const struct firmware
/* bit 0x010: enable data valid signal */
sp887x_writereg(state, 0xd00, 0x010);
sp887x_writereg(state, 0x0d1, 0x000);

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

printk ("done.\n");
return 0;
};

Expand Down Expand Up @@ -362,9 +353,16 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
sp887x_microcontroller_stop(state);

/* setup the PLL */
sp887x_writereg(state, 0x206, 0x001);
actual_freq = state->config->pll_set(fe, p);
sp887x_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);
}
if (fe->ops->tuner_ops.get_frequency) {
fe->ops->tuner_ops.get_frequency(fe, &actual_freq);
if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
} else {
actual_freq = p->frequency;
}

/* read status reg in order to clear <pending irqs */
sp887x_readreg(state, 0x200);
Expand Down Expand Up @@ -486,6 +484,17 @@ static int sp887x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
return 0;
}

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

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

static int sp887x_sleep(struct dvb_frontend* fe)
{
struct sp887x_state* state = fe->demodulator_priv;
Expand Down Expand Up @@ -589,6 +598,7 @@ static struct dvb_frontend_ops sp887x_ops = {

.init = sp887x_init,
.sleep = sp887x_sleep,
.i2c_gate_ctrl = sp887x_i2c_gate_ctrl,

.set_frontend = sp887x_setup_frontend_parameters,
.get_tune_settings = sp887x_get_tune_settings,
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/media/dvb/frontends/sp887x.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ struct sp887x_config
/* the demodulator's i2c address */
u8 demod_address;

/* PLL maintenance */
int (*pll_init)(struct dvb_frontend* fe);

/* this should return the actual frequency tuned to */
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 104ac0c

Please sign in to comment.