summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2014-12-14 14:19:33 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-07 08:45:34 +0000
commitc0f64b13e981fd0c2901e1c33d7f6e52287ca0df (patch)
tree6521f942c2a993d24266e5a12cd71d816ec5fc0b /include/usb_pd.h
parentfaf09e290519569fa1b9d7ac27035606afcb08d6 (diff)
downloadchrome-ec-c0f64b13e981fd0c2901e1c33d7f6e52287ca0df.tar.gz
pd: vdm: Add VDM related timeouts and busy response handling.
Initial VDM implementation had a very conservative 500msec timeout period. This CL adds the timeouts defined in the USB-PD specification for various commands. Additionally it adds a state to the vdm state machine to allow proper busy response handling. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:30645 TEST=manual, Alternate mode and flashing still work. Creating a VDM responder which returns busy shows retries from initiator after at least 100msec. Change-Id: I79f5da557ca9faf63d2299bb77009f6d98a782bd Reviewed-on: https://chromium-review.googlesource.com/235682 Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 4a89e7d220..b1d72d1402 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -139,6 +139,13 @@ enum pd_errors {
/* from USB Type-C Specification Table 5-1 */
#define PD_T_AME (1*SECOND) /* timeout from UFP attach to Alt Mode Entry */
+/* VDM Timers ( USB PD Spec Rev2.0 Table 6-30 )*/
+#define PD_T_VDM_BUSY (100*MSEC) /* at least 100ms */
+#define PD_T_VDM_E_MODE (25*MSEC) /* enter/exit the same max */
+#define PD_T_VDM_RCVR_RSP (15*MSEC) /* max of 15ms */
+#define PD_T_VDM_SNDR_RSP (30*MSEC) /* max of 30ms */
+#define PD_T_VDM_WAIT_MODE_E (100*MSEC) /* enter/exit the same max */
+
/* function table for entered mode */
struct amode_fx {
int (*status)(int port, uint32_t *payload);