V4L/DVB (7212): tda18271: move rf calibration code from tda18271c1_tune into a new function
move rf calibration code from tda18271c1_tune into a new function, tda18271c1_rf_tracking_filter_calibration Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
a60b866567
commit
4d2d42bcd8
1 changed files with 19 additions and 11 deletions
|
@ -652,21 +652,13 @@ static int tda18271c2_tune(struct dvb_frontend *fe,
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
static int tda18271c1_tune(struct dvb_frontend *fe,
|
static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
|
||||||
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
u32 freq, u32 bw)
|
||||||
{
|
{
|
||||||
struct tda18271_priv *priv = fe->tuner_priv;
|
struct tda18271_priv *priv = fe->tuner_priv;
|
||||||
unsigned char *regs = priv->tda18271_regs;
|
unsigned char *regs = priv->tda18271_regs;
|
||||||
u32 N = 0;
|
u32 N = 0;
|
||||||
|
|
||||||
tda18271_init(fe);
|
|
||||||
|
|
||||||
mutex_lock(&priv->lock);
|
|
||||||
|
|
||||||
tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
|
|
||||||
|
|
||||||
/* RF tracking filter calibration */
|
|
||||||
|
|
||||||
/* calculate bp filter */
|
/* calculate bp filter */
|
||||||
tda18271_calc_bp_filter(fe, &freq);
|
tda18271_calc_bp_filter(fe, &freq);
|
||||||
tda18271_write_regs(fe, R_EP1, 1);
|
tda18271_write_regs(fe, R_EP1, 1);
|
||||||
|
@ -737,7 +729,7 @@ static int tda18271c1_tune(struct dvb_frontend *fe,
|
||||||
|
|
||||||
regs[R_EB7] = 0x40;
|
regs[R_EB7] = 0x40;
|
||||||
tda18271_write_regs(fe, R_EB7, 1);
|
tda18271_write_regs(fe, R_EB7, 1);
|
||||||
msleep(10);
|
msleep(10); /* pll locking */
|
||||||
|
|
||||||
regs[R_EB20] = 0xec;
|
regs[R_EB20] = 0xec;
|
||||||
tda18271_write_regs(fe, R_EB20, 1);
|
tda18271_write_regs(fe, R_EB20, 1);
|
||||||
|
@ -752,6 +744,22 @@ static int tda18271c1_tune(struct dvb_frontend *fe,
|
||||||
if (0 == tda18271_calc_rf_cal(fe, &freq))
|
if (0 == tda18271_calc_rf_cal(fe, &freq))
|
||||||
tda18271_write_regs(fe, R_EB14, 1);
|
tda18271_write_regs(fe, R_EB14, 1);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tda18271c1_tune(struct dvb_frontend *fe,
|
||||||
|
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
||||||
|
{
|
||||||
|
struct tda18271_priv *priv = fe->tuner_priv;
|
||||||
|
|
||||||
|
tda18271_init(fe);
|
||||||
|
|
||||||
|
mutex_lock(&priv->lock);
|
||||||
|
|
||||||
|
tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
|
||||||
|
|
||||||
|
tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
|
||||||
|
|
||||||
tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
|
tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
|
||||||
|
|
||||||
mutex_unlock(&priv->lock);
|
mutex_unlock(&priv->lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue