Commit 0485ec0d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Felipe Balbi

usb: gadget: uvc: Configure the streaming endpoint based on the speed

Call the appropriate usb_ep_autoconf*() function depending on the device
speed, and pass it the corresponding streaming endpoint.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: default avatarBhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 20777dde
...@@ -549,8 +549,7 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed) ...@@ -549,8 +549,7 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
UVC_COPY_DESCRIPTORS(mem, dst, UVC_COPY_DESCRIPTORS(mem, dst,
(const struct usb_descriptor_header**)uvc_streaming_cls); (const struct usb_descriptor_header**)uvc_streaming_cls);
uvc_streaming_header->wTotalLength = cpu_to_le16(streaming_size); uvc_streaming_header->wTotalLength = cpu_to_le16(streaming_size);
uvc_streaming_header->bEndpointAddress = uvc_streaming_header->bEndpointAddress = uvc->video.ep->address;
uvc_fs_streaming_ep.bEndpointAddress;
UVC_COPY_DESCRIPTORS(mem, dst, uvc_streaming_std); UVC_COPY_DESCRIPTORS(mem, dst, uvc_streaming_std);
...@@ -637,7 +636,14 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -637,7 +636,14 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
uvc->control_ep = ep; uvc->control_ep = ep;
ep->driver_data = uvc; ep->driver_data = uvc;
if (gadget_is_superspeed(c->cdev->gadget))
ep = usb_ep_autoconfig_ss(cdev->gadget, &uvc_ss_streaming_ep,
&uvc_ss_streaming_comp);
else if (gadget_is_dualspeed(cdev->gadget))
ep = usb_ep_autoconfig(cdev->gadget, &uvc_hs_streaming_ep);
else
ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep); ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
if (!ep) { if (!ep) {
INFO(cdev, "Unable to allocate streaming EP\n"); INFO(cdev, "Unable to allocate streaming EP\n");
goto error; goto error;
...@@ -645,10 +651,9 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -645,10 +651,9 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
uvc->video.ep = ep; uvc->video.ep = ep;
ep->driver_data = uvc; ep->driver_data = uvc;
uvc_hs_streaming_ep.bEndpointAddress = uvc_fs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
uvc_fs_streaming_ep.bEndpointAddress; uvc_hs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
uvc_ss_streaming_ep.bEndpointAddress = uvc_ss_streaming_ep.bEndpointAddress = uvc->video.ep->address;
uvc_fs_streaming_ep.bEndpointAddress;
/* Allocate interface IDs. */ /* Allocate interface IDs. */
if ((ret = usb_interface_id(c, f)) < 0) if ((ret = usb_interface_id(c, f)) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment