diff options
author | Todd Broch <tbroch@chromium.org> | 2017-02-17 18:57:20 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-05-08 21:39:37 +0000 |
commit | 473a8ed673bcd33d78d2a86db0518be445c3b61d (patch) | |
tree | dc370e909c99d53a4a6660e1dadca5ee669fa06a | |
parent | 1e7f22e5e65eab1471d0b91f3a3f1fe341cb9d3c (diff) | |
download | chrome-ec-473a8ed673bcd33d78d2a86db0518be445c3b61d.tar.gz |
pd: prefer CD pin assignments over EF for USBC->USBC case.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus,glados,oak,gru,reef
BUG=chromium:694597
TEST=manual, connect samus to USB-C monitor via cable and see it
select pin assigmnent 'C'
Original-Change-Id: Iddad5b654715bd30ba081c62f8fb53e07816498c
Originally-Reviewed-on: https://chromium-review.googlesource.com/465379
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit a8e6b070cbd107d8c2f44f44ae8231a4f4efea90)
Change-Id: I70ed304b7941f9a49582e8f82122b9f15f396ef6
Reviewed-on: https://chromium-review.googlesource.com/494074
Tested-by: Todd Broch <tbroch@chromium.org>
Trybot-Ready: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | common/usb_pd_policy.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 90df5eda38..d4d35447db 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -450,8 +450,8 @@ static void dfp_consume_attention(int port, uint32_t *payload) } /* - * This algorithm defaults to choosing higher pin config over lower ones. Pin - * configs are organized in pairs with the following breakdown. + * This algorithm defaults to choosing higher pin config over lower ones in + * order to prefer multi-function if desired. * * NAME | SIGNALING | OUTPUT TYPE | MULTI-FUNCTION | PIN CONFIG * ------------------------------------------------------------- @@ -465,9 +465,8 @@ static void dfp_consume_attention(int port, uint32_t *payload) * if UFP has NOT asserted multi-function preferred code masks away B/D/F * leaving only A/C/E. For single-output dongles that should leave only one * possible pin config depending on whether its a converter DP->(VGA|HDMI) or DP - * output. If someone creates a multi-output dongle presumably they would need - * to either offer different mode capabilities depending upon connection type or - * the DFP would need additional system policy to expose those options. + * output. If UFP is a USB-C receptacle it may assert C/D/E/F. The DFP USB-C + * receptacle must always choose C/D in those cases. */ int pd_dfp_dp_get_pin_mode(int port, uint32_t status) { @@ -489,6 +488,10 @@ int pd_dfp_dp_get_pin_mode(int port, uint32_t status) /* TODO(crosbug.com/p/39656) revisit if DFP drives USB Gen 2 signals */ pin_caps &= ~MODE_DP_PIN_BR2_MASK; + /* if C/D present they have precedence over E/F for USB-C->USB-C */ + if (pin_caps & (MODE_DP_PIN_C | MODE_DP_PIN_D)) + pin_caps &= ~(MODE_DP_PIN_E | MODE_DP_PIN_F); + /* get_next_bit returns undefined for zero */ if (!pin_caps) return 0; |