Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92554
b: refs/heads/master
c: 4efb0ca
h: refs/heads/master
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent fc16276 commit 3997c96
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 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: 40194b2b1bdd01358c1e9b5a9b8dd78390cc05f7
refs/heads/master: 4efb0ca5d00f2c7a8bf9632556a4b4330cf409c5
21 changes: 17 additions & 4 deletions trunk/drivers/media/dvb/frontends/tda18271-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,21 @@ int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len)

/*---------------------------------------------------------------------*/

int tda18271_charge_pump_source(struct dvb_frontend *fe,
enum tda18271_pll pll, int force)
{
struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs;

int r_cp = (pll == TDA18271_CAL_PLL) ? R_EB7 : R_EB4;

regs[r_cp] &= ~0x20;
regs[r_cp] |= ((force & 1) << 5);
tda18271_write_regs(fe, r_cp, 1);

return 0;
}

int tda18271_init_regs(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
Expand Down Expand Up @@ -359,13 +374,11 @@ int tda18271_init_regs(struct dvb_frontend *fe)

if ((priv->id) == TDA18271HDC2) {
/* main pll cp source on */
regs[R_EB4] = 0x61;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 1);
msleep(1);

/* main pll cp source off */
regs[R_EB4] = 0x41;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 0);
}

msleep(5); /* pll locking */
Expand Down
18 changes: 6 additions & 12 deletions trunk/drivers/media/dvb/frontends/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,12 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
tda18271_write_regs(fe, R_TM, 7);

/* main pll charge pump source */
regs[R_EB4] |= 0x20;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 1);

msleep(1);

/* normal operation for the main pll */
regs[R_EB4] &= ~0x20;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 0);

msleep(20);

Expand Down Expand Up @@ -285,12 +283,10 @@ static int tda18271_calibrate_rf(struct dvb_frontend *fe, u32 freq)
tda18271_write_regs(fe, R_EB13, 1);

/* main pll charge pump source */
regs[R_EB4] |= 0x20;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 1);

/* cal pll charge pump source */
regs[R_EB7] |= 0x20;
tda18271_write_regs(fe, R_EB7, 1);
tda18271_charge_pump_source(fe, TDA18271_CAL_PLL, 1);

/* force dcdc converter to 0 V */
regs[R_EB14] = 0x00;
Expand Down Expand Up @@ -328,12 +324,10 @@ static int tda18271_calibrate_rf(struct dvb_frontend *fe, u32 freq)
/* --------------------------------------------------------------- */

/* normal operation for the main pll */
regs[R_EB4] &= ~0x20;
tda18271_write_regs(fe, R_EB4, 1);
tda18271_charge_pump_source(fe, TDA18271_MAIN_PLL, 0);

/* normal operation for the cal pll */
regs[R_EB7] &= ~0x20;
tda18271_write_regs(fe, R_EB7, 1);
tda18271_charge_pump_source(fe, TDA18271_CAL_PLL, 0);

msleep(10); /* plls locking */

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/media/dvb/frontends/tda18271-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ struct tda18271_rf_tracking_filter_cal {
int rf_b2;
};

enum tda18271_pll {
TDA18271_MAIN_PLL,
TDA18271_CAL_PLL,
};

enum tda18271_mode {
TDA18271_ANALOG,
TDA18271_DIGITAL,
Expand Down Expand Up @@ -188,6 +193,8 @@ extern int tda18271_read_extended(struct dvb_frontend *fe);
extern int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len);
extern int tda18271_init_regs(struct dvb_frontend *fe);

extern int tda18271_charge_pump_source(struct dvb_frontend *fe,
enum tda18271_pll pll, int force);
extern int tda18271_set_standby_mode(struct dvb_frontend *fe,
int sm, int sm_lt, int sm_xt);

Expand Down

0 comments on commit 3997c96

Please sign in to comment.