diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-01-06 12:02:14 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-14 23:22:51 +0000 |
commit | d3cef73e459bfd7757872e06e760cb4195c0663e (patch) | |
tree | cdb83d9c7f0ad90c5ee26312788f8a29bb642d07 /common/usb_common.c | |
parent | d9d96d1b01cb66fbfdc50fe705eaa2cc2579b442 (diff) | |
download | chrome-ec-d3cef73e459bfd7757872e06e760cb4195c0663e.tar.gz |
usb_pd: Request Vconn swap to communicating with the cable
Before sending SOP' requests to cable plug, the port checks if
the port is the Vconn source. If the port isn't the Vconn source,
it can't talk to the cable.
From USB PD spec 1.3 sections 2.6.1 and 2.6.2, during an explicit
contract, after the data and power role swaps, if any, source/sink
can initiate or receive a request for exchanging the Vconn source.
Hence, adding support for the port to request Vconn swap, if it
hasn't already been swapped.
BUG=b:147209888
BRANCH=None
TEST=Checked on volteer, able to communicate with the cable plug
Change-Id: I36d896eda6319970b1a0a9bd7cc4efcbc381c8b1
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1988234
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r-- | common/usb_common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c index 47ff89de4a..8118ca4690 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -655,6 +655,17 @@ __overridable void pd_execute_data_swap(int port, { } +__overridable void pd_try_execute_vconn_swap(int port, int flags) +{ + /* + * If partner is dual-role power and vconn swap is enabled, consider + * if vconn swapping is necessary. + */ + if (IS_ENABLED(CONFIG_USB_PD_DUAL_ROLE) && + IS_ENABLED(CONFIG_USBC_VCONN_SWAP)) + pd_try_vconn_src(port); +} + __overridable int pd_is_valid_input_voltage(int mv) { return 1; |