Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295102
b: refs/heads/master
c: be4a5e7
h: refs/heads/master
v: v3
  • Loading branch information
Gordon Hecker authored and Mauro Carvalho Chehab committed Mar 19, 2012
1 parent fe1bdbc commit cc3bea0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3db22e10bd4997d244beee6feea5fa39b2e5b82
refs/heads/master: be4a5e7f0e279b751a23570da583ec41ca32a34f
31 changes: 31 additions & 0 deletions trunk/drivers/media/dvb/dvb-usb/af9015.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,18 @@ static int af9015_af9013_init(struct dvb_frontend *fe)
return -EAGAIN;

ret = priv->init[adap->id](fe);
if (ret)
goto err_unlock;

if (priv->tuner_ops_init[adap->id]) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
ret = priv->tuner_ops_init[adap->id](fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}

err_unlock:
mutex_unlock(&adap->dev->usb_mutex);

return ret;
Expand All @@ -1157,8 +1168,19 @@ static int af9015_af9013_sleep(struct dvb_frontend *fe)
if (mutex_lock_interruptible(&adap->dev->usb_mutex))
return -EAGAIN;

if (priv->tuner_ops_sleep[adap->id]) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
ret = priv->tuner_ops_sleep[adap->id](fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
if (ret)
goto err_unlock;
}

ret = priv->sleep[adap->id](fe);

err_unlock:
mutex_unlock(&adap->dev->usb_mutex);

return ret;
Expand Down Expand Up @@ -1283,6 +1305,7 @@ static struct mxl5007t_config af9015_mxl5007t_config = {
static int af9015_tuner_attach(struct dvb_usb_adapter *adap)
{
int ret;
struct af9015_state *state = adap->dev->priv;
deb_info("%s:\n", __func__);

switch (af9015_af9013_config[adap->id].tuner) {
Expand Down Expand Up @@ -1340,6 +1363,14 @@ static int af9015_tuner_attach(struct dvb_usb_adapter *adap)
err("Unknown tuner id:%d",
af9015_af9013_config[adap->id].tuner);
}

state->tuner_ops_sleep[adap->id] =
adap->fe_adap[0].fe->ops.tuner_ops.sleep;
adap->fe_adap[0].fe->ops.tuner_ops.sleep = 0;

state->tuner_ops_init[adap->id] =
adap->fe_adap[0].fe->ops.tuner_ops.init;
adap->fe_adap[0].fe->ops.tuner_ops.init = 0;
return ret;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/dvb/dvb-usb/af9015.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ struct af9015_state {
int (*read_status[2]) (struct dvb_frontend *fe, fe_status_t *status);
int (*init[2]) (struct dvb_frontend *fe);
int (*sleep[2]) (struct dvb_frontend *fe);
int (*tuner_ops_init[2]) (struct dvb_frontend *fe);
int (*tuner_ops_sleep[2]) (struct dvb_frontend *fe);
};

struct af9015_config {
Expand Down

0 comments on commit cc3bea0

Please sign in to comment.