feat(mt8188): keep infra and peri on when system suspend

In order to wake up system from USB devices, keep infra and peri on
when system suspend.

Change-Id: I0a0eb2e72709b0cc1bf11b36241a50cb5d85d9b8
Signed-off-by: Shaocheng Wang <shaocheng.wang@mediatek.corp-partner.google.com>
This commit is contained in:
Shaocheng Wang 2022-12-15 18:42:51 +08:00 committed by Liju-Clr Chen
parent 380f64b2e3
commit e56a939cab
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2023, MediaTek Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mtk_init/mtk_init.h>
#include <lpm/mt_lp_api.h>
#include <platform_def.h>
int mt_usb_init(void)
{
INFO("[%s] mt_usb initialization\n", __func__);
/* Keep infra and peri on to support wake-up from USB */
mtk_usb_update(LPM_USB_ENTER);
return 0;
}
MTK_PLAT_SETUP_0_INIT(mt_usb_init);

View file

@ -0,0 +1,13 @@
#
# Copyright (c) 2023, MediaTek Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
LOCAL_DIR := $(call GET_LOCAL_DIR)
MODULE := usb
LOCAL_SRCS-y := $(LOCAL_DIR)/$(MTK_SOC)/mt_usb.c
$(eval $(call MAKE_MODULE,$(MODULE),$(LOCAL_SRCS-y),$(MTK_BL)))

View file

@ -41,6 +41,7 @@ MODULES-y += $(MTK_PLAT)/drivers/ptp3
MODULES-y += $(MTK_PLAT)/drivers/rtc MODULES-y += $(MTK_PLAT)/drivers/rtc
MODULES-y += $(MTK_PLAT)/drivers/spm MODULES-y += $(MTK_PLAT)/drivers/spm
MODULES-y += $(MTK_PLAT)/drivers/timer MODULES-y += $(MTK_PLAT)/drivers/timer
MODULES-y += $(MTK_PLAT)/drivers/usb
MODULES-y += $(MTK_PLAT)/helpers MODULES-y += $(MTK_PLAT)/helpers
MODULES-y += $(MTK_PLAT)/topology MODULES-y += $(MTK_PLAT)/topology