aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c60
1 files changed, 16 insertions, 44 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index 250899a90aa2..2f05c4cdb8b7 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -195,8 +195,8 @@ static int tda18271_read_thermometer(struct dvb_frontend *fe)
195 return tm; 195 return tm;
196} 196}
197 197
198static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe, 198static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe,
199 u32 freq) 199 u32 freq)
200{ 200{
201 struct tda18271_priv *priv = fe->tuner_priv; 201 struct tda18271_priv *priv = fe->tuner_priv;
202 struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state; 202 struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
@@ -630,26 +630,6 @@ static int tda18271_init(struct dvb_frontend *fe)
630 return 0; 630 return 0;
631} 631}
632 632
633static int tda18271c2_tune(struct dvb_frontend *fe,
634 u32 ifc, u32 freq, u32 bw, u8 std, int radio)
635{
636 struct tda18271_priv *priv = fe->tuner_priv;
637
638 tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
639
640 tda18271_init(fe);
641
642 mutex_lock(&priv->lock);
643
644 tda18271_rf_tracking_filters_correction(fe, freq);
645
646 tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
647
648 mutex_unlock(&priv->lock);
649
650 return 0;
651}
652
653/* ------------------------------------------------------------------ */ 633/* ------------------------------------------------------------------ */
654 634
655static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe, 635static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
@@ -747,41 +727,33 @@ static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
747 return 0; 727 return 0;
748} 728}
749 729
750static int tda18271c1_tune(struct dvb_frontend *fe, 730/* ------------------------------------------------------------------ */
751 u32 ifc, u32 freq, u32 bw, u8 std, int radio) 731
732static int tda18271_tune(struct dvb_frontend *fe,
733 u32 ifc, u32 freq, u32 bw, u8 std, int radio)
752{ 734{
753 struct tda18271_priv *priv = fe->tuner_priv; 735 struct tda18271_priv *priv = fe->tuner_priv;
754 736
737 tda_dbg("freq = %d, ifc = %d, bw = %d, std = 0x%02x\n",
738 freq, ifc, bw, std);
739
755 tda18271_init(fe); 740 tda18271_init(fe);
756 741
757 mutex_lock(&priv->lock); 742 mutex_lock(&priv->lock);
758 743
759 tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
760
761 tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
762
763 tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
764
765 mutex_unlock(&priv->lock);
766
767 return 0;
768}
769
770static inline int tda18271_tune(struct dvb_frontend *fe,
771 u32 ifc, u32 freq, u32 bw, u8 std, int radio)
772{
773 struct tda18271_priv *priv = fe->tuner_priv;
774 int ret = -EINVAL;
775
776 switch (priv->id) { 744 switch (priv->id) {
777 case TDA18271HDC1: 745 case TDA18271HDC1:
778 ret = tda18271c1_tune(fe, ifc, freq, bw, std, radio); 746 tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
779 break; 747 break;
780 case TDA18271HDC2: 748 case TDA18271HDC2:
781 ret = tda18271c2_tune(fe, ifc, freq, bw, std, radio); 749 tda18271c2_rf_tracking_filters_correction(fe, freq);
782 break; 750 break;
783 } 751 }
784 return ret; 752 tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
753
754 mutex_unlock(&priv->lock);
755
756 return 0;
785} 757}
786 758
787/* ------------------------------------------------------------------ */ 759/* ------------------------------------------------------------------ */