Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76708
b: refs/heads/master
c: 09f83c4
h: refs/heads/master
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent e09fa0e commit a411faf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 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: 98512f7b36ec412ea0461e9aab8f16c882df055d
refs/heads/master: 09f83c4fc06b02597ad4458c2a6675b0872f0b5c
37 changes: 22 additions & 15 deletions trunk/drivers/media/dvb/frontends/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MODULE_PARM_DESC(debug, "set debug level "

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

static int tda18271_init(struct dvb_frontend *fe)
static int tda18271_ir_cal_init(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs;
Expand Down Expand Up @@ -184,7 +184,7 @@ static int tda18271_read_thermometer(struct dvb_frontend *fe)
}

static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe,
u32 freq, int tm_rfcal)
u32 freq)
{
struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
Expand Down Expand Up @@ -224,7 +224,7 @@ static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe,
tda18271_lookup_map(fe, RF_CAL_DC_OVER_DT, &freq, &dc_over_dt);

/* calculate temperature compensation */
rfcal_comp = dc_over_dt * (tm_current - tm_rfcal);
rfcal_comp = dc_over_dt * (tm_current - priv->tm_rfcal);

regs[R_EB14] = approx + rfcal_comp;
tda18271_write_regs(fe, R_EB14, 1);
Expand Down Expand Up @@ -554,8 +554,7 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
return 0;
}

static int tda18271_calc_rf_filter_curve(struct dvb_frontend *fe,
int *tm_rfcal)
static int tda18271_calc_rf_filter_curve(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
unsigned int i;
Expand All @@ -572,24 +571,21 @@ static int tda18271_calc_rf_filter_curve(struct dvb_frontend *fe,
tda18271_rf_tracking_filters_init(fe, 1000 *
priv->rf_cal_state[i].rfmax);

*tm_rfcal = tda18271_read_thermometer(fe);
priv->tm_rfcal = tda18271_read_thermometer(fe);

return 0;
}

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

static int tda18271_init_cal(struct dvb_frontend *fe, int *tm)
static int tda18271_rf_cal_init(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;

if (priv->cal_initialized)
return 0;

/* initialization */
tda18271_init(fe);

tda18271_calc_rf_filter_curve(fe, tm);
tda18271_calc_rf_filter_curve(fe);

tda18271_por(fe);

Expand All @@ -598,16 +594,27 @@ static int tda18271_init_cal(struct dvb_frontend *fe, int *tm)
return 0;
}

static int tda18271_init(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;

/* initialization */
tda18271_ir_cal_init(fe);

if (priv->id == TDA18271HDC2)
tda18271_rf_cal_init(fe);

return 0;
}

static int tda18271c2_tune(struct dvb_frontend *fe,
u32 ifc, u32 freq, u32 bw, u8 std)
{
int tm = 0;

tda_dbg("freq = %d, ifc = %d\n", freq, ifc);

tda18271_init_cal(fe, &tm);
tda18271_init(fe);

tda18271_rf_tracking_filters_correction(fe, freq, tm);
tda18271_rf_tracking_filters_correction(fe, freq);

tda18271_channel_configuration(fe, ifc, freq, bw, std);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/frontends/tda18271-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ struct tda18271_priv {
enum tda18271_i2c_gate gate;
enum tda18271_ver id;

unsigned int tm_rfcal;
unsigned int cal_initialized:1;

struct tda18271_map_layout *maps;
Expand Down

0 comments on commit a411faf

Please sign in to comment.