Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98487
b: refs/heads/master
c: 44e645c
h: refs/heads/master
i:
  98485: e2ca290
  98483: 492fc66
  98479: 2483681
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jun 26, 2008
1 parent f92efee commit 0f260fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e7830b50b20fcc25f21f79b7734102284d7c8f9
refs/heads/master: 44e645c20304bbe0a72cb994d9baf4b5727d7cec
30 changes: 19 additions & 11 deletions trunk/drivers/media/common/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ static inline int charge_pump_source(struct dvb_frontend *fe, int force)
TDA18271_MAIN_PLL, force);
}

static inline void tda18271_set_if_notch(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs;

switch (priv->mode) {
case TDA18271_ANALOG:
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
break;
case TDA18271_DIGITAL:
regs[R_MPD] |= 0x80; /* IF notch = 1 */
break;
}
}

static int tda18271_channel_configuration(struct dvb_frontend *fe,
struct tda18271_std_map_item *map,
u32 freq, u32 bw)
Expand All @@ -66,19 +81,10 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
/* set cal mode to normal */
regs[R_EP4] &= ~0x03;

/* update IF output level & IF notch frequency */
/* update IF output level */
regs[R_EP4] &= ~0x1c; /* clear if level bits */
regs[R_EP4] |= (map->if_lvl << 2);

switch (priv->mode) {
case TDA18271_ANALOG:
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
break;
case TDA18271_DIGITAL:
regs[R_MPD] |= 0x80; /* IF notch = 1 */
break;
}

/* update FM_RFn */
regs[R_EP4] &= ~0x80;
regs[R_EP4] |= map->fm_rfn << 7;
Expand Down Expand Up @@ -135,13 +141,15 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
switch (priv->role) {
case TDA18271_MASTER:
tda18271_calc_main_pll(fe, N);
tda18271_set_if_notch(fe);
tda18271_write_regs(fe, R_MPD, 4);
break;
case TDA18271_SLAVE:
tda18271_calc_cal_pll(fe, N);
tda18271_write_regs(fe, R_CPD, 4);

regs[R_MPD] = regs[R_CPD] & 0x7f;
tda18271_set_if_notch(fe);
tda18271_write_regs(fe, R_MPD, 1);
break;
}
Expand Down Expand Up @@ -507,7 +515,7 @@ static int tda18271_powerscan_init(struct dvb_frontend *fe)
/* set cal mode to normal */
regs[R_EP4] &= ~0x03;

/* update IF output level & IF notch frequency */
/* update IF output level */
regs[R_EP4] &= ~0x1c; /* clear if level bits */

ret = tda18271_write_regs(fe, R_EP3, 2);
Expand Down

0 comments on commit 0f260fe

Please sign in to comment.