@@ -16,7 +16,7 @@ diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
1616index 111111111111..222222222222 100644
1717--- a/drivers/usb/dwc3/core.c
1818+++ b/drivers/usb/dwc3/core.c
19- @@ -152 ,7 +152 ,7 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy)
19+ @@ -153 ,7 +153 ,7 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy)
2020 }
2121
2222 reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
@@ -25,15 +25,15 @@ index 111111111111..222222222222 100644
2525 dwc3_writel(dwc->regs, DWC3_GCTL, reg);
2626
2727 dwc->current_dr_role = mode;
28- @@ -192 ,6 +192 ,7 @@ static void __dwc3_set_mode(struct work_struct *work)
28+ @@ -193 ,6 +193 ,7 @@ static void __dwc3_set_mode(struct work_struct *work)
2929 dwc3_host_exit(dwc);
3030 break;
3131 case DWC3_GCTL_PRTCAP_DEVICE:
3232+ case DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED:
3333 dwc3_gadget_exit(dwc);
3434 dwc3_event_buffers_cleanup(dwc);
3535 break;
36- @@ -211 ,12 +212 ,43 @@ static void __dwc3_set_mode(struct work_struct *work)
36+ @@ -212 ,12 +213 ,43 @@ static void __dwc3_set_mode(struct work_struct *work)
3737 * Only perform GCTL.CoreSoftReset when there's DRD role switching.
3838 */
3939 if (dwc->current_dr_role && ((DWC3_IP_IS(DWC3) ||
@@ -78,15 +78,15 @@ index 111111111111..222222222222 100644
7878 /*
7979 * Wait for internal clocks to synchronized. DWC_usb31 and
8080 * DWC_usb32 may need at least 50ms (less for DWC_usb3). To
81- @@ -258 ,6 +290 ,7 @@ static void __dwc3_set_mode(struct work_struct *work)
81+ @@ -259 ,6 +291 ,7 @@ static void __dwc3_set_mode(struct work_struct *work)
8282 }
8383 break;
8484 case DWC3_GCTL_PRTCAP_DEVICE:
8585+ case DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED:
8686 dwc3_core_soft_reset(dwc);
8787
8888 dwc3_event_buffers_setup(dwc);
89- @@ -1845 ,6 +1878 ,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
89+ @@ -1846 ,6 +1879 ,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
9090
9191 dwc->dis_split_quirk = device_property_read_bool(dev,
9292 "snps,dis-split-quirk");
@@ -95,15 +95,15 @@ index 111111111111..222222222222 100644
9595
9696 dwc->lpm_nyet_threshold = lpm_nyet_threshold;
9797 dwc->tx_de_emphasis = tx_de_emphasis;
98- @@ -2441 ,6 +2476 ,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
98+ @@ -2442 ,6 +2477 ,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
9999
100100 switch (dwc->current_dr_role) {
101101 case DWC3_GCTL_PRTCAP_DEVICE:
102102+ case DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED:
103103 if (pm_runtime_suspended(dwc->dev))
104104 break;
105105 ret = dwc3_gadget_suspend(dwc);
106- @@ -2505 ,11 +2541 ,12 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
106+ @@ -2506 ,11 +2542 ,12 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
107107
108108 switch (dwc->current_dr_role) {
109109 case DWC3_GCTL_PRTCAP_DEVICE:
@@ -117,23 +117,23 @@ index 111111111111..222222222222 100644
117117 dwc3_gadget_resume(dwc);
118118 break;
119119 case DWC3_GCTL_PRTCAP_HOST:
120- @@ -2573 ,6 +2610 ,7 @@ static int dwc3_runtime_checks(struct dwc3 *dwc)
120+ @@ -2574 ,6 +2611 ,7 @@ static int dwc3_runtime_checks(struct dwc3 *dwc)
121121 {
122122 switch (dwc->current_dr_role) {
123123 case DWC3_GCTL_PRTCAP_DEVICE:
124124+ case DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED:
125125 if (dwc->connected)
126126 return -EBUSY;
127127 break;
128- @@ -2611 ,6 +2649 ,7 @@ int dwc3_runtime_resume(struct dwc3 *dwc)
128+ @@ -2612 ,6 +2650 ,7 @@ int dwc3_runtime_resume(struct dwc3 *dwc)
129129
130130 switch (dwc->current_dr_role) {
131131 case DWC3_GCTL_PRTCAP_DEVICE:
132132+ case DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED:
133133 if (dwc->pending_events) {
134134 pm_runtime_put(dev);
135135 dwc->pending_events = false;
136- @@ -2635 ,6 +2674 ,7 @@ int dwc3_runtime_idle(struct dwc3 *dwc)
136+ @@ -2636 ,6 +2675 ,7 @@ int dwc3_runtime_idle(struct dwc3 *dwc)
137137
138138 switch (dwc->current_dr_role) {
139139 case DWC3_GCTL_PRTCAP_DEVICE:
0 commit comments