msm_otg: Fix LPM issue on removing Host cable
Device is not entering into LPM on removing Host Cable.
msm_otg_suspend is aborted due to inputs bit is set with
A_BUS_REQ which is check before going ahead and preparing
device for clock OFF and LPM state.
A_BUS_REQ is being set from msm_otg_set_suspend() called
from ehci runtime resume when removing Micro A cable.
Fix side effect of commit 572092fed ("USB: msm_otg: Always
update state machine inputs during bus suspend/resume") by
clearing A_BUS_REQ bit with inputs when removing charger
work from OTG_STATE_B_IDLE.
CRs-Fixed: 444160
Change-Id: I5325d2965ecc754ff54b297047603acda5801aae
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index 067f579..78f17f4 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -2365,6 +2365,7 @@
break;
} else {
pr_debug("chg_work cancel");
+ clear_bit(A_BUS_REQ, &motg->inputs);
cancel_delayed_work_sync(&motg->chg_work);
cancel_delayed_work_sync(&motg->check_ta_work);
motg->chg_state = USB_CHG_STATE_UNDEFINED;