summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-01-16 14:34:05 +0000
committerJohannes Stezenbach <devnull@localhost>2004-01-16 14:34:05 +0000
commit9369eba75d0d500eb3837d4c9b452b7d66f23dad (patch)
tree7c8792557a5bb5d7412aaee951893a998597d227
parent3cdf06b0f1722016220e97409fe2f21b222bda33 (diff)
downloadmediapointer-dvb-s2-9369eba75d0d500eb3837d4c9b452b7d66f23dad.tar.gz
mediapointer-dvb-s2-9369eba75d0d500eb3837d4c9b452b7d66f23dad.tar.bz2
merge frontend improvements from DVB tree:
- schedule_timeout(1) in dvb_frontend.c after setting frontend and before waking up frontend thread - do FE_RESET in each iteration of frontend thread if !FE_HAS_LOCK - use aquire_signal flag to call FE_RESET only after tuning until FE_HAS_LOCK has been signalled, and not when FE_HAS_LOCK drops out for short periods of time later
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c49
-rw-r--r--linux/drivers/media/dvb/frontends/ves1x93.c3
2 files changed, 29 insertions, 23 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 360a13096..b4cb067bf 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -67,6 +67,7 @@ struct dvb_frontend_data {
pid_t thread_pid;
unsigned long release_jiffies;
unsigned long lost_sync_jiffies;
+ int aquire_signal;
int bending;
int lnb_drift;
int timeout_count;
@@ -305,6 +306,7 @@ static int dvb_frontend_set_parameters (struct dvb_frontend_data *fe,
fe->lost_sync_count = 0;
fe->lost_sync_jiffies = jiffies;
fe->lnb_drift = 0;
+ fe->aquire_signal = 1;
if (fe->status & ~FE_TIMEDOUT)
dvb_frontend_add_event (fe, 0);
memcpy (&fe->parameters, param,
@@ -364,6 +366,9 @@ static void update_delay (int *quality, int *delay, int locked)
*/
static void dvb_frontend_recover (struct dvb_frontend_data *fe)
{
+ int j = fe->lost_sync_count;
+ int stepsize;
+
dprintk ("%s\n", __FUNCTION__);
#if 0
@@ -383,28 +388,23 @@ static void dvb_frontend_recover (struct dvb_frontend_data *fe)
/**
* let's start a zigzag scan to compensate LNB drift...
*/
- {
- int j = fe->lost_sync_count;
- int stepsize;
-
- if (fe->info->type == FE_QPSK)
- stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
- else if (fe->info->type == FE_QAM)
- stepsize = 0;
- else
- stepsize = fe->info->frequency_stepsize * 2;
-
- if (j % 32 == 0) {
- fe->lnb_drift = 0;
- } else {
- fe->lnb_drift = -fe->lnb_drift;
- if (j % 2)
- fe->lnb_drift += stepsize;
- }
+ if (fe->info->type == FE_QPSK)
+ stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
+ else if (fe->info->type == FE_QAM)
+ stepsize = 0;
+ else
+ stepsize = fe->info->frequency_stepsize * 2;
- dvb_frontend_set_parameters (fe, &fe->parameters, 0);
+ if (j % 32 == 0) {
+ fe->lnb_drift = 0;
+ } else {
+ fe->lnb_drift = -fe->lnb_drift;
+ if (j % 2)
+ fe->lnb_drift += stepsize;
}
+ dvb_frontend_set_parameters (fe, &fe->parameters, 0);
+
dvb_frontend_internal_ioctl (&fe->frontend, FE_RESET, NULL);
}
@@ -467,12 +467,18 @@ static int dvb_frontend_thread (void *data)
if (s & FE_HAS_LOCK) {
fe->timeout_count = 0;
fe->lost_sync_count = 0;
+ fe->aquire_signal = 0;
} else {
fe->lost_sync_count++;
if (!(fe->info->caps & FE_CAN_RECOVER)) {
if (!(fe->info->caps & FE_CAN_CLEAN_SETUP)) {
- if (fe->lost_sync_count < 10)
+ if (fe->lost_sync_count < 10) {
+ if (fe->aquire_signal)
+ dvb_frontend_internal_ioctl(
+ &fe->frontend,
+ FE_RESET, NULL);
continue;
+ }
}
dvb_frontend_recover (fe);
delay = HZ/5;
@@ -605,6 +611,9 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file,
break;
case FE_SET_FRONTEND:
err = dvb_frontend_set_parameters (fe, parg, 1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(1);
+ wake_up_interruptible(&fe->wait_queue);
break;
case FE_GET_EVENT:
err = dvb_frontend_get_event (fe, parg, file->f_flags);
diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c
index 12410b1ea..e6e6ba3fb 100644
--- a/linux/drivers/media/dvb/frontends/ves1x93.c
+++ b/linux/drivers/media/dvb/frontends/ves1x93.c
@@ -395,9 +395,6 @@ static int ves1x93_set_symbolrate (struct dvb_i2c_bus *i2c, u32 srate)
else
ves1x93_writereg (i2c, 0x05, init_1x93_tab[0x05] & 0x7f);
- ves1x93_writereg (i2c, 0x00, 0x00);
- ves1x93_writereg (i2c, 0x00, 0x01);
-
/* ves1993 hates this, will lose lock */
if (demod_type != DEMOD_VES1993)
ves1x93_clr_bit (i2c);