Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285153
b: refs/heads/master
c: be94351
h: refs/heads/master
i:
  285151: ca73dc9
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Nov 7, 2011
1 parent 6bcde7d commit 4eaf17c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 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: 608add85decc7a13194072fbb0c6aadc89d394e5
refs/heads/master: be94351e592cb71fb61aa8eeed7bf3f877dc6fff
46 changes: 26 additions & 20 deletions trunk/drivers/media/dvb/dvb-usb/anysee.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,16 @@ static struct cxd2820r_config anysee_cxd2820r_config = {
* IOE[5] STV0903 1=enabled
*/


/* external I2C gate used for DNOD44CDH086A(TDA18212) tuner module */
static int anysee_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;

/* enable / disable tuner access on IOE[4] */
return anysee_wr_reg_mask(adap->dev, REG_IOE, (enable << 4), 0x10);
}

static int anysee_frontend_ctrl(struct dvb_frontend *fe, int onoff)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
Expand Down Expand Up @@ -779,6 +789,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
}
}

/* I2C gate for DNOD44CDH086A(TDA18212) tuner module */
if (tmp == 0xc7) {
if (adap->fe_adap[state->fe_id].fe)
adap->fe_adap[state->fe_id].fe->ops.i2c_gate_ctrl =
anysee_i2c_gate_ctrl;
}

break;
case ANYSEE_HW_508TC: /* 18 */
case ANYSEE_HW_508PTC: /* 21 */
Expand Down Expand Up @@ -826,6 +843,11 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
&adap->dev->i2c_adap);
}

/* I2C gate for DNOD44CDH086A(TDA18212) tuner module */
if (adap->fe_adap[state->fe_id].fe)
adap->fe_adap[state->fe_id].fe->ops.i2c_gate_ctrl =
anysee_i2c_gate_ctrl;

break;
case ANYSEE_HW_508S2: /* 19 */
case ANYSEE_HW_508PS2: /* 22 */
Expand Down Expand Up @@ -865,14 +887,14 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)

if (state->fe_id == 0) {
/* DVB-T/T2 */
adap->fe[0] = dvb_attach(cxd2820r_attach,
adap->fe_adap[state->fe_id].fe = dvb_attach(cxd2820r_attach,
&anysee_cxd2820r_config,
&adap->dev->i2c_adap, NULL);
} else {
/* DVB-C */
adap->fe[1] = dvb_attach(cxd2820r_attach,
adap->fe_adap[state->fe_id].fe = dvb_attach(cxd2820r_attach,
&anysee_cxd2820r_config,
&adap->dev->i2c_adap, adap->fe[0]);
&adap->dev->i2c_adap, adap->fe_adap[0].fe);
}

break;
Expand Down Expand Up @@ -935,22 +957,12 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* Try first attach TDA18212 silicon tuner on IOE[4], if that
* fails attach old simple PLL. */

/* enable tuner on IOE[4] */
ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10);
if (ret)
goto error;

/* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
&adap->dev->i2c_adap, &anysee_tda18212_config);
if (fe)
break;

/* disable tuner on IOE[4] */
ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 4), 0x10);
if (ret)
goto error;

/* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe_adap[state->fe_id].fe,
(0xc0 >> 1), &adap->dev->i2c_adap,
Expand All @@ -962,11 +974,6 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E7 TC */
/* E7 PTC */

/* enable tuner on IOE[4] */
ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10);
if (ret)
goto error;

/* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
&adap->dev->i2c_adap, &anysee_tda18212_config);
Expand All @@ -993,7 +1000,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E7 T2C */

/* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe[state->fe_id],
fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
&adap->dev->i2c_adap, &anysee_tda18212_config2);

break;
Expand All @@ -1006,7 +1013,6 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
else
ret = -ENODEV;

error:
return ret;
}

Expand Down

0 comments on commit 4eaf17c

Please sign in to comment.