mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-19 12:00:46 +09:00
USB: composite: Add usb_composite_force_reset utility to force enumeration
Use this rather than calling usb_gadget_disconnect and usb_gadget_connect directly to avoid sending USB disconnect events to userspace when resetting the bus. Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
committed by
Colin Cross
parent
1ee6838659
commit
35ee07a4df
@@ -39,6 +39,7 @@
|
||||
#include <linux/switch.h>
|
||||
|
||||
|
||||
struct usb_composite_dev;
|
||||
struct usb_configuration;
|
||||
|
||||
/**
|
||||
@@ -143,6 +144,7 @@ int usb_function_activate(struct usb_function *);
|
||||
int usb_interface_id(struct usb_configuration *, struct usb_function *);
|
||||
|
||||
void usb_function_set_enabled(struct usb_function *, int);
|
||||
void usb_composite_force_reset(struct usb_composite_dev *);
|
||||
|
||||
/**
|
||||
* ep_choose - select descriptor endpoint at current device speed
|
||||
@@ -356,6 +358,8 @@ struct usb_composite_dev {
|
||||
spinlock_t lock;
|
||||
|
||||
struct switch_dev sdev;
|
||||
/* used by usb_composite_force_reset to avoid signalling switch changes */
|
||||
bool mute_switch;
|
||||
struct work_struct switch_work;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user