V4L/DVB (3742): Set tone/voltage again if the frontend was reinitialised
authorAndrew de Quincey <adq_dvb@lidskialf.net>
Thu, 6 Apr 2006 17:32:23 +0000 (14:32 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 12 May 2006 22:54:44 +0000 (19:54 -0300)
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-core/dvb_frontend.c

index 4f8f257..a051790 100644 (file)
@@ -106,6 +106,8 @@ struct dvb_frontend_private {
        unsigned long tune_mode_flags;
        unsigned int delay;
        unsigned int reinitialise;
+       int tone;
+       int voltage;
 
        /* swzigzag values */
        unsigned int state;
@@ -537,6 +539,12 @@ static int dvb_frontend_thread(void *data)
 
                if (fepriv->reinitialise) {
                        dvb_frontend_init(fe);
+                       if (fepriv->tone != -1) {
+                               fe->ops->set_tone(fe, fepriv->tone);
+                       }
+                       if (fepriv->voltage != -1) {
+                               fe->ops->set_voltage(fe, fepriv->voltage);
+                       }
                        fepriv->reinitialise = 0;
                }
 
@@ -788,6 +796,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
        case FE_SET_TONE:
                if (fe->ops->set_tone) {
                        err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg);
+                       fepriv->tone = (fe_sec_tone_mode_t) parg;
                        fepriv->state = FESTATE_DISEQC;
                        fepriv->status = 0;
                }
@@ -796,6 +805,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
        case FE_SET_VOLTAGE:
                if (fe->ops->set_voltage) {
                        err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg);
+                       fepriv->voltage = (fe_sec_voltage_t) parg;
                        fepriv->state = FESTATE_DISEQC;
                        fepriv->status = 0;
                }
@@ -995,6 +1005,8 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
 
                /* normal tune mode when opened R/W */
                fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
+               fepriv->tone = -1;
+               fepriv->voltage = -1;
        }
 
        return ret;