summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/uvc.h
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2013-03-01 20:46:30 +0100
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:18:21 +0200
commit41837c352fd8d804dbe978c29e57ec8217df1d51 (patch)
treef89cdcee13aa08577a6d829c68174a4631b5652d /drivers/usb/gadget/uvc.h
parent43ff05e20c6e2428fe2deb1dc0fed008743e66a3 (diff)
downloadop-kernel-dev-41837c352fd8d804dbe978c29e57ec8217df1d51.zip
op-kernel-dev-41837c352fd8d804dbe978c29e57ec8217df1d51.tar.gz
usb: gadget: uvc: Delay the status stage when setting alternate setting 1
This patch adds the support in UVC webcam gadget design for providing USB_GADGET_DELAYED_STATUS in response to a set_interface(alt setting 1) command issue by the Host. The current UVC webcam gadget design generates a STREAMON event corresponding to a set_interface(alt setting 1) command from the Host. This STREAMON event will eventually be routed to a real V4L2 device. To start video streaming, it may be required to perform some register writes to a camera sensor device over slow external busses like I2C or SPI. So, it makes sense to ensure that we delay the STATUS stage of the set_interface (alt setting 1) command. Otherwise, a lot of ISOC IN tokens sent by the Host will be replied to by zero-length packets by the webcam device. On certain Hosts this may even lead to ISOC URBs been cancelled from the Host side. So, as soon as we finish doing all the "streaming" related stuff on the real V4L2 device, we call a STREAMON ioctl on the UVC side and from here we call the 'usb_composite_setup_continue' function to complete the status stage of the set_interface(alt setting 1) command. Further, we need to ensure that we queue no video buffers on the UVC webcam gadget, until we de-queue a video buffer from the V4L2 device. So, the application should call the STREAMON on UVC side only when it has dequeued sufficient buffers from the V4L2 side and queued them to the UVC gadget. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/uvc.h')
-rw-r--r--drivers/usb/gadget/uvc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/uvc.h b/drivers/usb/gadget/uvc.h
index 7e90b1d..817e9e1 100644
--- a/drivers/usb/gadget/uvc.h
+++ b/drivers/usb/gadget/uvc.h
@@ -188,6 +188,7 @@ struct uvc_file_handle
* Functions
*/
+extern void uvc_function_setup_continue(struct uvc_device *uvc);
extern void uvc_endpoint_stream(struct uvc_device *dev);
extern void uvc_function_connect(struct uvc_device *uvc);
OpenPOWER on IntegriCloud