aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/android.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/android.c')
-rw-r--r--drivers/usb/gadget/android.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index d99ec1e..96b5ef5 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -91,8 +91,7 @@ struct android_usb_function {
/* Optional: called when the configuration is removed */
void (*unbind_config)(struct android_usb_function *, struct usb_configuration *);
- /* Optional: handle ctrl requests before the device is configured
- * and/or before the function is enabled */
+ /* Optional: handle ctrl requests before the device is configured */
int (*ctrlrequest)(struct android_usb_function *,
struct usb_composite_dev *,
const struct usb_ctrlrequest *);
@@ -1073,6 +1072,12 @@ android_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *c)
}
}
+ /* Special case the accessory function.
+ * It needs to handle control requests before it is enabled.
+ */
+ if (value < 0)
+ value = acc_ctrlrequest(cdev, c);
+
if (value < 0)
value = composite_setup(gadget, c);