summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-04-30 09:32:31 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-03 21:28:00 -0700
commitd0d1ea3d46faa5c1141157fe9ef27967aafe85e0 (patch)
tree99462521b70360f8e48628b0e87de9e20e208e43 /include/usb_pd.h
parentbe54bb9a9c2be4ab926f7ca9bd4fe7303aea5c98 (diff)
downloadchrome-ec-d0d1ea3d46faa5c1141157fe9ef27967aafe85e0.tar.gz
usb_pd_protocol: Add PD_ROLE_DISCONNECTED for data role swaps
Add a state to indicate that a data role is actually disconnected and notify the board-level data swap function with this state when a cable is unplugged. This allows the board to clean up and restore any state that may have been set up with a data role swap. BUG=b:78308749 BRANCH=eve,poppy TEST=manual on eve: plug in C-to-C cable, execute data swap on port 0 with 'pd 0 swap data' and ensure the OTG pins are asserted. Then unplug the cable and ensure OTG pins are now deasserted. Change-Id: I7d8fff22dd5836b4b5af54f0ede71ee1b6e40b5c Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/1035423 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index acad78fb42..7cdc79c198 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -871,8 +871,9 @@ enum pd_data_msg_type {
#define PD_ROLE_SINK 0
#define PD_ROLE_SOURCE 1
/* Data role */
-#define PD_ROLE_UFP 0
-#define PD_ROLE_DFP 1
+#define PD_ROLE_UFP 0
+#define PD_ROLE_DFP 1
+#define PD_ROLE_DISCONNECTED 2
/* Vconn role */
#define PD_ROLE_VCONN_OFF 0
#define PD_ROLE_VCONN_ON 1