Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357359
b: refs/heads/master
c: d36e418
h: refs/heads/master
i:
  357357: 45f150a
  357355: 213e05d
  357351: 4131a26
  357343: fad3d59
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jan 22, 2013
1 parent 92d2213 commit 3046b4b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 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: 04585921ac0fa0f4baaf510cc7e52e3399018fb4
refs/heads/master: d36e418a7b1eaeb006ee304533054e2720537db7
31 changes: 24 additions & 7 deletions trunk/drivers/media/dvb-frontends/mb86a20s.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,14 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status)
{
struct mb86a20s_state *state = fe->demodulator_priv;
u8 val;
int val;

dprintk("\n");
*status = 0;

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
val = mb86a20s_readreg(state, 0x0a) & 0xf;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (val < 0)
return val;

if (val >= 2)
*status |= FE_HAS_SIGNAL;
Expand Down Expand Up @@ -635,6 +633,25 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe)

}

static int mb86a20s_read_status_gate(struct dvb_frontend *fe,
fe_status_t *status)
{
int ret;

dprintk("\n");
*status = 0;

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

ret = mb86a20s_read_status(fe, status);

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

return ret;
}

static int mb86a20s_tune(struct dvb_frontend *fe,
bool re_tune,
unsigned int mode_flags,
Expand All @@ -649,7 +666,7 @@ static int mb86a20s_tune(struct dvb_frontend *fe,
rc = mb86a20s_set_frontend(fe);

if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
mb86a20s_read_status(fe, status);
mb86a20s_read_status_gate(fe, status);

return rc;
}
Expand Down Expand Up @@ -730,7 +747,7 @@ static struct dvb_frontend_ops mb86a20s_ops = {
.init = mb86a20s_initfe,
.set_frontend = mb86a20s_set_frontend,
.get_frontend = mb86a20s_get_frontend,
.read_status = mb86a20s_read_status,
.read_status = mb86a20s_read_status_gate,
.read_signal_strength = mb86a20s_read_signal_strength,
.tune = mb86a20s_tune,
};
Expand Down

0 comments on commit 3046b4b

Please sign in to comment.