summaryrefslogtreecommitdiff
path: root/driver/tcpm/tcpci.c
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2020-05-29 14:29:11 +1000
committerCommit Bot <commit-bot@chromium.org>2020-06-03 07:35:18 +0000
commit726bf157546a62819d2cc9831145f3eae6b64aa9 (patch)
tree1c898be786102b55b93662d7a099decc854fd1d3 /driver/tcpm/tcpci.c
parent5124d453200ce13dfd8badfcd2c56e57334df2df (diff)
downloadchrome-ec-726bf157546a62819d2cc9831145f3eae6b64aa9.tar.gz
TCPCI: acknowledge extended alerts
TCPCI alerts were cleared when handled, but not for alerts flagged in the ALERT_EXTENDED register. Clear the extended alerts first, then ALERT as specified in TCPCI specification rev 2.0 v1.0 section 4.4.7. BUG=b:146393213 TEST=trembyle now clears ALERT_EXTENDED when servicing FRS alerts BRANCH=None Change-Id: I7b45e415048ebcb7227d9f5c7f012ca8288dceac Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2227770 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Andrew McRae <amcrae@chromium.org>
Diffstat (limited to 'driver/tcpm/tcpci.c')
-rw-r--r--driver/tcpm/tcpci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 7f98c83f3f..5bfeb52f12 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -1225,7 +1225,12 @@ void tcpci_tcpc_alert(int port)
}
}
- /* Clear all pending alert bits */
+ /*
+ * Clear all pending alert bits. Ext first because ALERT.AlertExtended
+ * is set if any bit of ALERT_EXTENDED is set.
+ */
+ if (alert_ext)
+ tcpc_write(port, TCPC_REG_ALERT_EXT, alert_ext);
if (alert)
tcpc_write16(port, TCPC_REG_ALERT, alert);