diff options
author | Patryk Duda <pdk@semihalf.com> | 2020-06-18 08:56:45 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-23 01:02:49 +0000 |
commit | 2811551d43dd51c574c0fb98d70df7e82d8cc922 (patch) | |
tree | 2c2c825a22c2e0856639ac84bc6bc67f2af7a57f | |
parent | 3947de4fb5e19da5c2ac816ac2f4916e928a6bd3 (diff) | |
download | chrome-ec-2811551d43dd51c574c0fb98d70df7e82d8cc922.tar.gz |
TCPMv2: Do not call ppc_init() on unavailable USB-C ports
Do not try to initialize PPC on USB-C ports which are not available
in board
BUG=b:154602760
BRANCH=none
TEST=make buildall -j
TEST=Flash casta board.
Make sure that EC RW doesn't report PPC init failures on port 1
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: Ifc931055f1e90b9dc4ae8593d6d8ffa9880ca3f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2250682
Commit-Queue: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | common/usbc/usbc_task.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/usbc/usbc_task.c b/common/usbc/usbc_task.c index 3c3cc59555..34ded5dbd9 100644 --- a/common/usbc/usbc_task.c +++ b/common/usbc/usbc_task.c @@ -160,7 +160,8 @@ void pd_task(void *u) if (IS_ENABLED(CONFIG_USB_TYPEC_SM)) tc_state_init(port); - if (IS_ENABLED(CONFIG_USBC_PPC)) { + if (IS_ENABLED(CONFIG_USBC_PPC) && + port < board_get_usb_pd_port_count()) { /* * Wait to initialize the PPC after tc_state_init(), which sets * the correct Rd values in the TCPC; otherwise the TCPC might |