summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorAndrew de Quincy <devnull@localhost>2005-06-09 21:22:41 +0000
committerAndrew de Quincy <devnull@localhost>2005-06-09 21:22:41 +0000
commita3fba27b25767905b9608ef9adf68ada1c04776e (patch)
tree8296614cd9893b8316fe0936daec9d5c9ea938b4 /linux/drivers
parentf6df2aef7add3bcfd7f67da4179d09fad6e67ce2 (diff)
downloadmediapointer-dvb-s2-a3fba27b25767905b9608ef9adf68ada1c04776e.tar.gz
mediapointer-dvb-s2-a3fba27b25767905b9608ef9adf68ada1c04776e.tar.bz2
Add workaround for lock loss issue.
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 1439346a5..1fbc0c8d1 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -113,6 +113,7 @@ struct dvb_frontend_private {
int exit;
int wakeup;
fe_status_t status;
+ fe_sec_tone_mode_t tone;
};
@@ -435,9 +436,26 @@ static int dvb_frontend_thread(void *data)
/* we're tuned, and the lock is still good... */
if (s & FE_HAS_LOCK)
continue;
- else {
- /* if we _WERE_ tuned, but now don't have a lock,
- * need to zigzag */
+ else { /* if we _WERE_ tuned, but now don't have a lock */
+
+ /* first of all try setting the tone again if it was on - this
+ * sometimes works around problems with noisy power supplies */
+ if (fe->ops->set_tone && (fepriv->tone == SEC_TONE_ON)) {
+ fe->ops->set_tone(fe, fepriv->tone);
+ mdelay(100);
+ s = 0;
+ fe->ops->read_status(fe, &s);
+ if (s & FE_HAS_LOCK) {
+ printk("DVB%i: Lock was lost, but regained by setting "
+ "the tone. This may indicate your power supply "
+ "is noisy/slightly incompatable with this DVB-S "
+ "adapter\n", fe->dvb->num);
+ fepriv->state = FESTATE_TUNED;
+ continue;
+ }
+ }
+
+ /* some other reason for losing the lock - start zigzagging */
fepriv->state = FESTATE_ZIGZAG_FAST;
fepriv->started_auto_step = fepriv->auto_step;
check_wrapped = 0;
@@ -629,15 +647,15 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
case FE_READ_STATUS: {
fe_status_t* status = parg;
-
- /* if retune was requested but hasn't occured yet, prevent
+
+ /* if retune was requested but hasn't occured yet, prevent
* that user get signal state from previous tuning */
if(fepriv->state == FESTATE_RETUNE) {
err=0;
*status = 0;
break;
- }
-
+ }
+
if (fe->ops->read_status)
err = fe->ops->read_status(fe, status);
break;
@@ -692,6 +710,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg);
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
+ fepriv->tone = (fe_sec_tone_mode_t) parg;
}
break;
@@ -894,6 +913,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
init_MUTEX (&fepriv->events.sem);
fe->dvb = dvb;
fepriv->inversion = INVERSION_OFF;
+ fepriv->tone = SEC_TONE_OFF;
printk ("DVB: registering frontend %i (%s)...\n",
fe->dvb->num,