Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113939
b: refs/heads/master
c: 6e62343
h: refs/heads/master
i:
  113937: 9ba7d95
  113935: bfcadd9
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 78061c6 commit de8a766
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 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: ef80bfeb30f82fb718731a3323a75ae08396a4ea
refs/heads/master: 6e623433f7f566d8aca64c519a19c2f7bbb686be
38 changes: 36 additions & 2 deletions trunk/drivers/media/common/tuners/mt2060.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
b[0] = REG_LO1B1;
b[1] = 0xFF;

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */

mt2060_writeregs(priv,b,2);

freq = params->frequency / 1000; // Hz -> kHz
Expand Down Expand Up @@ -233,6 +236,9 @@ static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
i++;
} while (i<10);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */

return ret;
}

Expand Down Expand Up @@ -296,13 +302,35 @@ static int mt2060_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
static int mt2060_init(struct dvb_frontend *fe)
{
struct mt2060_priv *priv = fe->tuner_priv;
return mt2060_writereg(priv, REG_VGAG, (priv->cfg->clock_out << 6) | 0x33);
int ret;

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */

ret = mt2060_writereg(priv, REG_VGAG,
(priv->cfg->clock_out << 6) | 0x33);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */

return ret;
}

static int mt2060_sleep(struct dvb_frontend *fe)
{
struct mt2060_priv *priv = fe->tuner_priv;
return mt2060_writereg(priv, REG_VGAG, (priv->cfg->clock_out << 6) | 0x30);
int ret;

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */

ret = mt2060_writereg(priv, REG_VGAG,
(priv->cfg->clock_out << 6) | 0x30);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */

return ret;
}

static int mt2060_release(struct dvb_frontend *fe)
Expand Down Expand Up @@ -344,6 +372,9 @@ struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter
priv->i2c = i2c;
priv->if1_freq = if1;

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */

if (mt2060_readreg(priv,REG_PART_REV,&id) != 0) {
kfree(priv);
return NULL;
Expand All @@ -360,6 +391,9 @@ struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter

mt2060_calibrate(priv);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */

return fe;
}
EXPORT_SYMBOL(mt2060_attach);
Expand Down

0 comments on commit de8a766

Please sign in to comment.