Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29881
b: refs/heads/master
c: a81870e
h: refs/heads/master
i:
  29879: 308fe4f
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 8a8a115 commit cabf211
Show file tree
Hide file tree
Showing 3 changed files with 17 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: 0244422220f149d2e930deab89515fd5ca9a6bdd
refs/heads/master: a81870e00bf502db2c579dcb9721adab3775ba58
25 changes: 16 additions & 9 deletions trunk/drivers/media/dvb/frontends/mt312.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ static int mt312_initfe(struct dvb_frontend* fe)
if ((ret = mt312_writereg(state, CS_SW_LIM, 0x69)) < 0)
return ret;

if (state->config->pll_init) {
mt312_writereg(state, GPP_CTRL, 0x40);
state->config->pll_init(fe);
mt312_writereg(state, GPP_CTRL, 0x00);
}

return 0;
}

Expand Down Expand Up @@ -529,9 +523,10 @@ static int mt312_set_frontend(struct dvb_frontend* fe,
return -EINVAL;
}

mt312_writereg(state, GPP_CTRL, 0x40);
state->config->pll_set(fe, p);
mt312_writereg(state, GPP_CTRL, 0x00);
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);
}

/* sr = (u16)(sr * 256.0 / 1000000.0) */
sr = mt312_div(p->u.qpsk.symbol_rate * 4, 15625);
Expand Down Expand Up @@ -578,6 +573,17 @@ static int mt312_get_frontend(struct dvb_frontend* fe,
return 0;
}

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

if (enable) {
return mt312_writereg(state, GPP_CTRL, 0x40);
} else {
return mt312_writereg(state, GPP_CTRL, 0x00);
}
}

static int mt312_sleep(struct dvb_frontend* fe)
{
struct mt312_state *state = fe->demodulator_priv;
Expand Down Expand Up @@ -633,6 +639,7 @@ static struct dvb_frontend_ops vp310_mt312_ops = {

.init = mt312_initfe,
.sleep = mt312_sleep,
.i2c_gate_ctrl = mt312_i2c_gate_ctrl,

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

struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
Expand Down

0 comments on commit cabf211

Please sign in to comment.