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 <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/879358
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Edward Hill
2018-01-22 13:38:17 -07:00
committed by chrome-bot
parent adeb276aa6
commit bd9d0d054b
2 changed files with 1 additions and 1 deletions

View File

@@ -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)
{

View File

@@ -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