From 726bf157546a62819d2cc9831145f3eae6b64aa9 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Fri, 29 May 2020 14:29:11 +1000 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2227770 Reviewed-by: Aseda Aboagye Reviewed-by: Andrew McRae --- driver/tcpm/tcpci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'driver/tcpm/tcpci.c') 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); -- cgit v1.2.1