Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181511
b: refs/heads/master
c: 96506a5
h: refs/heads/master
i:
  181509: d9a0567
  181507: aec0064
  181503: 0b9295f
v: v3
  • Loading branch information
Andreas Regel authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent ae6ddc8 commit 3154b64
Show file tree
Hide file tree
Showing 3 changed files with 11 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: 97f7a2ae1a8a1e44a481456375efced75210e5eb
refs/heads/master: 96506a5086d0e9fd7332d6da74f115fa37bb58c6
9 changes: 9 additions & 0 deletions trunk/drivers/media/dvb/frontends/stv090x.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
struct stv090x_state *state = fe->demodulator_priv;
u32 reg;

if (enable)
mutex_lock(&state->internal->tuner_lock);

reg = STV090x_READ_DEMOD(state, I2CRPT);
if (enable) {
dprintk(FE_DEBUG, 1, "Enable Gate");
Expand All @@ -771,9 +774,14 @@ static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0)
goto err;
}

if (!enable)
mutex_unlock(&state->internal->tuner_lock);

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

Expand Down Expand Up @@ -4439,6 +4447,7 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
}

mutex_init(&state->internal->demod_lock);
mutex_init(&state->internal->tuner_lock);

if (stv090x_sleep(&state->frontend) < 0) {
dprintk(FE_ERROR, 1, "Error putting device to sleep");
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/frontends/stv090x_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ struct stv090x_internal {
u8 i2c_addr;

struct mutex demod_lock; /* Lock access to shared register */
struct mutex tuner_lock; /* Lock access to tuners */
s32 mclk; /* Masterclock Divider factor */
u32 dev_ver;

Expand Down

0 comments on commit 3154b64

Please sign in to comment.