usb: dwc3: request 2mA VBUS current when suspending

In case a SUSPEND (L2 or U3) event is detected but the device is
not yet enumerated/configured, the device must still follow USB
power rules and limit its current draw to ISUSP (2.5mA). Notify
the gadget when this happens, which in turn will notify the
charger driver.

Change-Id: I10d890aabd78d841027b370eb62005d2e35e2a38
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
Jack Pham 2018-11-02 17:46:17 -07:00
commit 2d5b401286

View file

@ -3472,6 +3472,8 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
if (dwc->gadget.state >= USB_STATE_CONFIGURED)
dwc3_gadget_suspend_interrupt(dwc,
event->event_info);
else
usb_gadget_vbus_draw(&dwc->gadget, 2);
}
break;
case DWC3_DEVICE_EVENT_SOF: