diff options
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271-common.c')
-rw-r--r-- | drivers/media/dvb/frontends/tda18271-common.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-common.c b/drivers/media/dvb/frontends/tda18271-common.c index 84d430c52854..e27a7620a32f 100644 --- a/drivers/media/dvb/frontends/tda18271-common.c +++ b/drivers/media/dvb/frontends/tda18271-common.c | |||
@@ -217,6 +217,21 @@ int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len) | |||
217 | 217 | ||
218 | /*---------------------------------------------------------------------*/ | 218 | /*---------------------------------------------------------------------*/ |
219 | 219 | ||
220 | int tda18271_charge_pump_source(struct dvb_frontend *fe, | ||
221 | enum tda18271_pll pll, int force) | ||
222 | { | ||
223 | struct tda18271_priv *priv = fe->tuner_priv; | ||
224 | unsigned char *regs = priv->tda18271_regs; | ||
225 | |||
226 | int r_cp = (pll == TDA18271_CAL_PLL) ? R_EB7 : R_EB4; | ||
227 | |||
228 | regs[r_cp] &= ~0x20; | ||
229 | regs[r_cp] |= ((force & 1) << 5); | ||
230 | tda18271_write_regs(fe, r_cp, 1); | ||
231 | |||
232 | return 0; | ||
233 | } | ||
234 | |||
220 | int tda18271_init_regs(struct dvb_frontend *fe) | 235 | int tda18271_init_regs(struct dvb_frontend *fe) |
221 | { | 236 | { |
222 | struct tda18271_priv *priv = fe->tuner_priv; | 237 | struct tda18271_priv *priv = fe->tuner_priv; |
@@ -359,13 +374,11 @@ int tda18271_init_regs(struct dvb_frontend *fe) | |||
359 | 374 | ||
360 | if ((priv->id) == TDA18271HDC2) { | 375 | if ((priv->id) == TDA18271HDC2) { |
361 | /* main pll cp source on */ | 376 | /* main pll cp source on */ |
362 | regs[R_EB4] = 0x61; | 377 | tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 1); |
363 | tda18271_write_regs(fe, R_EB4, 1); | ||
364 | msleep(1); | 378 | msleep(1); |
365 | 379 | ||
366 | /* main pll cp source off */ | 380 | /* main pll cp source off */ |
367 | regs[R_EB4] = 0x41; | 381 | tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 0); |
368 | tda18271_write_regs(fe, R_EB4, 1); | ||
369 | } | 382 | } |
370 | 383 | ||
371 | msleep(5); /* pll locking */ | 384 | msleep(5); /* pll locking */ |