mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-06 15:01:35 +00:00
tcpc: Move board level TCPC init to happen in pd_task init
When the board level TCPC run as an init hook it will frequently lead to an EC reset when we are trying to recovery a disconnected battery, potentially even a reboot loop with the most unlucky timing. If we instead call it from the pd_task before tcpc_init is called then the board init hook can stall the pd_task init until the battery is out of disconnect mode, or giving up after 2 seconds in case the battery never seems to recover. This accomplishes two goals: ensure the PD chips are not reset until the battery is out of disconnect and delay start of the pd_task (and PD negotiation) until the battery is out of disconnect state. This change was done in the Eve FW branch. Pulling it into TOT so it can be used for other boards that have the same issue. https://chromium-review.googlesource.com/c/592716. The change to wait for the battery to be out of disconnect mode is in the board specific board_tcpc_init() function and so will be in subsequent board specific CLs. BUG=b:63957122 BRANCH=none TEST=manual Verify that 'make buildall' is successful. Change-Id: I14c3dbb89cdc05fa9231fbe9db2e1de19fa941b6 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/627114 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
6d286d157c
commit
0aa4bfe9a3
@@ -1675,6 +1675,11 @@ 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);
|
||||
|
||||
|
||||
@@ -2521,6 +2521,9 @@
|
||||
/* 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user