diff options
Diffstat (limited to 'drivers/media/dvb-frontends/af9033.c')
-rw-r--r-- | drivers/media/dvb-frontends/af9033.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index dece775836ac..f51022817fed 100644 --- a/drivers/media/dvb-frontends/af9033.c +++ b/drivers/media/dvb-frontends/af9033.c | |||
@@ -285,10 +285,29 @@ static int af9033_init(struct dvb_frontend *fe) | |||
285 | goto err; | 285 | goto err; |
286 | } | 286 | } |
287 | 287 | ||
288 | /* | ||
289 | * FIXME: These inits are logically property of demodulator driver | ||
290 | * (that driver), but currently in case of IT9135 those are done by | ||
291 | * tuner driver. | ||
292 | */ | ||
293 | |||
288 | /* load OFSM settings */ | 294 | /* load OFSM settings */ |
289 | dev_dbg(&state->i2c->dev, "%s: load ofsm settings\n", __func__); | 295 | dev_dbg(&state->i2c->dev, "%s: load ofsm settings\n", __func__); |
290 | len = ARRAY_SIZE(ofsm_init); | 296 | switch (state->cfg.tuner) { |
291 | init = ofsm_init; | 297 | case AF9033_TUNER_IT9135_38: |
298 | case AF9033_TUNER_IT9135_51: | ||
299 | case AF9033_TUNER_IT9135_52: | ||
300 | case AF9033_TUNER_IT9135_60: | ||
301 | case AF9033_TUNER_IT9135_61: | ||
302 | case AF9033_TUNER_IT9135_62: | ||
303 | len = 0; | ||
304 | break; | ||
305 | default: | ||
306 | len = ARRAY_SIZE(ofsm_init); | ||
307 | init = ofsm_init; | ||
308 | break; | ||
309 | } | ||
310 | |||
292 | for (i = 0; i < len; i++) { | 311 | for (i = 0; i < len; i++) { |
293 | ret = af9033_wr_reg(state, init[i].reg, init[i].val); | 312 | ret = af9033_wr_reg(state, init[i].reg, init[i].val); |
294 | if (ret < 0) | 313 | if (ret < 0) |
@@ -424,7 +443,8 @@ err: | |||
424 | static int af9033_get_tune_settings(struct dvb_frontend *fe, | 443 | static int af9033_get_tune_settings(struct dvb_frontend *fe, |
425 | struct dvb_frontend_tune_settings *fesettings) | 444 | struct dvb_frontend_tune_settings *fesettings) |
426 | { | 445 | { |
427 | fesettings->min_delay_ms = 800; | 446 | /* 800 => 2000 because IT9135 v2 is slow to gain lock */ |
447 | fesettings->min_delay_ms = 2000; | ||
428 | fesettings->step_size = 0; | 448 | fesettings->step_size = 0; |
429 | fesettings->max_drift = 0; | 449 | fesettings->max_drift = 0; |
430 | 450 | ||
@@ -513,6 +533,11 @@ static int af9033_set_frontend(struct dvb_frontend *fe) | |||
513 | buf[0] = (freq_cw >> 0) & 0xff; | 533 | buf[0] = (freq_cw >> 0) & 0xff; |
514 | buf[1] = (freq_cw >> 8) & 0xff; | 534 | buf[1] = (freq_cw >> 8) & 0xff; |
515 | buf[2] = (freq_cw >> 16) & 0x7f; | 535 | buf[2] = (freq_cw >> 16) & 0x7f; |
536 | |||
537 | /* FIXME: there seems to be calculation error here... */ | ||
538 | if (if_frequency == 0) | ||
539 | buf[2] = 0; | ||
540 | |||
516 | ret = af9033_wr_regs(state, 0x800029, buf, 3); | 541 | ret = af9033_wr_regs(state, 0x800029, buf, 3); |
517 | if (ret < 0) | 542 | if (ret < 0) |
518 | goto err; | 543 | goto err; |