Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106773
b: refs/heads/master
c: c39c1fd
h: refs/heads/master
i:
  106771: 0c7a3b9
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jul 27, 2008
1 parent b0b5b9f commit c3454d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 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: 59d27521c0f50fadf3382e2b325a7e8a04d9a770
refs/heads/master: c39c1fd29373d204b11b71946d0f4c97e4974dd9
45 changes: 24 additions & 21 deletions trunk/drivers/media/common/tuners/mxl5007t.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,11 @@ static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status)
s32 rf_input_level;
int ret;

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_synth_lock_status(state, &rf_locked, &ref_locked);
if (mxl_fail(ret))
goto fail;
Expand All @@ -676,10 +676,11 @@ static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status)
goto fail;
mxl_debug("rf input power: %d", rf_input_level);
fail:
mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);
return ret;
}

Expand Down Expand Up @@ -730,11 +731,11 @@ static int mxl5007t_set_params(struct dvb_frontend *fe,
return -EINVAL;
}

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_tuner_init(state, mode);
if (mxl_fail(ret))
goto fail;
Expand All @@ -747,10 +748,11 @@ static int mxl5007t_set_params(struct dvb_frontend *fe,
state->bandwidth = (fe->ops.info.type == FE_OFDM) ?
params->u.ofdm.bandwidth : 0;
fail:
mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);
return ret;
}

Expand Down Expand Up @@ -802,11 +804,11 @@ static int mxl5007t_set_analog_params(struct dvb_frontend *fe,
}
mxl_debug("setting mxl5007 to system %s", mode_name);

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_tuner_init(state, cable ? cbl_mode : ota_mode);
if (mxl_fail(ret))
goto fail;
Expand All @@ -818,10 +820,11 @@ static int mxl5007t_set_analog_params(struct dvb_frontend *fe,
state->frequency = freq;
state->bandwidth = 0;
fail:
mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);
return ret;
}

Expand All @@ -833,23 +836,23 @@ static int mxl5007t_init(struct dvb_frontend *fe)
int ret;
u8 d;

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_read_reg(state, 0x05, &d);
if (mxl_fail(ret))
goto fail;

ret = mxl5007t_write_reg(state, 0x05, d | 0x01);
mxl_fail(ret);
fail:
mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);

return ret;
}

Expand All @@ -859,23 +862,23 @@ static int mxl5007t_sleep(struct dvb_frontend *fe)
int ret;
u8 d;

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_read_reg(state, 0x05, &d);
if (mxl_fail(ret))
goto fail;

ret = mxl5007t_write_reg(state, 0x05, d & ~0x01);
mxl_fail(ret);
fail:
mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);

return ret;
}

Expand Down Expand Up @@ -995,18 +998,18 @@ struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,

mutex_init(&state->lock);

mutex_lock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

mutex_lock(&state->lock);

ret = mxl5007t_get_chip_id(state);

mutex_unlock(&state->lock);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);

mutex_unlock(&state->lock);

/* check return value of mxl5007t_get_chip_id */
if (mxl_fail(ret))
goto fail;
Expand Down

0 comments on commit c3454d3

Please sign in to comment.