cleanup: Remove CONFIG_USB_PD_TCPC_BOARD_INIT

It's no longer necessary to call board_tcpc_init() from PD tasks, since
HOOK_INIT completion is guaranteed before the task starts. Also, calling
board_tcpc_init() for each PD task without a port arg is a bad idea.

BUG=b:72229154
BRANCH=none
TEST=`make buildall -j`

Change-Id: I6fba07771693b8343568041960a263e02775a8fc
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/881538
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2018-01-23 10:08:53 -08:00
committed by chrome-bot
parent 1c90656d03
commit 9afcd8d602
5 changed files with 2 additions and 11 deletions

View File

@@ -362,7 +362,7 @@ void board_reset_pd_mcu(void)
board_set_tcpc_power_mode(USB_PD_PORT_ANX74XX, 1);
}
void board_tcpc_init(void)
static void board_tcpc_init(void)
{
int port, reg;
int count = 0;
@@ -411,6 +411,7 @@ void board_tcpc_init(void)
mux->hpd_update(port, 0, 0);
}
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_DEFAULT);
/*
* Data derived from Seinhart-Hart equation in a resistor divider circuit with

View File

@@ -321,7 +321,6 @@ void board_reset_pd_mcu(void);
int board_get_version(void);
void board_set_tcpc_power_mode(int port, int mode);
void board_tcpc_init(void);
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL)

View File

@@ -195,7 +195,6 @@ enum sensor_id {
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL)
void board_reset_pd_mcu(void);
void board_tcpc_init(void);
#endif /* !__ASSEMBLER__ */

View File

@@ -2042,11 +2042,6 @@ void pd_task(void *u)
/* Ensure the power supply is in the default state */
pd_power_supply_reset(port);
#ifdef CONFIG_USB_PD_TCPC_BOARD_INIT
/* Board specific TCPC init */
board_tcpc_init();
#endif
/* Initialize TCPM driver and wait for TCPC to be ready */
res = tcpm_init(port);

View File

@@ -2718,9 +2718,6 @@
/* Use TCPC module (type-C port controller) */
#undef CONFIG_USB_PD_TCPC
/* Board provides specific TCPC init function */
#undef CONFIG_USB_PD_TCPC_BOARD_INIT
/* Enable TCPC to enter low power mode */
#undef CONFIG_USB_PD_TCPC_LOW_POWER