dwc3-msm: Fix lpm not entering issue during mode switch

On some platforms, one GPIO might be used to switch between host
and peripheral modes. In this case, extcon notifications will get
called for ID status change and VBUS status change without delay for
mode switch like host->peripheral or peripheral to host mode. If
VBUS notification is received before USB host mode is stopped, there
is a chance that suspend routine aborted due to incorect check even
though state machine is not in B_PERIPHERAL or B_SUSPEND state. This
results in USB enumeration not working in device mode. For USB
enumeration to work, USB has to enter low power mode between mode
switch, else USB will not work. Fix it by checking otg state for B_SUSPEND
or B_PERIPHERAL as well to figure out any pending remote wakeup event.

Change-Id: I9c0e2873e6cff5683d7b9a3d0fc833eb8088fa7c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
1 file changed