From 4fbac5206afd01b717d4bdc58793d471f3391b4b Mon Sep 17 00:00:00 2001 From: Petr Cvek Date: Wed, 17 Aug 2016 12:36:57 +0200 Subject: [PATCH] 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 Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/f_uvc.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.20.1