From 86fc12a3155e9c89295d64ece856c15f872e0159 Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Tue, 16 Mar 2021 15:39:11 -0700 Subject: TCPMV2: Remove unused TypeC State Machine Flag The TC_FLAGS_DISC_IDENT_IN_PROGRESS TypeC State Machine flag is unused, so it has been removed. BUG=b:165934405 BRANCH=none TEST=make runtests Signed-off-by: Sam Hurst Change-Id: I888c53a90a68e0d3690f47ca54e6e765601e7c3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765156 Reviewed-by: Diana Z Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774584 Tested-by: Abe Levkoy Reviewed-by: Abe Levkoy Commit-Queue: Abe Levkoy --- common/usbc/usb_tc_drp_acc_trysrc_sm.c | 36 ++++++++++------------------------ include/usb_tc_sm.h | 16 --------------- 2 files changed, 10 insertions(+), 42 deletions(-) diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 054d7f9f79..8b2a1f23e6 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -109,26 +109,24 @@ void print_flag(int port, int set_or_clear, int flag); #define TC_FLAGS_HARD_RESET_REQUESTED BIT(13) /* Flag to note we are currently performing PR Swap */ #define TC_FLAGS_PR_SWAP_IN_PROGRESS BIT(14) -/* Flag to note we are performing Discover Identity */ -#define TC_FLAGS_DISC_IDENT_IN_PROGRESS BIT(15) /* Flag to note we should check for connection */ -#define TC_FLAGS_CHECK_CONNECTION BIT(16) +#define TC_FLAGS_CHECK_CONNECTION BIT(15) /* Flag to note request from pd_set_suspend to enter TC_DISABLED state */ -#define TC_FLAGS_REQUEST_SUSPEND BIT(17) +#define TC_FLAGS_REQUEST_SUSPEND BIT(16) /* Flag to note we are in TC_DISABLED state */ -#define TC_FLAGS_SUSPENDED BIT(18) +#define TC_FLAGS_SUSPENDED BIT(17) /* Flag to indicate the port current limit has changed */ -#define TC_FLAGS_UPDATE_CURRENT BIT(19) +#define TC_FLAGS_UPDATE_CURRENT BIT(18) /* Flag to indicate USB mux should be updated */ -#define TC_FLAGS_UPDATE_USB_MUX BIT(20) +#define TC_FLAGS_UPDATE_USB_MUX BIT(19) /* Flag for retimer firmware update */ -#define TC_FLAGS_USB_RETIMER_FW_UPDATE_RUN BIT(21) -#define TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN BIT(22) +#define TC_FLAGS_USB_RETIMER_FW_UPDATE_RUN BIT(20) +#define TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN BIT(21) /* Flag for asynchronous call to request Error Recovery */ -#define TC_FLAGS_REQUEST_ERROR_RECOVERY BIT(23) +#define TC_FLAGS_REQUEST_ERROR_RECOVERY BIT(22) /* For checking flag_bit_names[] array */ -#define TC_FLAGS_COUNT 23 +#define TC_FLAGS_COUNT 22 /* On disconnect, clear most of the flags. */ #define CLR_FLAGS_ON_DISCONNECT(port) TC_CLR_FLAG(port, \ @@ -931,16 +929,6 @@ void tc_hard_reset_request(int port) task_wake(PD_PORT_TO_TASK_ID(port)); } -void tc_disc_ident_in_progress(int port) -{ - TC_SET_FLAG(port, TC_FLAGS_DISC_IDENT_IN_PROGRESS); -} - -void tc_disc_ident_complete(int port) -{ - TC_CLR_FLAG(port, TC_FLAGS_DISC_IDENT_IN_PROGRESS); -} - void tc_try_src_override(enum try_src_override_t ov) { if (!IS_ENABLED(CONFIG_USB_PD_TRY_SRC)) @@ -3040,8 +3028,7 @@ static void tc_attached_src_run(const int port) * Attached.SRC. */ if (tc[port].cc_state == PD_CC_NONE && - !TC_CHK_FLAG(port, TC_FLAGS_PR_SWAP_IN_PROGRESS) && - !TC_CHK_FLAG(port, TC_FLAGS_DISC_IDENT_IN_PROGRESS)) { + !TC_CHK_FLAG(port, TC_FLAGS_PR_SWAP_IN_PROGRESS)) { bool tryWait; enum usb_tc_state new_tc_state = TC_UNATTACHED_SNK; @@ -3153,9 +3140,6 @@ static void tc_attached_src_run(const int port) if (!TC_CHK_FLAG(port, TC_FLAGS_TS_DTS_PARTNER) && TC_CHK_FLAG(port, TC_FLAGS_CTVPD_DETECTED)) { - /* Clear TC_FLAGS_DISC_IDENT_IN_PROGRESS */ - TC_CLR_FLAG(port, TC_FLAGS_DISC_IDENT_IN_PROGRESS); - set_state_tc(port, TC_CT_UNATTACHED_SNK); } } diff --git a/include/usb_tc_sm.h b/include/usb_tc_sm.h index 1faa23b45c..71b895b78f 100644 --- a/include/usb_tc_sm.h +++ b/include/usb_tc_sm.h @@ -180,22 +180,6 @@ void tc_request_power_swap(int port); */ void tc_pr_swap_complete(int port, bool success); -/** - * Informs the Type-C State Machine that a Discover Identity is in progress. - * This function is called from the Policy Engine. - * - * @param port USB_C port number - */ -void tc_disc_ident_in_progress(int port); - -/** - * Informs the Type-C State Machine that a Discover Identity is complete. - * This function is called from the Policy Engine. - * - * @param port USB_C port number - */ -void tc_disc_ident_complete(int port); - /** * Instructs the Attached.SNK to stop drawing power. This function is called * from the Policy Engine and only has effect if the current Type-C state -- cgit v1.2.1