Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fbac520 authored by Petr Cvek's avatar Petr Cvek Committed by Felipe Balbi
Browse files

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: default avatarPetr Cvek <petr.cvek@tul.cz>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent ee5acabf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
}