diff options
author | Scott <scollyer@chromium.org> | 2017-03-09 14:26:48 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-26 02:15:54 -0700 |
commit | a240040cbf59c743d762b2c6a2eae1421840a66e (patch) | |
tree | 57db3bd03a672ffba2b8e7bd4220cb6dab1368d0 /board/servo_v4 | |
parent | 850e9e4ac0f84217b7fbc182b23821047e203307 (diff) | |
download | chrome-ec-a240040cbf59c743d762b2c6a2eae1421840a66e.tar.gz |
servo_v4: Set desired data role for DUT port to UFP
The default for servo_v4 DUT port is to be SRC to charge the DUT, but
a UFP data role so that the DUT's usb mux gets connected.
BUG=b:35586526
BRANCH=servo
TEST=Connect to Electro and verify that servo_v4 data role is that of
UFP and that electro is getting an IP address from the enet port on
servo_v4.
Change-Id: I8f2e4242777bf879598852004096f683d68c091c
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452725
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/servo_v4')
-rw-r--r-- | board/servo_v4/usb_pd_policy.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index b6c395a860..3268b343fd 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -326,10 +326,11 @@ int pd_board_checks(void) int pd_check_power_swap(int port) { /* - * TODO(crosbug.com/p/60792): CHG port can't do a power swap as it's SNK - * only. Don't allow DUT port to accept a power role swap request. More - * support still needs to be added so that servo_v4 DUT port behaves - * properly when acting as a SNK device. + * When only host VBUS is available, then servo_v4 is not setting + * PDO_FIXED_EXTERNAL in the src_pdo sent to the DUT. When this bit is + * not set, the DUT will always attempt to swap its power role to + * SRC. Let servo_v4 have more control over its power role by always + * rejecting power swap requests from the DUT. */ return 0; } @@ -357,12 +358,12 @@ void pd_check_pr_role(int port, int pr_role, int flags) void pd_check_dr_role(int port, int dr_role, int flags) { - /* - * TODO(crosbug.com/p/60792): CHG port is SNK only and should not need - * to change from default UFP role. DUT port behavior needs to be - * flushed out. Don't request any data role change for either port for - * now. - */ + if (port == CHG) + return; + + /* If DFP, try to switch to UFP */ + if ((flags & PD_FLAGS_PARTNER_DR_DATA) && dr_role == PD_ROLE_DFP) + pd_request_data_swap(port); } |