summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-01-02 14:12:26 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-03 02:26:45 +0000
commit1f55eea80994538350588eb27dce0ee791144e2e (patch)
tree3d6929becd46414fa9fe792dd2260364e33b80c0
parent71fb0f9e11d3d1b4a7b2026994f2003815dd2799 (diff)
downloadchrome-ec-1f55eea80994538350588eb27dce0ee791144e2e.tar.gz
pd: On invalid request, send reject and go to SRC_READY
When a source gets an invalid request, send reject, but still go to SRC_READY state and keep the old power contract in place. BUG=chrome-os-partner:34987 BRANCH=samus TEST=load onto zinger. on samus add custom code to always send an invalid request. note that zinger still transitions to SRC_READY, samus still transitions to SNK_READY, data swap is still performed, discover identity is still performed, and samus still draws 5V/3A. Change-Id: I1213688f2b205636b3657afb1a4d8f7929bfe7ee Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/238250 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_protocol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index dae4ae789f..124b9f9bc2 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -926,6 +926,8 @@ static void handle_data_request(int port, uint16_t head,
}
/* the message was incorrect or cannot be satisfied */
send_control(port, PD_CTRL_REJECT);
+ /* keep last contract in place (whether implicit or explicit) */
+ set_state(port, PD_STATE_SRC_READY);
break;
case PD_DATA_BIST:
/* currently only support sending bist carrier mode 2 */
@@ -1714,6 +1716,7 @@ void pd_task(void)
* discover identity when we enter SRC_READY
*/
pd[port].flags |= PD_FLAGS_DATA_SWAPPED;
+ pd[port].flags |= PD_FLAGS_NEW_CONTRACT;
/* reset various counters */
caps_count = 0;
src_connected = 0;