Skip to content

Commit

Permalink
[media] it913x: init tuner on attach
Browse files Browse the repository at this point in the history
That register is needed to program very first in order to operate
correctly.

[crope@iki.fi: returned sequence back, removed sleep, moved reg
write earlier to prevent populating tuner ops in case of failure]

Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
  • Loading branch information
Bimow Chen authored and Mauro Carvalho Chehab committed Sep 4, 2014
1 parent 0df6580 commit 01b461b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/media/tuners/tuner_it913x.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config)
{
struct it913x_state *state = NULL;
int ret;

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL);
Expand Down Expand Up @@ -425,6 +426,11 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe,
state->tuner_type = config;
state->firmware_ver = 1;

/* tuner RF initial */
ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68);
if (ret < 0)
goto error;

fe->tuner_priv = state;
memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops,
sizeof(struct dvb_tuner_ops));
Expand Down

0 comments on commit 01b461b

Please sign in to comment.