diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index e561ac1e1b16..a8bc84240b50 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -42,6 +42,8 @@ | |||
42 | #include "dvb_frontend.h" | 42 | #include "dvb_frontend.h" |
43 | #include "dvbdev.h" | 43 | #include "dvbdev.h" |
44 | 44 | ||
45 | // #define DEBUG_LOCKLOSS 1 | ||
46 | |||
45 | static int dvb_frontend_debug; | 47 | static int dvb_frontend_debug; |
46 | static int dvb_shutdown_timeout = 5; | 48 | static int dvb_shutdown_timeout = 5; |
47 | static int dvb_force_auto_inversion; | 49 | static int dvb_force_auto_inversion; |
@@ -113,6 +115,7 @@ struct dvb_frontend_private { | |||
113 | int exit; | 115 | int exit; |
114 | int wakeup; | 116 | int wakeup; |
115 | fe_status_t status; | 117 | fe_status_t status; |
118 | fe_sec_tone_mode_t tone; | ||
116 | }; | 119 | }; |
117 | 120 | ||
118 | 121 | ||
@@ -434,9 +437,26 @@ static int dvb_frontend_thread(void *data) | |||
434 | /* we're tuned, and the lock is still good... */ | 437 | /* we're tuned, and the lock is still good... */ |
435 | if (s & FE_HAS_LOCK) | 438 | if (s & FE_HAS_LOCK) |
436 | continue; | 439 | continue; |
437 | else { | 440 | else { /* if we _WERE_ tuned, but now don't have a lock */ |
438 | /* if we _WERE_ tuned, but now don't have a lock, | 441 | #ifdef DEBUG_LOCKLOSS |
439 | * need to zigzag */ | 442 | /* first of all try setting the tone again if it was on - this |
443 | * sometimes works around problems with noisy power supplies */ | ||
444 | if (fe->ops->set_tone && (fepriv->tone == SEC_TONE_ON)) { | ||
445 | fe->ops->set_tone(fe, fepriv->tone); | ||
446 | mdelay(100); | ||
447 | s = 0; | ||
448 | fe->ops->read_status(fe, &s); | ||
449 | if (s & FE_HAS_LOCK) { | ||
450 | printk("DVB%i: Lock was lost, but regained by setting " | ||
451 | "the tone. This may indicate your power supply " | ||
452 | "is noisy/slightly incompatable with this DVB-S " | ||
453 | "adapter\n", fe->dvb->num); | ||
454 | fepriv->state = FESTATE_TUNED; | ||
455 | continue; | ||
456 | } | ||
457 | } | ||
458 | #endif | ||
459 | /* some other reason for losing the lock - start zigzagging */ | ||
440 | fepriv->state = FESTATE_ZIGZAG_FAST; | 460 | fepriv->state = FESTATE_ZIGZAG_FAST; |
441 | fepriv->started_auto_step = fepriv->auto_step; | 461 | fepriv->started_auto_step = fepriv->auto_step; |
442 | check_wrapped = 0; | 462 | check_wrapped = 0; |
@@ -691,6 +711,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
691 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); | 711 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); |
692 | fepriv->state = FESTATE_DISEQC; | 712 | fepriv->state = FESTATE_DISEQC; |
693 | fepriv->status = 0; | 713 | fepriv->status = 0; |
714 | fepriv->tone = (fe_sec_tone_mode_t) parg; | ||
694 | } | 715 | } |
695 | break; | 716 | break; |
696 | 717 | ||
@@ -893,6 +914,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb, | |||
893 | init_MUTEX (&fepriv->events.sem); | 914 | init_MUTEX (&fepriv->events.sem); |
894 | fe->dvb = dvb; | 915 | fe->dvb = dvb; |
895 | fepriv->inversion = INVERSION_OFF; | 916 | fepriv->inversion = INVERSION_OFF; |
917 | fepriv->tone = SEC_TONE_OFF; | ||
896 | 918 | ||
897 | printk ("DVB: registering frontend %i (%s)...\n", | 919 | printk ("DVB: registering frontend %i (%s)...\n", |
898 | fe->dvb->num, | 920 | fe->dvb->num, |