diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2015-01-20 11:48:23 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-21 05:05:53 +0000 |
commit | 9e07dfb6cb7391844dfd56ba856b30329318f05e (patch) | |
tree | e8f77f7bd8b17ad8c810a41fc1b919e9f22d3ebe /util | |
parent | 43806f07e35de0ab9b27774e2f27841a78a2c527 (diff) | |
download | chrome-ec-9e07dfb6cb7391844dfd56ba856b30329318f05e.tar.gz |
pd: export the data role to the AP
For dual-role USB ports (host/device), let the AP know whether we are
currently DFP (USB host) or UFP (USB device) by exporting the data role
in addition to the power role in the EC_CMD_USB_PD_CONTROL response.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=samus
BUG=none
TEST=ectool --name=cros_pd usbpd 0
plug various accessories on the port and see properly "SRC DFP" for the
USB key, "SNK DFP" for the power supply and "SNK UFP" for a regular
C-to-A charging cable.
Change-Id: I292da15fa8cf3566109dd05995ef1d00bed6f92d
Reviewed-on: https://chromium-review.googlesource.com/242012
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/ectool.c b/util/ectool.c index 2062ac7888..52b9eedf31 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -3136,9 +3136,10 @@ int cmd_usb_pd(int argc, char *argv[]) r->role == PD_ROLE_SOURCE ? "SRC" : "SNK", r->polarity + 1, r->state); } else { - printf("Port C%d is %sabled, Role:%s Polarity:CC%d State:%s\n", - p.port, (r_v1->enabled) ? "en" : "dis", - r_v1->role == PD_ROLE_SOURCE ? "SRC" : "SNK", + printf("Port C%d is %s, Role:%s %s Polarity:CC%d State:%s\n", + p.port, (r_v1->enabled) ? "enabled" : "disabled", + r_v1->role & PD_ROLE_SOURCE ? "SRC" : "SNK", + r_v1->role & (PD_ROLE_DFP << 1) ? "DFP" : "UFP", r_v1->polarity + 1, r_v1->state); } return (rv < 0 ? rv : 0); |