diff options
author | Ayushee <ayushee.shah@intel.com> | 2019-08-06 15:24:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-16 06:32:51 +0000 |
commit | 226a468ebcbc4f690d5f9c34f4912e8c046c17af (patch) | |
tree | 43d1741a316f80529e6d0f4cccce3f5df58f06ab /common | |
parent | 1fd14e8629cfef0dd34ba43a1d83eead3a6ccd2f (diff) | |
download | chrome-ec-226a468ebcbc4f690d5f9c34f4912e8c046c17af.tar.gz |
usb_pd: Get USB-C cable type information
Added logic to share the USB-C cable type information in
host command to configure the virtual mux of Intel SOC.
BUG=b:129990370
BRANCH=None
TEST=Verified on Intelrvp, able to get correct USB-C cable type information
Change-Id: Iee7c274d318f59a482d21b8faa56610509fbdf8e
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749560
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_pd_policy.c | 5 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 0e53f80c65..554cf86151 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -324,6 +324,11 @@ void reset_pd_cable(int port) memset(&cable[port], 0, sizeof(cable[port])); } +uint8_t get_usb_pd_mux_cable_type(int port) +{ + return cable[port].type; +} + #ifdef CONFIG_USB_PD_ALT_MODE #ifdef CONFIG_USB_PD_ALT_MODE_DFP diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 15798615bc..a1d4ccb4c7 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -5433,6 +5433,7 @@ static int hc_usb_pd_control(struct host_cmd_handler_args *args) r_v2->cc_state = pd[p->port].cc_state; r_v2->dp_mode = board_get_dp_pin_mode(p->port); + r_v2->cable_type = get_usb_pd_mux_cable_type(p->port); if (args->version == 1) args->response_size = sizeof(*r_v1); |