diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2020-12-07 15:42:04 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-15 15:39:20 +0000 |
commit | 4c6709899bc811fa9c07f04f4bb826d7025f19c2 (patch) | |
tree | fd0882990c07a54ee4521ef13fbcb6f79863f56b /common/usb_common.c | |
parent | 0a561def48d4e673c834f4d01506ba8b9886cdd4 (diff) | |
download | chrome-ec-4c6709899bc811fa9c07f04f4bb826d7025f19c2.tar.gz |
tcpci: Base retry count on active PD rev
Retry twice when operating at PD 3.0 and thrice when operating at PD
2.0. Provide a TCPM-agnostic interface to get the number of retries.
BUG=b:173025773,b:173025737
TEST=Pass TD.PD.LL.E3 Soft Reset Usage and TD.PD.LL.E4 Hard Reset Usage
BRANCH=firmware-volteer-13521.B-master
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I422447718f1bfc9a9d4f8ffc5b284723a5332833
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578201
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r-- | common/usb_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c index 3011189ca7..ec28e72bf9 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -303,6 +303,12 @@ __overridable uint8_t board_get_usb_pd_port_count(void) return CONFIG_USB_PD_PORT_MAX_COUNT; } +int pd_get_retry_count(int port, enum tcpm_transmit_type type) +{ + /* PD 3.0 6.7.7: nRetryCount = 2; PD 2.0 6.6.9: nRetryCount = 3 */ + return pd_get_rev(port, type) == PD_REV30 ? 2 : 3; +} + enum pd_drp_next_states drp_auto_toggle_next_state( uint64_t *drp_sink_time, enum pd_power_role power_role, |