summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_uvc.c
diff options
context:
space:
mode:
authorPetr Cvek <petr.cvek@tul.cz>2016-08-17 13:36:57 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-08-31 10:06:04 +0300
commit4fbac5206afd01b717d4bdc58793d471f3391b4b (patch)
treeda884fd091ed24cc5e7b823a494467e911970cfb /drivers/usb/gadget/function/f_uvc.c
parentee5acabf5805612c72084276e0c215367a042d71 (diff)
downloadlinux-4fbac5206afd01b717d4bdc58793d471f3391b4b.tar.xz
usb: gadget: uvc: Add missing call for additional setup data
Some UVC commands require additional data (non zero uvc->event_length). Add usb_ep_queue() call, so uvc_function_ep0_complete() can be called and send received data to the userspace. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_uvc.c')
-rw-r--r--drivers/usb/gadget/function/f_uvc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 29b41b5dee04..27ed51b5082f 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -258,6 +258,13 @@ uvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req));
v4l2_event_queue(&uvc->vdev, &v4l2_event);
+ /* Pass additional setup data to userspace */
+ if (uvc->event_setup_out && uvc->event_length) {
+ uvc->control_req->length = uvc->event_length;
+ return usb_ep_queue(uvc->func.config->cdev->gadget->ep0,
+ uvc->control_req, GFP_ATOMIC);
+ }
+
return 0;
}