USB: gadget: composite: Use separate switches for connected and config state
Also remove disconnect debouncing, which didn't actually work on some platforms
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 37352fc..106c69c 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -373,9 +373,13 @@
/* protects deactivations and delayed_status counts*/
spinlock_t lock;
- struct switch_dev sdev;
- /* used by usb_composite_force_reset to avoid signalling switch changes */
- bool mute_switch;
+ /* switch indicating connected/disconnected state */
+ struct switch_dev sw_connected;
+ /* switch indicating current configuration */
+ struct switch_dev sw_config;
+ /* current connected state for sw_connected */
+ bool connected;
+
struct work_struct switch_work;
};