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;
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;
}
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;
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;
}
}
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;
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;
}
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;
}
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;
}
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;