aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2012-06-01 05:38:54 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-04 11:12:25 -0400
commit3de6e63f7845e99981e489ddccf70b3ec02fe00a (patch)
tree87480666c4c3715ec12e33423e9fc8381f363489 /drivers/usb/gadget
parent0a00790ff4755f2e3eab907a43725cff59fc074b (diff)
usb: gadget: uvc: Fix string descriptor STALL issue when multiple uvc functions are added to a configuration
This patch solved the string descriptor STALL issue when we add multiple UVC functions in a single configuration using a 'webcam.c' like composite driver. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_uvc.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index 2022fe492148..054c35a22fbf 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -619,22 +619,28 @@ uvc_bind_config(struct usb_configuration *c,
619 uvc->desc.fs_streaming = fs_streaming; 619 uvc->desc.fs_streaming = fs_streaming;
620 uvc->desc.hs_streaming = hs_streaming; 620 uvc->desc.hs_streaming = hs_streaming;
621 621
622 /* Allocate string descriptor numbers. */ 622 /* maybe allocate device-global string IDs, and patch descriptors */
623 if ((ret = usb_string_id(c->cdev)) < 0) 623 if (uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id == 0) {
624 goto error; 624 /* Allocate string descriptor numbers. */
625 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id = ret; 625 ret = usb_string_id(c->cdev);
626 uvc_iad.iFunction = ret; 626 if (ret < 0)
627 627 goto error;
628 if ((ret = usb_string_id(c->cdev)) < 0) 628 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id = ret;
629 goto error; 629 uvc_iad.iFunction = ret;
630 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id = ret; 630
631 uvc_control_intf.iInterface = ret; 631 ret = usb_string_id(c->cdev);
632 632 if (ret < 0)
633 if ((ret = usb_string_id(c->cdev)) < 0) 633 goto error;
634 goto error; 634 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id = ret;
635 uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id = ret; 635 uvc_control_intf.iInterface = ret;
636 uvc_streaming_intf_alt0.iInterface = ret; 636
637 uvc_streaming_intf_alt1.iInterface = ret; 637 ret = usb_string_id(c->cdev);
638 if (ret < 0)
639 goto error;
640 uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id = ret;
641 uvc_streaming_intf_alt0.iInterface = ret;
642 uvc_streaming_intf_alt1.iInterface = ret;
643 }
638 644
639 /* Register the function. */ 645 /* Register the function. */
640 uvc->func.name = "uvc"; 646 uvc->func.name = "uvc";