mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
dwc3: gadget: Add handling of bus resume and L1 resume functionality
Dwc3 controller raises wakeup interrupt when there is USB bus resume or L1 resume initiated by connected host. This change checks link_state to confirm that previous state was U3 (USB bus or L1 suspend) and resume USB bus if previously it was suspended. Change-Id: Ic71aecc493b130e2ea16fc3c70b826f588fe10c8 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
218848f9ed
commit
0cb486de21
1 changed files with 12 additions and 10 deletions
|
|
@ -3401,18 +3401,20 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
|
|||
|
||||
static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc)
|
||||
{
|
||||
dbg_event(0xFF, "WAKEUP", 0);
|
||||
enum dwc3_link_state link_state = dwc->link_state;
|
||||
|
||||
/*
|
||||
* TODO take core out of low power mode when that's
|
||||
* implemented.
|
||||
*/
|
||||
dbg_log_string("WAKEUP: link_state:%d", link_state);
|
||||
dwc->link_state = DWC3_LINK_STATE_U0;
|
||||
|
||||
if (dwc->gadget_driver && dwc->gadget_driver->resume) {
|
||||
spin_unlock(&dwc->lock);
|
||||
dwc->gadget_driver->resume(&dwc->gadget);
|
||||
spin_lock(&dwc->lock);
|
||||
}
|
||||
/* For L1 resume case, don't perform resume */
|
||||
if (link_state != DWC3_LINK_STATE_U3)
|
||||
return;
|
||||
|
||||
/* Handle bus resume case */
|
||||
dbg_event(0xFF, "notify", 0);
|
||||
dwc->b_suspend = false;
|
||||
dwc3_notify_event(dwc, DWC3_CONTROLLER_NOTIFY_OTG_EVENT, 0);
|
||||
dwc3_resume_gadget(dwc);
|
||||
}
|
||||
|
||||
static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
|
||||
|
|
|
|||
Loading…
Reference in a new issue