aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda18271-fe.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:42:07 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:43 -0400
commit4d2d42bcd8c73273f22d16ef4e619ce3f07f07d0 (patch)
tree9b32d68a60158c7c9a8e794d9583d8dd9bbad4f3 /drivers/media/dvb/frontends/tda18271-fe.c
parenta60b866567001e97b5bdc9811aee155ae759e48f (diff)
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>
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271-fe.c')
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index 26042a977e4e..250899a90aa2 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -652,21 +652,13 @@ static int tda18271c2_tune(struct dvb_frontend *fe,
652 652
653/* ------------------------------------------------------------------ */ 653/* ------------------------------------------------------------------ */
654 654
655static int tda18271c1_tune(struct dvb_frontend *fe, 655static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
656 u32 ifc, u32 freq, u32 bw, u8 std, int radio) 656 u32 freq, u32 bw)
657{ 657{
658 struct tda18271_priv *priv = fe->tuner_priv; 658 struct tda18271_priv *priv = fe->tuner_priv;
659 unsigned char *regs = priv->tda18271_regs; 659 unsigned char *regs = priv->tda18271_regs;
660 u32 N = 0; 660 u32 N = 0;
661 661
662 tda18271_init(fe);
663
664 mutex_lock(&priv->lock);
665
666 tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
667
668 /* RF tracking filter calibration */
669
670 /* calculate bp filter */ 662 /* calculate bp filter */
671 tda18271_calc_bp_filter(fe, &freq); 663 tda18271_calc_bp_filter(fe, &freq);
672 tda18271_write_regs(fe, R_EP1, 1); 664 tda18271_write_regs(fe, R_EP1, 1);
@@ -737,7 +729,7 @@ static int tda18271c1_tune(struct dvb_frontend *fe,
737 729
738 regs[R_EB7] = 0x40; 730 regs[R_EB7] = 0x40;
739 tda18271_write_regs(fe, R_EB7, 1); 731 tda18271_write_regs(fe, R_EB7, 1);
740 msleep(10); 732 msleep(10); /* pll locking */
741 733
742 regs[R_EB20] = 0xec; 734 regs[R_EB20] = 0xec;
743 tda18271_write_regs(fe, R_EB20, 1); 735 tda18271_write_regs(fe, R_EB20, 1);
@@ -752,6 +744,22 @@ static int tda18271c1_tune(struct dvb_frontend *fe,
752 if (0 == tda18271_calc_rf_cal(fe, &freq)) 744 if (0 == tda18271_calc_rf_cal(fe, &freq))
753 tda18271_write_regs(fe, R_EB14, 1); 745 tda18271_write_regs(fe, R_EB14, 1);
754 746
747 return 0;
748}
749
750static int tda18271c1_tune(struct dvb_frontend *fe,
751 u32 ifc, u32 freq, u32 bw, u8 std, int radio)
752{
753 struct tda18271_priv *priv = fe->tuner_priv;
754
755 tda18271_init(fe);
756
757 mutex_lock(&priv->lock);
758
759 tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
760
761 tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
762
755 tda18271_channel_configuration(fe, ifc, freq, bw, std, radio); 763 tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
756 764
757 mutex_unlock(&priv->lock); 765 mutex_unlock(&priv->lock);