diff options
author | Diana Z <dzigterman@chromium.org> | 2021-04-12 14:26:44 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-13 20:12:28 +0000 |
commit | aa6e346e6a9268bdcdebb90127c91b4b9097a42d (patch) | |
tree | 9de784fc0f26ea628fbd83f39822a205a5c912e3 /common/usbc/usb_pe_drp_sm.c | |
parent | fdea1a4e10b6f52aad7cb48a82bd64a94eb1f69f (diff) | |
download | chrome-ec-aa6e346e6a9268bdcdebb90127c91b4b9097a42d.tar.gz |
TCPMv2: Remove dual-role capability check from Attached.SNK entry
Currently, we'll check the partner dual role flag when entering
Attached.SNK not from a power role swap. However, we have no way to
know the partner dual role capabilities at that point. Set up
connections as dedicated, and then allow the PE to update accordingly
when source capabilities are received.
BRANCH=None
BUG=None
TEST=on guybrush, confirm we automatically charge from a PD charger,
non-PD charger, and do not automatically charge from another chromebook
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ia7cdf4259c35af32a303113befe0bd2fb26cf6d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821365
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/usbc/usb_pe_drp_sm.c')
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index af3cfddd80..e2724cf98c 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -138,22 +138,20 @@ * Flag to trigger a message resend after receiving a WAIT from port partner */ #define PE_FLAGS_WAITING_PR_SWAP BIT(23) -/* FLAG to track if port partner is dualrole capable */ -#define PE_FLAGS_PORT_PARTNER_IS_DUALROLE BIT(24) /* FLAG is set when an AMS is initiated locally. ie. AP requested a PR_SWAP */ -#define PE_FLAGS_LOCALLY_INITIATED_AMS BIT(25) +#define PE_FLAGS_LOCALLY_INITIATED_AMS BIT(24) /* Flag to note the first message sent in PE_SRC_READY and PE_SNK_READY */ -#define PE_FLAGS_FIRST_MSG BIT(26) +#define PE_FLAGS_FIRST_MSG BIT(25) /* Flag to continue a VDM request if it was interrupted */ -#define PE_FLAGS_VDM_REQUEST_CONTINUE BIT(27) +#define PE_FLAGS_VDM_REQUEST_CONTINUE BIT(26) /* TODO: POLICY decision: Triggers a Vconn SWAP attempt to on */ -#define PE_FLAGS_VCONN_SWAP_TO_ON BIT(28) +#define PE_FLAGS_VCONN_SWAP_TO_ON BIT(27) /* FLAG to track that VDM request to port partner timed out */ -#define PE_FLAGS_VDM_REQUEST_TIMEOUT BIT(29) +#define PE_FLAGS_VDM_REQUEST_TIMEOUT BIT(28) /* FLAG to note message was discarded due to incoming message */ -#define PE_FLAGS_MSG_DISCARDED BIT(30) +#define PE_FLAGS_MSG_DISCARDED BIT(29) /* FLAG to note that hard reset can't be performed due to battery low */ -#define PE_FLAGS_SNK_WAITING_BATT BIT(31) +#define PE_FLAGS_SNK_WAITING_BATT BIT(30) /* Message flags which should not persist on returning to ready state */ #define PE_FLAGS_READY_CLR (PE_FLAGS_LOCALLY_INITIATED_AMS \ @@ -1742,10 +1740,8 @@ static void pe_update_src_pdo_flags(int port, int pdo_cnt, uint32_t *pdos) if (IS_ENABLED(CONFIG_CHARGE_MANAGER)) { if (pd_can_source_from_device(port, pdo_cnt, pdos)) { - PE_CLR_FLAG(port, PE_FLAGS_PORT_PARTNER_IS_DUALROLE); charge_manager_update_dualrole(port, CAP_DEDICATED); } else { - PE_SET_FLAG(port, PE_FLAGS_PORT_PARTNER_IS_DUALROLE); charge_manager_update_dualrole(port, CAP_DUALROLE); } } @@ -1765,11 +1761,6 @@ void pd_request_power_swap(int port) pd_dpm_request(port, DPM_REQUEST_PR_SWAP); } -int pd_is_port_partner_dualrole(int port) -{ - return PE_CHK_FLAG(port, PE_FLAGS_PORT_PARTNER_IS_DUALROLE); -} - /* The function returns true if there is a PE state change, false otherwise */ static bool port_try_vconn_swap(int port) { |