summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-05-26 18:48:06 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-27 21:30:35 +0000
commit13df9780cb1150a4f5340736bd1861e2d83d55b7 (patch)
treeff3a9cc1f75ab1d0f7bec409aebb18dade79499b
parentdc065dcb318fcdb2683eac76326d4e6dca94139d (diff)
downloadchrome-ec-13df9780cb1150a4f5340736bd1861e2d83d55b7.tar.gz
pd: avoid re-sending discovery VDMs after power swap
Avoid re-sending discovery VDMs after power swap from source to sink. BUG=chrome-os-partner:40657 BRANCH=samus TEST=tested connecting samus to samus. tested power swapping back and forth and verify that we don't re-send discovery VDMs. Tested soft reset and verified that we don't re-send discovery VDMs. Tested hard reset and verified that we DO re-send discovery VDMs. Change-Id: Ib48c134f460eb776b7c6f5c1d86a5b56bb08ebcc Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273420 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_protocol.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 35bb7c0dc6..470287c65d 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1855,8 +1855,13 @@ void pd_task(void)
typec_set_input_current_limit(
port, typec_curr, TYPE_C_VOLTAGE);
#endif
+ /*
+ * fake set data role swapped flag so we send
+ * discover identity when we enter SRC_READY
+ */
pd[port].flags |= PD_FLAGS_CHECK_PR_ROLE |
- PD_FLAGS_CHECK_DR_ROLE;
+ PD_FLAGS_CHECK_DR_ROLE |
+ PD_FLAGS_DATA_SWAPPED;
set_state(port, PD_STATE_SNK_DISCOVERY);
timeout = 10*MSEC;
hook_call_deferred(
@@ -1918,12 +1923,6 @@ void pd_task(void)
if ((pd[port].last_state != pd[port].task_state)
&& pd_comm_enabled) {
/*
- * fake set data role swapped flag so we send
- * discover identity when we enter SRC_READY
- */
- pd[port].flags |= PD_FLAGS_DATA_SWAPPED;
-
- /*
* If we haven't passed hard reset counter,
* start SinkWaitCapTimer, otherwise start
* NoResponseTimer.