Commit 388a6d54 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

V4L/DVB (13996): gspca_stv0680: Fix streaming on vga cameras

Streaming of VGA stv0680 based cams (instead of CIF ones) failed, because
we were using the wrong control pipe for certain commands, this patch fixes
this.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 98184f78
...@@ -53,24 +53,28 @@ static int stv_sndctrl(struct gspca_dev *gspca_dev, int set, u8 req, u16 val, ...@@ -53,24 +53,28 @@ static int stv_sndctrl(struct gspca_dev *gspca_dev, int set, u8 req, u16 val,
{ {
int ret = -1; int ret = -1;
u8 req_type = 0; u8 req_type = 0;
unsigned int pipe = 0;
switch (set) { switch (set) {
case 0: /* 0xc1 */ case 0: /* 0xc1 */
req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT; req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
pipe = usb_rcvctrlpipe(gspca_dev->dev, 0);
break; break;
case 1: /* 0x41 */ case 1: /* 0x41 */
req_type = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT; req_type = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
pipe = usb_sndctrlpipe(gspca_dev->dev, 0);
break; break;
case 2: /* 0x80 */ case 2: /* 0x80 */
req_type = USB_DIR_IN | USB_RECIP_DEVICE; req_type = USB_DIR_IN | USB_RECIP_DEVICE;
pipe = usb_rcvctrlpipe(gspca_dev->dev, 0);
break; break;
case 3: /* 0x40 */ case 3: /* 0x40 */
req_type = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; req_type = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE;
pipe = usb_sndctrlpipe(gspca_dev->dev, 0);
break; break;
} }
ret = usb_control_msg(gspca_dev->dev, ret = usb_control_msg(gspca_dev->dev, pipe,
usb_rcvctrlpipe(gspca_dev->dev, 0),
req, req_type, req, req_type,
val, 0, gspca_dev->usb_buf, size, 500); val, 0, gspca_dev->usb_buf, size, 500);
...@@ -173,6 +177,8 @@ static int sd_config(struct gspca_dev *gspca_dev, ...@@ -173,6 +177,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
PDEBUG(D_PROBE, "Camera supports CIF mode"); PDEBUG(D_PROBE, "Camera supports CIF mode");
if (gspca_dev->usb_buf[7] & 0x02) if (gspca_dev->usb_buf[7] & 0x02)
PDEBUG(D_PROBE, "Camera supports VGA mode"); PDEBUG(D_PROBE, "Camera supports VGA mode");
if (gspca_dev->usb_buf[7] & 0x04)
PDEBUG(D_PROBE, "Camera supports QCIF mode");
if (gspca_dev->usb_buf[7] & 0x08) if (gspca_dev->usb_buf[7] & 0x08)
PDEBUG(D_PROBE, "Camera supports QVGA mode"); PDEBUG(D_PROBE, "Camera supports QVGA mode");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment