From 32aefb6255f317a3dea78a9e43c895a5a71d85f0 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Tue, 25 Oct 2011 11:37:33 +0800 Subject: usb: gadget: composite: Add usb_remove_config This allows composite drivers to dynamically change their configuration. For example, a driver might remove a configuration and register a new one with a different set of functions. User should prevent the host from enumerating the device while changing the configuration: usb_gadget_disconnect(cdev->gadget); usb_remove_config(cdev, old_config); usb_add_config(cdev, new_config, new_conf_bind); usb_gadget_connect(cdev->gadget); Change-Id: Icbfb4ce41685fde9bf63d5d58fca1ad242aa69f9 Signed-off-by: Benoit Goby --- include/linux/usb/composite.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index db618dfc9aa..c70fe154877 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -251,6 +251,9 @@ int usb_add_config(struct usb_composite_dev *, struct usb_configuration *, int (*)(struct usb_configuration *)); +int usb_remove_config(struct usb_composite_dev *, + struct usb_configuration *); + /** * struct usb_composite_driver - groups configurations into a gadget * @name: For diagnostics, identifies the driver. -- cgit v1.2.3