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 <benoit@android.com>
This commit is contained in:
Benoit Goby
2011-05-25 23:59:43 -07:00
parent f6e7d49e03
commit 94df1bdfdc
2 changed files with 43 additions and 20 deletions

View File

@@ -249,6 +249,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.