From bd9d0d054be7ab3b18adfb373135ec2554cd823f Mon Sep 17 00:00:00 2001 From: Edward Hill Date: Mon, 22 Jan 2018 13:38:17 -0700 Subject: [PATCH] grunt: Move TCPC init to init hook All init hooks complete before tasks are started (since crrev.com/c/456628), so board_tcpc_init will finish before the PD tasks start. Using the init hook instead of CONFIG_USB_PD_TCPC_BOARD_INIT avoids the problem of board_tcpc_init being called by every PD task. BUG=b:72229154 BRANCH=none TEST=PD still works on grunt, board_tcpc_init is only called once, PD task init happens after board_tcpc_init finishes Change-Id: Ie1263dffce06e9ea2433cc2d08d1537e4a891d40 Signed-off-by: Edward Hill Reviewed-on: https://chromium-review.googlesource.com/879358 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Jett Rink Reviewed-by: Shawn N --- board/grunt/board.c | 1 + board/grunt/board.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/board/grunt/board.c b/board/grunt/board.c index c3ba3b7374..9d9cb14d67 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -313,6 +313,7 @@ void board_tcpc_init(void) mux->hpd_update(port, 0, 0); } } +DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1); void board_overcurrent_event(int port) { diff --git a/board/grunt/board.h b/board/grunt/board.h index 9356ad74f6..ceeb2584e2 100644 --- a/board/grunt/board.h +++ b/board/grunt/board.h @@ -78,7 +78,6 @@ #define CONFIG_USB_PD_LOGGING #define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0 #define CONFIG_USB_PD_PORT_COUNT 2 -#define CONFIG_USB_PD_TCPC_BOARD_INIT #define CONFIG_USB_PD_TCPC_LOW_POWER #define CONFIG_USB_PD_TCPM_ANX74XX #define CONFIG_USB_PD_TCPM_MUX