usb: mtu3: rebuild role switch flow of extcon
[linux-2.6-microblaze.git] / drivers / usb / mtu3 / mtu3.h
index df28567..daf2b29 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/otg.h>
+#include <linux/usb/role.h>
 
 struct mtu3;
 struct mtu3_ep;
@@ -193,8 +194,8 @@ struct mtu3_gpd_ring {
 * @vbus: vbus 5V used by host mode
 * @edev: external connector used to detect vbus and iddig changes
 * @id_nb : notifier for iddig(idpin) detection
-* @id_work : work of iddig detection notifier
-* @id_event : event of iddig detecion notifier
+* @dr_work : work for drd mode switch, used to avoid sleep in atomic context
+* @desired_role : role desired to switch
 * @role_sw : use USB Role Switch to support dual-role switch, can't use
 *              extcon at the same time, and extcon is deprecated.
 * @role_sw_used : true when the USB Role Switch is used.
@@ -206,8 +207,8 @@ struct otg_switch_mtk {
        struct regulator *vbus;
        struct extcon_dev *edev;
        struct notifier_block id_nb;
-       struct work_struct id_work;
-       unsigned long id_event;
+       struct work_struct dr_work;
+       enum usb_role desired_role;
        struct usb_role_switch *role_sw;
        bool role_sw_used;
        bool is_u3_drd;