projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9946e7
)
USB: composite: Add support for functions overriding USB_DT_STRING descriptors
author
Mike Lockwood
<lockwood@android.com>
Fri, 16 Apr 2010 19:32:15 +0000
(15:32 -0400)
committer
Colin Cross
<ccross@android.com>
Thu, 30 Sep 2010 00:49:38 +0000
(17:49 -0700)
Needed for MTP support.
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/composite.c
patch
|
blob
|
history
diff --git
a/drivers/usb/gadget/composite.c
b/drivers/usb/gadget/composite.c
index 1865b45180ad61ebc9e54372b8ce3c1f0e88471d..d3250ea7f44471de83def2a8203b10a87bcea348 100644
(file)
--- a/
drivers/usb/gadget/composite.c
+++ b/
drivers/usb/gadget/composite.c
@@
-892,6
+892,21
@@
composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
case USB_DT_STRING:
value = get_string(cdev, req->buf,
w_index, w_value & 0xff);
+
+ /* Allow functions to handle USB_DT_STRING.
+ * This is required for MTP.
+ */
+ if (value < 0) {
+ struct usb_configuration *cfg;
+ list_for_each_entry(cfg, &cdev->configs, list) {
+ if (cfg && cfg->setup) {
+ value = cfg->setup(cfg, ctrl);
+ if (value >= 0)
+ break;
+ }
+ }
+ }
+
if (value >= 0)
value = min(w_length, (u16) value);
break;