summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-02-14 01:17:02 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2008-02-14 01:17:02 -0500
commitf66278931e5ad6cd06408f65716e6a9c151e1ed2 (patch)
tree365c42578b5ca774303704e1b8180fe009768b22 /linux/drivers/media/dvb/frontends
parent4862d337c0d4d0b060bc36e525635ca72d8142a4 (diff)
downloadmediapointer-dvb-s2-f66278931e5ad6cd06408f65716e6a9c151e1ed2.tar.gz
mediapointer-dvb-s2-f66278931e5ad6cd06408f65716e6a9c151e1ed2.tar.bz2
tda18271: consolidate tune functions
From: Michael Krufky <mkrufky@linuxtv.org> combine tda18271c1_tune and tda18271c2_tune into a single function Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271-fe.c60
1 files changed, 16 insertions, 44 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda18271-fe.c b/linux/drivers/media/dvb/frontends/tda18271-fe.c
index c5a44e77b..304dfb3cc 100644
--- a/linux/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/linux/drivers/media/dvb/frontends/tda18271-fe.c
@@ -215,8 +215,8 @@ static int tda18271_read_thermometer(struct dvb_frontend *fe)
return tm;
}
-static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe,
- u32 freq)
+static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe,
+ u32 freq)
{
struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
@@ -654,26 +654,6 @@ static int tda18271_init(struct dvb_frontend *fe)
return 0;
}
-static int tda18271c2_tune(struct dvb_frontend *fe,
- u32 ifc, u32 freq, u32 bw, u8 std, int radio)
-{
- struct tda18271_priv *priv = fe->tuner_priv;
-
- tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
-
- tda18271_init(fe);
-
- mutex_lock(&priv->lock);
-
- tda18271_rf_tracking_filters_correction(fe, freq);
-
- tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
-
- mutex_unlock(&priv->lock);
-
- return 0;
-}
-
/* ------------------------------------------------------------------ */
static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
@@ -771,41 +751,33 @@ static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
return 0;
}
-static int tda18271c1_tune(struct dvb_frontend *fe,
- u32 ifc, u32 freq, u32 bw, u8 std, int radio)
+/* ------------------------------------------------------------------ */
+
+static int tda18271_tune(struct dvb_frontend *fe,
+ u32 ifc, u32 freq, u32 bw, u8 std, int radio)
{
struct tda18271_priv *priv = fe->tuner_priv;
+ tda_dbg("freq = %d, ifc = %d, bw = %d, std = 0x%02x\n",
+ freq, ifc, bw, std);
+
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);
-
- mutex_unlock(&priv->lock);
-
- return 0;
-}
-
-static inline int tda18271_tune(struct dvb_frontend *fe,
- u32 ifc, u32 freq, u32 bw, u8 std, int radio)
-{
- struct tda18271_priv *priv = fe->tuner_priv;
- int ret = -EINVAL;
-
switch (priv->id) {
case TDA18271HDC1:
- ret = tda18271c1_tune(fe, ifc, freq, bw, std, radio);
+ tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
break;
case TDA18271HDC2:
- ret = tda18271c2_tune(fe, ifc, freq, bw, std, radio);
+ tda18271c2_rf_tracking_filters_correction(fe, freq);
break;
}
- return ret;
+ tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
+
+ mutex_unlock(&priv->lock);
+
+ return 0;
}
/* ------------------------------------------------------------------ */