aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_uvc.c
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2013-03-01 14:46:29 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:18:21 -0400
commit43ff05e20c6e2428fe2deb1dc0fed008743e66a3 (patch)
tree1ee79a5d5dd89957df969192ae0ff111a063c233 /drivers/usb/gadget/f_uvc.c
parent609a0532a4d713819092a9311ffe89faa6bac617 (diff)
usb: gadget: uvc: Add fix for UVC compliance test suite's assertion 6.1.25 failure
As per the UVC compliance test suite's assertion 6.1.25, the `iFunction` field of the Interface Association Descriptor (IAD) should the match the `iInterface` field of the standard Video Control (VC) Interface Descriptor for this Video Interface Collection (VIC). This mandatory case is captured in section 3.11 of the USB Video Class Compliance specification revision 1.1 This patch fixes this test assertion's failure and has been tested on Linux FC16, WinXP, WIN7 and WIN8 High speed and Super Speed hosts for successful enumeration. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> [Merged the association and control string descriptors] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_uvc.c')
-rw-r--r--drivers/usb/gadget/f_uvc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index 76ec10fa5f2b..49939e44ed74 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -51,13 +51,11 @@ MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)");
51 51
52/* string IDs are assigned dynamically */ 52/* string IDs are assigned dynamically */
53 53
54#define UVC_STRING_ASSOCIATION_IDX 0 54#define UVC_STRING_CONTROL_IDX 0
55#define UVC_STRING_CONTROL_IDX 1 55#define UVC_STRING_STREAMING_IDX 1
56#define UVC_STRING_STREAMING_IDX 2
57 56
58static struct usb_string uvc_en_us_strings[] = { 57static struct usb_string uvc_en_us_strings[] = {
59 [UVC_STRING_ASSOCIATION_IDX].s = "UVC Camera", 58 [UVC_STRING_CONTROL_IDX].s = "UVC Camera",
60 [UVC_STRING_CONTROL_IDX].s = "Video Control",
61 [UVC_STRING_STREAMING_IDX].s = "Video Streaming", 59 [UVC_STRING_STREAMING_IDX].s = "Video Streaming",
62 { } 60 { }
63}; 61};
@@ -572,7 +570,7 @@ uvc_function_unbind(struct usb_configuration *c, struct usb_function *f)
572 uvc->control_ep->driver_data = NULL; 570 uvc->control_ep->driver_data = NULL;
573 uvc->video.ep->driver_data = NULL; 571 uvc->video.ep->driver_data = NULL;
574 572
575 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id = 0; 573 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id = 0;
576 usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); 574 usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
577 kfree(uvc->control_buf); 575 kfree(uvc->control_buf);
578 576
@@ -796,12 +794,12 @@ uvc_bind_config(struct usb_configuration *c,
796 * for the first UVC function. UVC functions beyond the first (if any) 794 * for the first UVC function. UVC functions beyond the first (if any)
797 * will reuse the same IDs. 795 * will reuse the same IDs.
798 */ 796 */
799 if (uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id == 0) { 797 if (uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id == 0) {
800 ret = usb_string_ids_tab(c->cdev, uvc_en_us_strings); 798 ret = usb_string_ids_tab(c->cdev, uvc_en_us_strings);
801 if (ret) 799 if (ret)
802 goto error; 800 goto error;
803 uvc_iad.iFunction = 801 uvc_iad.iFunction =
804 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id; 802 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id;
805 uvc_control_intf.iInterface = 803 uvc_control_intf.iInterface =
806 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id; 804 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id;
807 ret = uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id; 805 ret = uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id;