Skip to content

Commit

Permalink
usb: gadget: uvc: Add missing call for additional setup data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Cvek authored and Felipe Balbi committed Aug 31, 2016
1 parent ee5acab commit 4fbac52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/gadget/function/f_uvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4fbac52

Please sign in to comment.