summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-01-30 11:06:12 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-14 02:26:25 +0000
commit1053611f0a319dae5aea5ac8452d04ca57376987 (patch)
tree864ce77016e71f06fb0e326bf5b0f4c117b2838a /driver
parent456412ee39b6ce107ebef65d8782b0469a0f6de5 (diff)
downloadchrome-ec-1053611f0a319dae5aea5ac8452d04ca57376987.tar.gz
tcpci: Handle alerts in tcpci_tcpm_init()
tcpci_tcpm_init() was clearing all alerts without handling them. The nct38xx is combined TCPC and IO expander. IO expander interrupts (IOEX_INT) rely on TCPC_REG_ALERT_VENDOR_DEF. This alert was being lost because tcpci_tcpm_init() was clearing it when we came out of low power mode in response to the alert interrupt from the TCPC. BUG=b:146468190 BRANCH=none TEST=IOEX_INT works with TCPC exiting low power mode TEST=Init, source, sink, low power all still work with ANX3429, ANX7447, PS8751, NCT3807 TCPCs Change-Id: I8ea4907ff621c4f39284a400fc40f2a20bf3ce91 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2031650 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/tcpci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 85579428ba..0ada2111ee 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -1094,7 +1094,11 @@ int tcpci_tcpm_init(int port)
CPRINTS("C%d: Failed to init TCPC_CTRL!", port);
}
- tcpc_write16(port, TCPC_REG_ALERT, 0xffff);
+ /*
+ * Handle and clear any alerts, since we might be coming out of low
+ * power mode in response to an alert interrupt from the TCPC.
+ */
+ tcpc_alert(port);
/* Initialize power_status_mask */
init_power_status_mask(port);
/* Update VBUS status */