summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuibin Chang <Ruibin.Chang@ite.com.tw>2018-08-29 15:32:31 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-30 09:53:08 -0700
commit86f901f741c9730135daf96cae94f9d667b42971 (patch)
tree8166feb93b2c9337a49f14b9fb59ad4d30b1b67c
parent1808ad059f7504f28c84b584d0e7a5affbbaaef3 (diff)
downloadchrome-ec-86f901f741c9730135daf96cae94f9d667b42971.tar.gz
common:pd: reset CapCnt variable
CapCnt variable will be reset in PD_STATE_SRC_STARTUP, PD_STATE_SRC_DISCOVERY and PD_STATE_SNK_SWAP_COMPLETE states which are according to PD3.0 spec. With this modify in order to protect against future changes that allow other code path that don't clear the variables first. BUG=none BRANCH=none TEST=make buildall -j. Change-Id: Ic2a249aff4410043ab18dd645aa1485ece9f63ca Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1195169 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--common/usb_pd_protocol.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index c0dc2be3d0..c4bcb2eae7 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2830,6 +2830,7 @@ void pd_task(void *u)
break;
case PD_STATE_SRC_DISCOVERY:
if (pd[port].last_state != pd[port].task_state) {
+ caps_count = 0;
/*
* If we have had PD connection with this port
* partner, then start NoResponseTimer.