aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2005-07-07 20:57:37 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:53 -0400
commit4992775c8287145e86b94fe8d19bbb5f20148cc0 (patch)
tree6e2c39415532fe7c7c31f1b936130cd66d4ad036 /drivers
parent6757ccc57d2cc4ab4e63d8aee97f2e6b9f998990 (diff)
[PATCH] dvb: core: add workaround for tuning problem
Add workaround for signal lock loss issue, where the frontend loses the signal after some hours without any visible reason. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c28
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
45static int dvb_frontend_debug; 47static int dvb_frontend_debug;
46static int dvb_shutdown_timeout = 5; 48static int dvb_shutdown_timeout = 5;
47static int dvb_force_auto_inversion; 49static 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,