Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29879
b: refs/heads/master
c: 5becb3b
h: refs/heads/master
i:
  29877: 35396cd
  29875: 2598986
  29871: 1d966f7
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 5bba5b7 commit 308fe4f
Show file tree
Hide file tree
Showing 3 changed files with 18 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: 7eef5dd6daecf3ee305116c9cf41ae7166270c4c
refs/heads/master: 5becb3b045c21001eeeec37bae0738d8ede3a882
26 changes: 17 additions & 9 deletions trunk/drivers/media/dvb/frontends/cx22700.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@ static int cx22700_init (struct dvb_frontend* fe)

cx22700_writereg (state, 0x00, 0x01);

if (state->config->pll_init) {
cx22700_writereg (state, 0x0a, 0x00); /* open i2c bus switch */
state->config->pll_init(fe);
cx22700_writereg (state, 0x0a, 0x01); /* close i2c bus switch */
}

return 0;
}

Expand Down Expand Up @@ -333,9 +327,11 @@ static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/
cx22700_writereg (state, 0x00, 0x00);

cx22700_writereg (state, 0x0a, 0x00); /* open i2c bus switch */
state->config->pll_set(fe, p);
cx22700_writereg (state, 0x0a, 0x01); /* close i2c bus switch */
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);
}

cx22700_set_inversion (state, p->inversion);
cx22700_set_tps (state, &p->u.ofdm);
cx22700_writereg (state, 0x37, 0x01); /* PAL loop filter off */
Expand All @@ -353,6 +349,17 @@ static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
return cx22700_get_tps (state, &p->u.ofdm);
}

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

if (enable) {
return cx22700_writereg(state, 0x0a, 0x00);
} else {
return cx22700_writereg(state, 0x0a, 0x01);
}
}

static int cx22700_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
{
fesettings->min_delay_ms = 150;
Expand Down Expand Up @@ -413,6 +420,7 @@ static struct dvb_frontend_ops cx22700_ops = {
.release = cx22700_release,

.init = cx22700_init,
.i2c_gate_ctrl = cx22700_i2c_gate_ctrl,

.set_frontend = cx22700_set_frontend,
.get_frontend = cx22700_get_frontend,
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/media/dvb/frontends/cx22700.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ struct cx22700_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);
};

extern struct dvb_frontend* cx22700_attach(const struct cx22700_config* config,
Expand Down

0 comments on commit 308fe4f

Please sign in to comment.