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>
This commit is contained in:
Alec Berg
2015-01-02 14:12:26 -08:00
committed by ChromeOS Commit Bot
parent 71fb0f9e11
commit 1f55eea809

View File

@@ -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;