]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/dvb/dvb-usb/vp702x-fe.c
Merge branch 'r8169-for-jeff-20070806' of git://electric-eye.fr.zoreil.com/home/romie...
[linux-2.6-omap-h63xx.git] / drivers / media / dvb / dvb-usb / vp702x-fe.c
index 2a89f8c5da99cf78c8af7fde74c67dd24282d0c1..c3fdc7cd094e33f41c4e2c34f4ec7b565233d2e6 100644 (file)
@@ -24,6 +24,8 @@ struct vp702x_fe_state {
        struct dvb_frontend fe;
        struct dvb_usb_device *d;
 
+       struct dvb_frontend_ops ops;
+
        fe_sec_voltage_t voltage;
        fe_sec_tone_mode_t tone_mode;
 
@@ -72,9 +74,6 @@ static int vp702x_fe_read_status(struct dvb_frontend* fe, fe_status_t *status)
        else
                *status = 0;
 
-       deb_fe("real state: %x\n",*status);
-       *status = 0x1f;
-
        if (*status & FE_HAS_LOCK)
                st->status_check_interval = 1000;
        else
@@ -171,8 +170,6 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
        st->status_check_interval = 250;
        st->next_status_check = jiffies;
 
-       vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0);
-       msleep(30);
        vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100);
 
        if (ibuf[2] == 0 && ibuf[3] == 0)
@@ -183,6 +180,20 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
        return 0;
 }
 
+static int vp702x_fe_init(struct dvb_frontend *fe)
+{
+       struct vp702x_fe_state *st = fe->demodulator_priv;
+       deb_fe("%s\n",__FUNCTION__);
+       vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0);
+       return 0;
+}
+
+static int vp702x_fe_sleep(struct dvb_frontend *fe)
+{
+       deb_fe("%s\n",__FUNCTION__);
+       return 0;
+}
+
 static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
                                  struct dvb_frontend_parameters *fep)
 {
@@ -287,17 +298,16 @@ struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
                goto error;
 
        s->d = d;
-       s->fe.ops = &vp702x_fe_ops;
+
+       memcpy(&s->fe.ops,&vp702x_fe_ops,sizeof(struct dvb_frontend_ops));
        s->fe.demodulator_priv = s;
 
        s->lnb_buf[1] = SET_LNB_POWER;
        s->lnb_buf[3] = 0xff; /* 0=tone burst, 2=data burst, ff=off */
 
-       goto success;
+       return &s->fe;
 error:
        return NULL;
-success:
-       return &s->fe;
 }
 
 
@@ -319,8 +329,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
        },
        .release = vp702x_fe_release,
 
-       .init = NULL,
-       .sleep = NULL,
+       .init  = vp702x_fe_init,
+       .sleep = vp702x_fe_sleep,
 
        .set_frontend = vp702x_fe_set_frontend,
        .get_frontend = vp702x_fe_get_frontend,