Skip to content

Commit 0fbcca5

Browse files
author
Josh Tsai
committed
WORKAROUND: delay 3 seconds to disable BB retimer power
When the system resumes from S0ix, it will do the HDMI handshake. But if EC disable the BB retimer power at this moment, it will cause the handshake is failed. EC can not know when the system actually resume from S0ix, so add the workaround to delay 3 seconds to disable BB retimer power, and cancel the delay function when EC want to enable the retimer power. Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
1 parent 2f64e29 commit 0fbcca5

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

board/hx30/board.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,16 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN,
763763
HOOK_PRIO_DEFAULT);
764764

765765
static int force_gpio6_rework;
766+
767+
void disable_bb_retimer_power_deferred(void)
768+
{
769+
if (board_get_version() > BOARD_VERSION_10 || force_gpio6_rework) {
770+
CPRINTS("Disable BBR power");
771+
gpio_set_level(GPIO_PM_SLP_S0_L, 0);
772+
}
773+
}
774+
DECLARE_DEFERRED(disable_bb_retimer_power_deferred);
775+
766776
/* Called on AP S3 -> S0 transition */
767777
static void board_chipset_resume(void)
768778
{
@@ -773,12 +783,17 @@ static void board_chipset_resume(void)
773783
charge_psys_onoff(1);
774784

775785
/* Enable BB retimer power, for MP boards. */
776-
if (board_get_version() > BOARD_VERSION_10 || force_gpio6_rework)
786+
if (board_get_version() > BOARD_VERSION_10 || force_gpio6_rework) {
787+
CPRINTS("Enable BBR power");
777788
gpio_set_level(GPIO_PM_SLP_S0_L, 1);
789+
}
790+
791+
hook_call_deferred(&disable_bb_retimer_power_deferred_data, -1);
778792
}
779793
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume,
780794
MOTION_SENSE_HOOK_PRIO-1);
781795

796+
782797
/* Called on AP S0 -> S3 transition */
783798
static void board_chipset_suspend(void)
784799
{
@@ -791,8 +806,7 @@ static void board_chipset_suspend(void)
791806
charge_psys_onoff(0);
792807

793808
/* Disable BB retimer power, for MP boards. */
794-
if (board_get_version() > BOARD_VERSION_10 || force_gpio6_rework)
795-
gpio_set_level(GPIO_PM_SLP_S0_L, 0);
809+
hook_call_deferred(&disable_bb_retimer_power_deferred_data, 3 * SECOND);
796810
}
797811
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND,
798812
board_chipset_suspend,

0 commit comments

Comments
 (0)