usb: dwc3-msm: Fix check for device suspend
The check in dwc3_msm_suspend() for whether the controller is
in peripheral mode only looks at the charger type being either
SDP or CDP. However, that does not accommodate if the charger
type is unknown, or if SDP/CDP are erroneously detected during
host mode, in which case the device LPM sequence would wrongly
get performed. Instead, check if the OTG state is B_PERIPHERAL.
Also move the checks for pending gadget interrupts and BAM LPM
status under this condition since they're unneeded for host mode.
Change-Id: I7f7be50f3392f6e6b0ccbefc83cd59b3f85a01e2
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment