summaryrefslogtreecommitdiff
path: root/drivers/media/common
diff options
context:
space:
mode:
authorIstvan Varga <istvan_v@mailbox.hu>2011-06-04 12:18:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 17:52:39 -0300
commite75873c1f80380f190d0270fec566410f59c4829 (patch)
treeb62df93301695dc0b5eaf49b7b2177c7822d7466 /drivers/media/common
parent818a1776a45c230c4f230c8e4e2d0c7bdf5f8fa3 (diff)
[media] xc4000: xc_tune_channel() cleanup
Minor coding changes related to the xc_tune_channel() function. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/xc4000.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index 52375498257..c3e564e9f8c 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -516,12 +516,10 @@ static u16 WaitForLock(struct xc4000_priv *priv)
return lockState;
}
-#define XC_TUNE_ANALOG 0
-#define XC_TUNE_DIGITAL 1
-static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz, int mode)
+static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz)
{
- int found = 0;
- int result = 0;
+ int found = 1;
+ int result;
dprintk(1, "%s(%u)\n", __func__, freq_hz);
@@ -533,9 +531,10 @@ static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz, int mode)
if (result != XC_RESULT_SUCCESS)
return 0;
- if (mode == XC_TUNE_ANALOG) {
- if (WaitForLock(priv) == 1)
- found = 1;
+ /* wait for lock only in analog TV mode */
+ if ((priv->cur_fw.type & (FM | DTV6 | DTV7 | DTV78 | DTV8)) == 0) {
+ if (WaitForLock(priv) != 1)
+ found = 0;
}
/* Wait for stats to stabilize.
@@ -1269,7 +1268,7 @@ static int xc4000_set_params(struct dvb_frontend *fe,
}
}
- xc_tune_channel(priv, priv->freq_hz, XC_TUNE_DIGITAL);
+ xc_tune_channel(priv, priv->freq_hz);
ret = 0;
@@ -1468,7 +1467,7 @@ tune_channel:
}
}
- xc_tune_channel(priv, priv->freq_hz, XC_TUNE_ANALOG);
+ xc_tune_channel(priv, priv->freq_hz);
ret = 0;