Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232200
b: refs/heads/master
c: c736a5f
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jan 19, 2011
1 parent 7f345e4 commit 8e5fec7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 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: 7570800c9de39c718f84ec4ea820a788556cde4b
refs/heads/master: c736a5f28e81299b05ad14e892bdfb414daa9f5f
32 changes: 28 additions & 4 deletions trunk/drivers/media/dvb/frontends/mb86a20s.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ struct mb86a20s_state {
const struct mb86a20s_config *config;

struct dvb_frontend frontend;

bool need_init;
};

struct regdata {
Expand Down Expand Up @@ -382,23 +384,31 @@ static int mb86a20s_initfe(struct dvb_frontend *fe)
/* Initialize the frontend */
rc = mb86a20s_writeregdata(state, mb86a20s_init);
if (rc < 0)
return rc;
goto err;

if (!state->config->is_serial) {
regD5 &= ~1;

rc = mb86a20s_writereg(state, 0x50, 0xd5);
if (rc < 0)
return rc;
goto err;
rc = mb86a20s_writereg(state, 0x51, regD5);
if (rc < 0)
return rc;
goto err;
}

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

return 0;
err:
if (rc < 0) {
state->need_init = true;
printk(KERN_INFO "mb86a20s: Init failed. Will try again later\n");
} else {
state->need_init = false;
dprintk("Initialization succeded.\n");
}
return rc;
}

static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
Expand Down Expand Up @@ -485,8 +495,22 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe,

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
dprintk("Calling tuner set parameters\n");
fe->ops.tuner_ops.set_params(fe, p);

/*
* Make it more reliable: if, for some reason, the initial
* device initialization doesn't happen, initialize it when
* a SBTVD parameters are adjusted.
*
* Unfortunately, due to a hard to track bug at tda829x/tda18271,
* the agc callback logic is not called during DVB attach time,
* causing mb86a20s to not be initialized with Kworld SBTVD.
* So, this hack is needed, in order to make Kworld SBTVD to work.
*/
if (state->need_init)
mb86a20s_initfe(fe);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception);
Expand Down

0 comments on commit 8e5fec7

Please sign in to comment.