summaryrefslogtreecommitdiff
path: root/common/usb_pd_host_cmd.c
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-10-13 20:05:20 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-06 03:08:05 +0000
commita992ef73efdcd68779702846a4f99b82662810df (patch)
tree1314adfaf93c5105ba52611256cded360cbdfafd /common/usb_pd_host_cmd.c
parentec32c12885a1800cb30916d2e28089432a794595 (diff)
downloadchrome-ec-a992ef73efdcd68779702846a4f99b82662810df.tar.gz
TCPMv2: Update sending cable information to the host
If the type of cable is Active or if it is a Linear re-driver cable, set the Bit 0: Active/Passive cable of control_flags in the usb_pd_control host command to 1 BUG=b:156749387 BRANCH=None TEST=Able to set bit 0 when an active/LRD cable is connected Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: Icde9a905a0456702c26f91bb8a3175a3b1aff9b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2470210 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usb_pd_host_cmd.c')
-rw-r--r--common/usb_pd_host_cmd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index 62b7045630..c63ec6b79c 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -256,6 +256,7 @@ static uint8_t get_pd_control_flags(int port)
{
union tbt_mode_resp_cable cable_resp;
union tbt_mode_resp_device device_resp;
+ uint8_t control_flags = 0;
if (!IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
return 0;
@@ -268,14 +269,13 @@ static uint8_t get_pd_control_flags(int port)
* Table F-11 TBT3 Cable Discover Mode VDO Responses
* For Passive cables, Active Cable Plug link training is set to 0
*/
- return (cable_resp.lsrx_comm == UNIDIR_LSRX_COMM ?
- USB_PD_CTRL_ACTIVE_LINK_UNIDIR : 0) |
- (device_resp.tbt_adapter == TBT_ADAPTER_TBT2_LEGACY ?
- USB_PD_CTRL_TBT_LEGACY_ADAPTER : 0) |
- (cable_resp.tbt_cable == TBT_CABLE_OPTICAL ?
- USB_PD_CTRL_OPTICAL_CABLE : 0) |
- (cable_resp.retimer_type == USB_RETIMER ?
- USB_PD_CTRL_ACTIVE_CABLE : 0);
+ control_flags |= cable_resp.lsrx_comm == UNIDIR_LSRX_COMM;
+ control_flags |= device_resp.tbt_adapter == TBT_ADAPTER_TBT2_LEGACY;
+ control_flags |= cable_resp.tbt_cable == TBT_CABLE_OPTICAL;
+ control_flags |= get_usb_pd_cable_type(port) == IDH_PTYPE_ACABLE;
+ control_flags |= cable_resp.tbt_active_passive == TBT_CABLE_ACTIVE;
+
+ return control_flags;
}
static uint8_t pd_get_role_flags(int port)