USB: OTG: msm: Fix bug in wall charger disconnect detection

PHY retention and HV interrupts are not enabled while entering into low
power mode with wall charger connected.  But PHY is put into suspend mode.
If PMIC notifications are unavailable, enable asynchronous interrupt to
detect wall charger disconnection. If it is not enabled, no further
interrupts are triggered by PHY.

CRs-fixed: 352210
Change-Id: I107e1c91a29d65594a603a5651cd0bfe5b792bcc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index 7aa0430..7830e29 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -839,9 +839,15 @@
 	 * line must be disabled till async interrupt enable bit is cleared
 	 * in USBCMD register. Assert STP (ULPI interface STOP signal) to
 	 * block data communication from PHY.
+	 *
+	 * PHY retention mode is disallowed while entering to LPM with wall
+	 * charger connected.  But PHY is put into suspend mode. Hence
+	 * enable asynchronous interrupt to detect charger disconnection when
+	 * PMIC notifications are unavailable.
 	 */
 	cmd_val = readl_relaxed(USB_USBCMD);
-	if (host_bus_suspend)
+	if (host_bus_suspend || (motg->pdata->otg_control == OTG_PHY_CONTROL &&
+				dcp))
 		cmd_val |= ASYNC_INTR_CTRL | ULPI_STP_CTRL;
 	else
 		cmd_val |= ULPI_STP_CTRL;