summaryrefslogtreecommitdiff
path: root/chip/it83xx/intc.c
diff options
context:
space:
mode:
authorRuibin Chang <Ruibin.Chang@ite.com.tw>2018-12-17 18:16:29 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-18 00:43:03 -0800
commitc7d12adf74c22a1ef538ce9d7faac1a0d7c7ab66 (patch)
tree31504efe882b55984dad7d9429c21e437da8d291 /chip/it83xx/intc.c
parentf0998e9a4bbd7f77c9574f9e27e7e8b8bcc65a18 (diff)
downloadchrome-ec-c7d12adf74c22a1ef538ce9d7faac1a0d7c7ab66.tar.gz
it83xx/intc:add type-c plug in interrupt
When tcpc detect type-c plug in (cc lines voltage change), it will interrupt fw to wake pd task, so task can react immediately. BRANCH=None BUG=None TEST=GRL USBPD test Change-Id: I194b2fcad1d0c62dde2d3296753abd47af8feea6 Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1333207 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/it83xx/intc.c')
-rw-r--r--chip/it83xx/intc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/chip/it83xx/intc.c b/chip/it83xx/intc.c
index 36a6029f9c..79d738e93c 100644
--- a/chip/it83xx/intc.c
+++ b/chip/it83xx/intc.c
@@ -81,6 +81,28 @@ static void chip_pd_irq(enum usbpd_port port)
task_set_event(PD_PORT_TO_TASK_ID(port),
TASK_EVENT_PHY_TX_DONE, 0);
}
+#ifdef IT83XX_INTC_PLUG_IN_SUPPORT
+ if (USBPD_IS_PLUG_IN_OUT_DETECT(port)) {
+ /*
+ * When tcpc detect type-c plug in, then disable
+ * this interrupt. Because any cc volt changes
+ * (include pd negotiation) would trigger plug in
+ * interrupt, frequently plug in interrupt and wakeup
+ * pd task may cause task starvation or device dead
+ * (ex.transmit lots SRC_Cap).
+ *
+ * When polling disconnect will enable detect type-c
+ * plug in again.
+ *
+ * Clear detect type-c plug in interrupt status.
+ */
+ IT83XX_USBPD_TCDCR(port) |=
+ (USBPD_REG_PLUG_IN_OUT_DETECT_DISABLE |
+ USBPD_REG_PLUG_IN_OUT_DETECT_STAT);
+ task_set_event(PD_PORT_TO_TASK_ID(port),
+ PD_EVENT_CC, 0);
+ }
+#endif //IT83XX_INTC_PLUG_IN_SUPPORT
}
}
#endif