Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 241797
b: refs/heads/master
c: f790bdd
h: refs/heads/master
i:
  241795: ad28b29
v: v3
  • Loading branch information
Oliver Endriss authored and Mauro Carvalho Chehab committed Mar 21, 2011
1 parent 1cf8cdb commit 78b6ce2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 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: 5bd0dc2d8a0db2f2e119ea50d07bf49e5e038f12
refs/heads/master: f790bdd00da937845b38467abfebdea09acfea0e
21 changes: 16 additions & 5 deletions trunk/drivers/media/dvb/frontends/stv090x.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,12 @@ static int stv090x_i2c_gate_ctrl(struct stv090x_state *state, int enable)
* In case of any error, the lock is unlocked and exit within the
* relevant operations themselves.
*/
if (enable)
mutex_lock(&state->internal->tuner_lock);
if (enable) {
if (state->config->tuner_i2c_lock)
state->config->tuner_i2c_lock(&state->frontend, 1);
else
mutex_lock(&state->internal->tuner_lock);
}

reg = STV090x_READ_DEMOD(state, I2CRPT);
if (enable) {
Expand All @@ -784,13 +788,20 @@ static int stv090x_i2c_gate_ctrl(struct stv090x_state *state, int enable)
goto err;
}

if (!enable)
mutex_unlock(&state->internal->tuner_lock);
if (!enable) {
if (state->config->tuner_i2c_lock)
state->config->tuner_i2c_lock(&state->frontend, 0);
else
mutex_unlock(&state->internal->tuner_lock);
}

return 0;
err:
dprintk(FE_ERROR, 1, "I/O error");
mutex_unlock(&state->internal->tuner_lock);
if (state->config->tuner_i2c_lock)
state->config->tuner_i2c_lock(&state->frontend, 0);
else
mutex_unlock(&state->internal->tuner_lock);
return -1;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/frontends/stv090x.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct stv090x_config {
int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
void (*tuner_i2c_lock) (struct dvb_frontend *fe, int lock);
};

#if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && defined(MODULE))
Expand Down

0 comments on commit 78b6ce2

Please sign in to comment.