diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2020-03-17 15:31:24 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-19 21:56:29 +0000 |
commit | a62fd24addc0c84a033d2f701670cc207f49b52b (patch) | |
tree | 429f1c5e9a797d4438698b1aaed2ef657a179253 /driver/retimer/bb_retimer.c | |
parent | d7957d559f0af9bd07fcb56dcafec6f4bf061191 (diff) | |
download | chrome-ec-a62fd24addc0c84a033d2f701670cc207f49b52b.tar.gz |
USB-C: Determine port partner's data role based on PD's data role
Current code uses the CC lines to find out the data role of a
port partner, however when the PD based data role swap happens
DR_swap command has no effect on the CC lines. Hence need to
use PD's data role to determine port partner's data role.
Reference: USB Type-C cable and connector specification, Release 2.0
4.5.1.4.2 USB PD-based Power Role, Data Role and VCONN Swapping
Table 4-12 USB PD Swapping Port Behavior Summary
BUG=b:151653348
BRANCH=none
TEST=UFP/DFP is correctly configured hence no PMC timeout errors
observed on Volteer.
Change-Id: I237d5c3f88096f4bd2d043ab823c98fe47686fa9
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107890
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver/retimer/bb_retimer.c')
-rw-r--r-- | driver/retimer/bb_retimer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c index f0c7f52ebf..2a9bcb5f12 100644 --- a/driver/retimer/bb_retimer.c +++ b/driver/retimer/bb_retimer.c @@ -145,11 +145,12 @@ static int retimer_set_state(const struct usb_mux *me, mux_state_t mux_state) set_retimer_con |= BB_RETIMER_USB_3_CONNECTION; /* - * Bit 7: USB_DATA_ROLE (ignored if BIT5=0) + * Bit 7: USB_DATA_ROLE for the Burnside Bridge side of + * connection (ignored if BIT5=0). * 0 - DFP - * 1 - UPF + * 1 - UFP */ - if (pd_partner_is_ufp(port)) + if (pd_get_data_role(port) == PD_ROLE_UFP) set_retimer_con |= BB_RETIMER_USB_DATA_ROLE; } |