diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/asurada/usb_pd_policy.c | 2 | ||||
-rw-r--r-- | board/morphius/board.c | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/board/asurada/usb_pd_policy.c b/board/asurada/usb_pd_policy.c index c20d4f4746..ce27dd20d6 100644 --- a/board/asurada/usb_pd_policy.c +++ b/board/asurada/usb_pd_policy.c @@ -79,7 +79,7 @@ __override int svdm_dp_attention(int port, uint32_t *payload) * present. */ if (IS_ENABLED(CONFIG_MKBP_EVENT)) - pd_notify_dp_alt_mode_entry(); + pd_notify_dp_alt_mode_entry(port); /* Its initial DP status message prior to config */ if (!(dp_flags[port] & DP_FLAGS_DP_ON)) { 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); +} |