diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-02-07 15:13:51 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-27 07:59:50 +0000 |
commit | d4bc8b52d0562e1a05baea2531f735f5e3b723f4 (patch) | |
tree | 0b25cc07f59e812dc774866d1e5417081c637ff4 /common/usb_pd_policy.c | |
parent | 7bffc114e8f56cea32c04ac127092d29577894b8 (diff) | |
download | chrome-ec-d4bc8b52d0562e1a05baea2531f735f5e3b723f4.tar.gz |
usb_pd: Move cable communication functions to common file
BUG=b:148528713
BRANCH=none
TEST=Verified on TCPMV1 and TCPMv2, able to get correct
cable characteristics.
Change-Id: I812b21c87661952bf4e86acaa194d4b136371594
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051628
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r-- | common/usb_pd_policy.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index f3417a36a6..6cb69f5bc5 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -173,11 +173,6 @@ void reset_pd_cable(int port) cable[port].last_sop_p_p_msg_id = INVALID_MSG_ID_COUNTER; } -enum idh_ptype get_usb_pd_cable_type(int port) -{ - return cable[port].type; -} - union tbt_mode_resp_cable get_cable_tbt_vdo(int port) { /* @@ -294,11 +289,6 @@ void disable_enter_usb4_mode(int port) static struct pd_policy pe[CONFIG_USB_PD_PORT_MAX_COUNT]; -static int is_vdo_present(int cnt, int index) -{ - return cnt > index; -} - static void enable_transmit_sop_prime(int port) { if (IS_ENABLED(CONFIG_USB_PD_DECODE_SOP)) @@ -545,33 +535,6 @@ void pd_dfp_pe_init(int port) memset(&pe[port], 0, sizeof(struct pd_policy)); } -static void dfp_consume_cable_response(int port, int cnt, uint32_t *payload, - uint16_t head) -{ - if (cable[port].is_identified) - return; - - /* Get cable rev */ - cable[port].rev = PD_HEADER_REV(head); - - if (is_vdo_present(cnt, VDO_INDEX_IDH)) { - cable[port].type = PD_IDH_PTYPE(payload[VDO_INDEX_IDH]); - if (is_vdo_present(cnt, VDO_INDEX_PTYPE_CABLE1)) - cable[port].attr.raw_value = - payload[VDO_INDEX_PTYPE_CABLE1]; - } - /* - * Ref USB PD Spec 3.0 Pg 145. For active cable there are two VDOs. - * Hence storing the second VDO. - */ - if (IS_ENABLED(CONFIG_USB_PD_REV30) && - is_vdo_present(cnt, VDO_INDEX_PTYPE_CABLE2) && - cable[port].type == IDH_PTYPE_ACABLE) - cable[port].attr2.raw_value = payload[VDO_INDEX_PTYPE_CABLE2]; - - cable[port].is_identified = 1; -} - static int dfp_discover_ident(uint32_t *payload) { payload[0] = VDO(USB_SID_PD, 1, CMD_DISCOVER_IDENT); |