Commit a78baacf authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11791): xc5000: do not sleep after digital tuning

Don't sleep for 400ms polling the tuner's lock if in digital mode (since the
xc5000 lock status registers appear to only be reliable in analog mode)
Signed-off-by: default avatarDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8e4c6797
...@@ -490,7 +490,9 @@ static u16 WaitForLock(struct xc5000_priv *priv) ...@@ -490,7 +490,9 @@ static u16 WaitForLock(struct xc5000_priv *priv)
return lockState; return lockState;
} }
static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz) #define XC_TUNE_ANALOG 0
#define XC_TUNE_DIGITAL 1
static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode)
{ {
int found = 0; int found = 0;
...@@ -499,8 +501,10 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz) ...@@ -499,8 +501,10 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz)
if (xc_set_RF_frequency(priv, freq_hz) != XC_RESULT_SUCCESS) if (xc_set_RF_frequency(priv, freq_hz) != XC_RESULT_SUCCESS)
return 0; return 0;
if (mode == XC_TUNE_ANALOG) {
if (WaitForLock(priv) == 1) if (WaitForLock(priv) == 1)
found = 1; found = 1;
}
return found; return found;
} }
...@@ -662,7 +666,7 @@ static int xc5000_set_params(struct dvb_frontend *fe, ...@@ -662,7 +666,7 @@ static int xc5000_set_params(struct dvb_frontend *fe,
return -EIO; return -EIO;
} }
xc_tune_channel(priv, priv->freq_hz); xc_tune_channel(priv, priv->freq_hz, XC_TUNE_DIGITAL);
if (debug) if (debug)
xc_debug_dump(priv); xc_debug_dump(priv);
...@@ -769,7 +773,7 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe, ...@@ -769,7 +773,7 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe,
return -EREMOTEIO; return -EREMOTEIO;
} }
xc_tune_channel(priv, priv->freq_hz); xc_tune_channel(priv, priv->freq_hz, XC_TUNE_ANALOG);
if (debug) if (debug)
xc_debug_dump(priv); xc_debug_dump(priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment