summaryrefslogtreecommitdiff
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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index eb6af6d538d6..2ebc8183fd52 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -430,6 +430,19 @@ void android_enable_function(struct usb_function *f, int enable)
}
}
#endif
+#ifdef CONFIG_USB_ANDROID_ACCESSORY
+ if (!strcmp(f->name, "accessory") && enable) {
+ struct usb_function *func;
+
+ /* disable everything else (and keep adb for now) */
+ list_for_each_entry(func, &android_config_driver.functions, list) {
+ if (strcmp(func->name, "accessory")
+ && strcmp(func->name, "adb")) {
+ usb_function_set_enabled(func, 0);
+ }
+ }
+ }
+#endif
update_dev_desc(dev);