V4L/DVB (9544): gspca: Clear the bulk endpoint at starting time when bulk transfer.
authorJean-Francois Moine <moinejf@free.fr>
Wed, 22 Oct 2008 17:51:56 +0000 (14:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:28 +0000 (17:53 -0200)
- usb_clear_halt() added in gspca and removed in finepix.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/finepix.c
drivers/media/video/gspca/gspca.c

index 607942fd797004cb0737cac2af973e5e21623f9b..03cb9446632376eaebb9081ec27291a1d0a41c04 100644 (file)
@@ -314,9 +314,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
        int ret;
        int size_ret;
 
-       /* Reset bulk in endpoint */
-       usb_clear_halt(gspca_dev->dev, gspca_dev->cam.epaddr);
-
        /* Init the device */
        memset(gspca_dev->usb_buf, 0, 12);
        gspca_dev->usb_buf[0] = 0xc6;
index 6e23fd4a203fa5010833747c293ddd7bc00bde8c..afddb18024a8f20156c04a595d51089c2d4b2830 100644 (file)
@@ -597,6 +597,12 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
                if (ret < 0)
                        goto out;
 
+               /* clear the bulk endpoint */
+               if (gspca_dev->alt == 0)        /* if bulk transfer */
+                       usb_clear_halt(gspca_dev->dev,
+                                       usb_rcvintpipe(gspca_dev->dev,
+                                                gspca_dev->cam.epaddr));
+
                /* start the cam */
                ret = gspca_dev->sd_desc->start(gspca_dev);
                if (ret < 0) {