summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/asurada_scp/board.h2
-rw-r--r--chip/mt8192_scp/ipi.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/board/asurada_scp/board.h b/board/asurada_scp/board.h
index 1648862275..b945a048c0 100644
--- a/board/asurada_scp/board.h
+++ b/board/asurada_scp/board.h
@@ -71,6 +71,8 @@
#define CONFIG_DRAM_BASE_LOAD 0x50000000
#define CONFIG_DRAM_SIZE 0x01400000 /* 20 MB */
+#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
+
#ifndef __ASSEMBLER__
#include "gpio_signal.h"
#endif /* !__ASSEMBLER__ */
diff --git a/chip/mt8192_scp/ipi.c b/chip/mt8192_scp/ipi.c
index 39fcc09809..d7c7248760 100644
--- a/chip/mt8192_scp/ipi.c
+++ b/chip/mt8192_scp/ipi.c
@@ -4,11 +4,14 @@
*/
#include "atomic.h"
+#include "clock.h"
+#include "clock_chip.h"
#include "common.h"
#include "console.h"
#include "hooks.h"
#include "hostcmd.h"
#include "ipi_chip.h"
+#include "power.h"
#include "registers.h"
#include "system.h"
#include "task.h"
@@ -54,6 +57,19 @@ static void ipi_wake_ap(int32_t id)
SCP_SCP2SPM_IPC_SET = IPC_SCP2HOST;
}
+__override void
+power_chipset_handle_host_sleep_event(enum host_sleep_event state,
+ struct host_sleep_event_context *ctx)
+{
+ if (state == HOST_SLEEP_EVENT_S3_SUSPEND) {
+ ccprints("AP suspend");
+ clock_select_clock(SCP_CLK_ULPOSC1);
+ } else if (state == HOST_SLEEP_EVENT_S3_RESUME) {
+ ccprints("AP resume");
+ clock_select_clock(SCP_CLK_ULPOSC2);
+ }
+}
+
int ipi_send(int32_t id, const void *buf, uint32_t len, int wait)
{
int ret;