Skip to content

Commit

Permalink
Revert "usb/dwc2: Set correct state on gadget disconnect"
Browse files Browse the repository at this point in the history
This reverts commit c397485.

See: #3885

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell authored and popcornmix committed Nov 4, 2020
1 parent a787b86 commit fda5788
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/usb/dwc2/core_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,14 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
__func__);
}
skip_power_saving:
/* Raspberry Pi seems to call the suspend interrupt on gadget disconnect, so instead of setting state to suspend set to not attached */

hsotg->lx_state = DWC2_L3;
/*
* Change to L2 (suspend) state before releasing
* spinlock
*/
hsotg->lx_state = DWC2_L2;

usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
/* Call gadget suspend callback */
call_gadget(hsotg, suspend);
}
} else {
if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) {
Expand Down

0 comments on commit fda5788

Please sign in to comment.