summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-06-02 18:35:57 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-03 23:23:26 +0000
commit455950b6da6e999b71f22eceb77675615039ecc6 (patch)
treef745228ae026b2192e2c87c11c1a5a7b04f4269d
parent2ae05ecbf37865d8247f14b1b0942a489b817e60 (diff)
downloadchrome-ec-455950b6da6e999b71f22eceb77675615039ecc6.tar.gz
pd: handle Soft Reset
When receiving a Soft Reset request, handle it as expected: reset our ID counter, send back an Accept message. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make buildall Change-Id: I85d64d0349092b3a773ab6134fec0a1dcac6e284 Reviewed-on: https://chromium-review.googlesource.com/202456 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_protocol.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index eb7804cc7a..179ac828d0 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -555,10 +555,16 @@ static void handle_ctrl_request(void *ctxt, uint16_t head, uint32_t *payload)
#endif /* CONFIG_USB_PD_DUAL_ROLE */
case PD_CTRL_ACCEPT:
break;
+ case PD_CTRL_SOFT_RESET:
+ /* Just reset message counters */
+ pd_message_id = 0;
+ CPRINTF("Soft Reset\n");
+ /* We are done, acknowledge with an Accept packet */
+ send_control(ctxt, PD_CTRL_ACCEPT);
+ break;
case PD_CTRL_PROTOCOL_ERR:
case PD_CTRL_SWAP:
case PD_CTRL_WAIT:
- case PD_CTRL_SOFT_RESET:
default:
CPRINTF("Unhandled ctrl message type %d\n", type);
}