OSDN Git Service

usb: f_qdss: Use QDSS string descriptor with QDSS interface descriptor
authorMayank Rana <mrana@codeaurora.org>
Fri, 15 Sep 2017 23:40:24 +0000 (16:40 -0700)
committerHemant Kumar <hemantk@codeaurora.org>
Thu, 5 Oct 2017 23:58:02 +0000 (16:58 -0700)
QDSS Data and QDSS Ctrl related string descriptors are defined but those
are not being advertised to Host. Hence update USB QDSS interface
descriptor with USB QDSS string descriptor. This helps some of host side
application to detect enuermated QDSS interface and allows IO with it.

Change-Id: I1ff141f1b52d867d70ecc8f23ac065639999c0f9
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
drivers/usb/gadget/function/f_qdss.c

index 8536f10..5189f6d 100644 (file)
@@ -374,7 +374,7 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
        struct usb_gadget *gadget = c->cdev->gadget;
        struct f_qdss *qdss = func_to_qdss(f);
        struct usb_ep *ep;
-       int iface;
+       int iface, id;
 
        pr_debug("qdss_bind\n");
 
@@ -392,6 +392,12 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
        qdss_data_intf_desc.bInterfaceNumber = iface;
        qdss->data_iface_id = iface;
 
+       id = usb_string_id(c->cdev);
+       if (id < 0)
+               return id;
+       qdss_string_defs[QDSS_DATA_IDX].id = id;
+       qdss_data_intf_desc.iInterface = id;
+
        if (qdss->debug_inface_enabled) {
                /* Allocate ctrl I/F */
                iface = usb_interface_id(c, f);
@@ -401,6 +407,11 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
                }
                qdss_ctrl_intf_desc.bInterfaceNumber = iface;
                qdss->ctrl_iface_id = iface;
+               id = usb_string_id(c->cdev);
+               if (id < 0)
+                       return id;
+               qdss_string_defs[QDSS_CTRL_IDX].id = id;
+               qdss_ctrl_intf_desc.iInterface = id;
        }
 
        ep = usb_ep_autoconfig_ss(gadget, &qdss_ss_data_desc,