Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4303
b: refs/heads/master
c: 4992775
h: refs/heads/master
i:
  4301: 8c29ca1
  4299: de17c31
  4295: b2cc982
  4287: 9ae6675
v: v3
  • Loading branch information
Andrew de Quincey authored and Linus Torvalds committed Jul 8, 2005
1 parent ca89049 commit 9c8639d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6757ccc57d2cc4ab4e63d8aee97f2e6b9f998990
refs/heads/master: 4992775c8287145e86b94fe8d19bbb5f20148cc0
28 changes: 25 additions & 3 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "dvb_frontend.h"
#include "dvbdev.h"

// #define DEBUG_LOCKLOSS 1

static int dvb_frontend_debug;
static int dvb_shutdown_timeout = 5;
static int dvb_force_auto_inversion;
Expand Down Expand Up @@ -113,6 +115,7 @@ struct dvb_frontend_private {
int exit;
int wakeup;
fe_status_t status;
fe_sec_tone_mode_t tone;
};


Expand Down Expand Up @@ -434,9 +437,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 */
#ifdef DEBUG_LOCKLOSS
/* 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;
}
}
#endif
/* some other reason for losing the lock - start zigzagging */
fepriv->state = FESTATE_ZIGZAG_FAST;
fepriv->started_auto_step = fepriv->auto_step;
check_wrapped = 0;
Expand Down Expand Up @@ -691,6 +711,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;

Expand Down Expand Up @@ -893,6 +914,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,
Expand Down

0 comments on commit 9c8639d

Please sign in to comment.