USB: msm_otg: Acknowledge PMIC BSV events, if ID is set

Currently not all the PMIC BSV events are handled due to check
that was introduced for handling spurious interrupts in Host Mode.
Rather than checking the OTG state as apart of these spurious interrupts
which gets updated in workqueue context, check for ID state and return
only, if ID is clear. This will fix all the corner cases and race
conditions as part of handling ACA use cases as well.

CRs-Fixed: 411036
Change-Id: I942b4cf2a71dcdc1fcde785da04fd2b3e1560a6c
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index 92cbe6f..d10c692 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -3068,10 +3068,9 @@
 {
 	static bool init;
 	struct msm_otg *motg = the_msm_otg;
-	struct usb_otg *otg = motg->phy.otg;
 
-	/* In A Host Mode, ignore received BSV interrupts */
-	if (otg->phy->state >= OTG_STATE_A_IDLE)
+	/* Ignore received BSV interrupts, if ID pin is GND */
+	if (!test_bit(ID, &motg->inputs))
 		return;
 
 	if (online) {