Skip to content

Commit 35d0a5f

Browse files
authored
Merge pull request #494 from FrameworkComputer/hx30.delay_3s_disable_bb_retimer_power
WORKAROUND: delay 3 seconds to disable BB retimer power
2 parents 1d39796 + 0fbcca5 commit 35d0a5f

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

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)