summaryrefslogtreecommitdiff
path: root/common/usb_pd_host_cmd.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-02-07 15:27:03 -0800
committerCommit Bot <commit-bot@chromium.org>2020-05-04 22:28:01 +0000
commit8d2187232e858d5f85501a2afcbb4b1ec1d1b59c (patch)
tree4f60764300552eac8156240b773fa56159c92834 /common/usb_pd_host_cmd.c
parent9a6eba9f0f9206318bf711e9f8499ecd532c7077 (diff)
downloadchrome-ec-8d2187232e858d5f85501a2afcbb4b1ec1d1b59c.tar.gz
usb_pd: Move Thunderbolt-Compatible functions to common file
Added 'get_tcpm_transmit_msg_type()' to return type of SOP message transmitted since, 'PD_HEADER_GET_SOP' is not a part of PD spec and TCPMv1 will return 0 irrespective of type of SOP message transmitted. BUG=b:148528713 BRANCH=none TEST=Able to enter Thunderbolt-Compat mode with both Active and Passive cable on TCPMv1. Change-Id: Ic53efeda9d9e012571f3047bc2a0d65969296b8c Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051630 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usb_pd_host_cmd.c')
-rw-r--r--common/usb_pd_host_cmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index 700b2615f7..ac4ccc2642 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -355,12 +355,12 @@ static enum ec_status hc_usb_pd_control(struct host_cmd_handler_args *args)
else
r_v2->state[0] = '\0';
- if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
- r_v2->dp_mode = get_dp_pin_mode(p->port);
-
r_v2->control_flags = get_pd_control_flags(p->port);
- r_v2->cable_speed = get_tbt_cable_speed(p->port);
- r_v2->cable_gen = get_tbt_rounded_support(p->port);
+ if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP)) {
+ r_v2->dp_mode = get_dp_pin_mode(p->port);
+ r_v2->cable_speed = get_tbt_cable_speed(p->port);
+ r_v2->cable_gen = get_tbt_rounded_support(p->port);
+ }
if (args->version == 1)
args->response_size = sizeof(*r_v1);