aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda18271-common.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:46:23 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:55 -0400
commit4efb0ca5d00f2c7a8bf9632556a4b4330cf409c5 (patch)
tree4ce1c38c66a64c590ef06403e6a38e2be7175772 /drivers/media/dvb/frontends/tda18271-common.c
parent40194b2b1bdd01358c1e9b5a9b8dd78390cc05f7 (diff)
V4L/DVB (7435): tda18271: add function tda18271_charge_pump_source
Force the main pll charge pump or cal pll charge pump to source current to the main pll loop filter or cal pll loop filter, respectively. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271-common.c')
-rw-r--r--drivers/media/dvb/frontends/tda18271-common.c21
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
220int 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
220int tda18271_init_regs(struct dvb_frontend *fe) 235int 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 */