Commit fe8eece1 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] af9033: IT9135 v2 supported related changes

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bc3c9e10
...@@ -285,10 +285,29 @@ static int af9033_init(struct dvb_frontend *fe) ...@@ -285,10 +285,29 @@ static int af9033_init(struct dvb_frontend *fe)
goto err; goto err;
} }
/*
* FIXME: These inits are logically property of demodulator driver
* (that driver), but currently in case of IT9135 those are done by
* tuner driver.
*/
/* load OFSM settings */ /* load OFSM settings */
dev_dbg(&state->i2c->dev, "%s: load ofsm settings\n", __func__); dev_dbg(&state->i2c->dev, "%s: load ofsm settings\n", __func__);
len = ARRAY_SIZE(ofsm_init); switch (state->cfg.tuner) {
init = ofsm_init; case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51:
case AF9033_TUNER_IT9135_52:
case AF9033_TUNER_IT9135_60:
case AF9033_TUNER_IT9135_61:
case AF9033_TUNER_IT9135_62:
len = 0;
break;
default:
len = ARRAY_SIZE(ofsm_init);
init = ofsm_init;
break;
}
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
ret = af9033_wr_reg(state, init[i].reg, init[i].val); ret = af9033_wr_reg(state, init[i].reg, init[i].val);
if (ret < 0) if (ret < 0)
...@@ -424,7 +443,8 @@ static int af9033_sleep(struct dvb_frontend *fe) ...@@ -424,7 +443,8 @@ static int af9033_sleep(struct dvb_frontend *fe)
static int af9033_get_tune_settings(struct dvb_frontend *fe, static int af9033_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *fesettings) struct dvb_frontend_tune_settings *fesettings)
{ {
fesettings->min_delay_ms = 800; /* 800 => 2000 because IT9135 v2 is slow to gain lock */
fesettings->min_delay_ms = 2000;
fesettings->step_size = 0; fesettings->step_size = 0;
fesettings->max_drift = 0; fesettings->max_drift = 0;
...@@ -513,6 +533,11 @@ static int af9033_set_frontend(struct dvb_frontend *fe) ...@@ -513,6 +533,11 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
buf[0] = (freq_cw >> 0) & 0xff; buf[0] = (freq_cw >> 0) & 0xff;
buf[1] = (freq_cw >> 8) & 0xff; buf[1] = (freq_cw >> 8) & 0xff;
buf[2] = (freq_cw >> 16) & 0x7f; buf[2] = (freq_cw >> 16) & 0x7f;
/* FIXME: there seems to be calculation error here... */
if (if_frequency == 0)
buf[2] = 0;
ret = af9033_wr_regs(state, 0x800029, buf, 3); ret = af9033_wr_regs(state, 0x800029, buf, 3);
if (ret < 0) if (ret < 0)
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment