BZ: 35035
1. As irq isn't disabled when suspended (if does so, wakeup interrupt maybe
missed), irq should be disabled in penwell_otg_resume_noirq. Otherwise,
irq may happen before penwell_otg_resume is called, this causes
unconsistent state regarding to that before suspending.
2. move the hsm update from penwell_otg_resume_noirq to
penwell_otg_resume
Change-Id: I38c510b77b4cdd9f29fdbd52d71057b4a8ef0187
Signed-off-by: jzhuan5 <jin.can.zhuang@intel.com>
Reviewed-on: http://android.intel.com:8080/47818
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
break;
}
- update_hsm();
- penwell_update_transceiver();
+ /* We didn't disable otgsc interrupt, to prevent intr from happening
+ * before penwell_otg_resume, intr is disabled here, and can be enabled
+ * by penwell_otg_resume
+ */
+ penwell_otg_intr(0);
dev_dbg(pnw->dev, "%s <---\n", __func__);
return ret;
pnw->queue_stop = 0;
spin_unlock(&pnw->notify_lock);
+ penwell_otg_intr(1);
+
+ /* If a plugging in or pluggout event happens during D3,
+ * we will miss the interrupt, so check OTGSC here to check
+ * if any ID change and update hsm correspondingly
+ */
+ update_hsm();
+ penwell_update_transceiver();
+
dev_dbg(pnw->dev, "%s <---\n", __func__);
return ret;
}