aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-10-16 06:13:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:44 -0500
commita511ba947600ae263f8c29c86020ba66a901d3e5 (patch)
treed27d646a98aa45f92a2df78eb66d7cfe0f446ff6 /drivers/media/video/gspca/gspca.c
parenteea85b0a629970d462481a80e1d45f4d71fe797f (diff)
V4L/DVB (13178): gspca: Add support for Winbond W9967CF and W9968CF camera's
This patch adds support to gspca for the Winbond W9967CF and W9968CF camera's. This is mostly a port of the existing v4l1 driver to gspca (making it v4l2). But this also features fixes to the bitbanging i2c code (send a nack not an ack after reading the last byte of a transfer), which gets rid of the weird errors which were being seen there, and of the smbus_refresh() hack to get around these errors. Also the vstart settings have been tweaked to work with different frequency filter settings. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 179cbc14ee51..ebaa2425fb50 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -475,10 +475,18 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
475 xfer = gspca_dev->cam.bulk ? USB_ENDPOINT_XFER_BULK 475 xfer = gspca_dev->cam.bulk ? USB_ENDPOINT_XFER_BULK
476 : USB_ENDPOINT_XFER_ISOC; 476 : USB_ENDPOINT_XFER_ISOC;
477 i = gspca_dev->alt; /* previous alt setting */ 477 i = gspca_dev->alt; /* previous alt setting */
478 while (--i >= 0) { 478 if (gspca_dev->cam.reverse_alts) {
479 ep = alt_xfer(&intf->altsetting[i], xfer); 479 while (++i < gspca_dev->nbalt) {
480 if (ep) 480 ep = alt_xfer(&intf->altsetting[i], xfer);
481 break; 481 if (ep)
482 break;
483 }
484 } else {
485 while (--i >= 0) {
486 ep = alt_xfer(&intf->altsetting[i], xfer);
487 if (ep)
488 break;
489 }
482 } 490 }
483 if (ep == NULL) { 491 if (ep == NULL) {
484 err("no transfer endpoint found"); 492 err("no transfer endpoint found");
@@ -599,7 +607,11 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
599 607
600 /* set the higher alternate setting and 608 /* set the higher alternate setting and
601 * loop until urb submit succeeds */ 609 * loop until urb submit succeeds */
602 gspca_dev->alt = gspca_dev->nbalt; 610 if (gspca_dev->cam.reverse_alts)
611 gspca_dev->alt = 0;
612 else
613 gspca_dev->alt = gspca_dev->nbalt;
614
603 if (gspca_dev->sd_desc->isoc_init) { 615 if (gspca_dev->sd_desc->isoc_init) {
604 ret = gspca_dev->sd_desc->isoc_init(gspca_dev); 616 ret = gspca_dev->sd_desc->isoc_init(gspca_dev);
605 if (ret < 0) 617 if (ret < 0)