diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:42:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:43 -0400 |
commit | d1c53424f3ba9cc46bf3dbc550a916dc1b8355ee (patch) | |
tree | 6a165d0abff2596484933e3fa4703354f0a397be /drivers/media/dvb/frontends/tda18271-fe.c | |
parent | 4d2d42bcd8c73273f22d16ef4e619ce3f07f07d0 (diff) |
V4L/DVB (7213): tda18271: consolidate tune functions
combine tda18271c1_tune and tda18271c2_tune into a single function
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.c | 60 |
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 250899a90aa..2f05c4cdb8b 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 | ||
198 | static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe, | 198 | static 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 | ||
633 | static 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 | ||
655 | static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe, | 635 | static 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 | ||
750 | static int tda18271c1_tune(struct dvb_frontend *fe, | 730 | /* ------------------------------------------------------------------ */ |
751 | u32 ifc, u32 freq, u32 bw, u8 std, int radio) | 731 | |
732 | static 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 | |||
770 | static 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 | /* ------------------------------------------------------------------ */ |