summaryrefslogtreecommitdiff
path: root/common/usb_pd_tcpc.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-10-13 08:24:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-13 19:43:01 -0700
commit2e1ec23353c758a7553c86bfd224b3364f6504a6 (patch)
treec1e3e26f84edba743d3177d8067436895a96e423 /common/usb_pd_tcpc.c
parent35ed69cde8346714bf58cd8deac42f76f3951b6b (diff)
downloadchrome-ec-2e1ec23353c758a7553c86bfd224b3364f6504a6.tar.gz
tcpc: Don't retry sending of source caps
TCPM will retry sending of source caps on failure and retrying in TCPC will cause us to violate PD_T_SEND_SOURCE_CAP. BUG=None TEST=Attach servo_v4 to twinkie, verify source caps are sent in ~100ms intervals and not in bursts of four. BRANCH=servo_v4 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I3264e5578afbde7b9d2c003b6744974329a253d4 Reviewed-on: https://chromium-review.googlesource.com/719729 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_pd_tcpc.c')
-rw-r--r--common/usb_pd_tcpc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c
index 99e3470e18..a540d6f67f 100644
--- a/common/usb_pd_tcpc.c
+++ b/common/usb_pd_tcpc.c
@@ -362,9 +362,11 @@ static int send_validate_message(int port, uint16_t header,
static uint32_t payload[7];
uint8_t expected_msg_id = PD_HEADER_ID(header);
uint8_t cnt = PD_HEADER_CNT(header);
+ int retries = PD_HEADER_TYPE(header) == PD_DATA_SOURCE_CAP ?
+ 0 : PD_RETRY_COUNT;
/* retry 3 times if we are not getting a valid answer */
- for (r = 0; r <= PD_RETRY_COUNT; r++) {
+ for (r = 0; r <= retries; r++) {
int bit_len, head;
/* write the encoded packet in the transmission buffer */
bit_len = prepare_message(port, header, cnt, data);