diff options
author | Edward Hill <ecgh@chromium.org> | 2020-10-28 16:26:31 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-30 03:05:13 +0000 |
commit | e70ecea5d6101bc6af159c5f7790f3111bd6e393 (patch) | |
tree | efc52f90f938bebb93fc2b63b33caeb04feb8b05 /board/morphius | |
parent | 77647ae24a7118aac93449bc88f601a6c09290b1 (diff) | |
download | chrome-ec-e70ecea5d6101bc6af159c5f7790f3111bd6e393.tar.gz |
morphius: Wait 500ms before allowing DP event to cause resume.
Turning off the MST hub in S3 (via IOEX_HDMI_DATA_EN_DB) causes a
VDM:Attention that immediately wakes us back up from S3.
Wait 500ms after S3 entry before setting EC_MKBP_EVENT_DP_ALT_MODE_ENTERED
in pd_notify_dp_alt_mode_entry().
BUG=b:167949458
BRANCH=zork
TEST=powerd_dbus_suspend with display connected to MST hub DB
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I0d90d0a5130403b9aca1057725509814cac0d545
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2506424
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/morphius')
-rw-r--r-- | board/morphius/board.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/board/morphius/board.c b/board/morphius/board.c index 8dca1c99ed..ce4a338260 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -28,6 +28,7 @@ #include "hooks.h" #include "keyboard_8042.h" #include "lid_switch.h" +#include "mkbp_event.h" #include "power.h" #include "power_button.h" #include "ps2_chip.h" @@ -50,6 +51,7 @@ static void board_gmr_tablet_switch_isr(enum gpio_signal signal); #include "gpio_list.h" static bool support_aoz_ppc; +static bool ignore_c1_dp; #ifdef HAS_TASK_MOTIONSENSE @@ -621,6 +623,12 @@ static void board_chipset_resume(void) } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); +static void board_chipset_suspend_delay(void) +{ + ignore_c1_dp = false; +} +DECLARE_DEFERRED(board_chipset_suspend_delay); + static void board_chipset_suspend(void) { /* SMART charge current */ @@ -634,6 +642,14 @@ static void board_chipset_suspend(void) ioex_set_level(IOEX_HDMI_POWER_EN_DB, 0); } + /* Wait 500ms before allowing DP event to cause resume. */ + if (ec_config_has_mst_hub_rtd2141b() + && (dp_flags[USBC_PORT_C1] & DP_FLAGS_DP_ON)) { + ignore_c1_dp = true; + hook_call_deferred(&board_chipset_suspend_delay_data, + 500 * MSEC); + } + ioex_set_level(IOEX_HDMI_DATA_EN_DB, 0); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); @@ -762,3 +778,16 @@ int board_sensor_at_360(void) return 0; } + +/* + * b/167949458: Suppress setting the host event for 500ms after entering S3. + * Otherwise turning off the MST hub in S3 (via IOEX_HDMI_DATA_EN_DB) causes + * a VDM:Attention that immediately wakes us back up from S3. + */ +__override void pd_notify_dp_alt_mode_entry(int port) +{ + if (port == USBC_PORT_C1 && ignore_c1_dp) + return; + cprints(CC_USBPD, "Notifying AP of DP Alt Mode Entry..."); + mkbp_send_event(EC_MKBP_EVENT_DP_ALT_MODE_ENTERED); +} |