projects
/
platform
/
kernel
/
kernel-mfld-blackbay.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8da4499
)
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
mgross
<mark.gross@intel.com>
Wed, 9 Nov 2011 20:03:10 +0000
(12:03 -0800)
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
e15c0b6
..
03b0287
100644
(file)
--- a/
drivers/usb/gadget/composite.c
+++ b/
drivers/usb/gadget/composite.c
@@
-931,6
+931,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;