From 7595cafb024500a747a8f9de198f94beddae51dc Mon Sep 17 00:00:00 2001 From: Andrey Borisovich Date: Fri, 2 Jun 2023 13:25:12 +0200 Subject: [PATCH] intel_adsp: timer: implemented sys_clock_idle_exit function Generic header for system clock allows to define a sys_clock_idle_exit function for the clock implementation. Implemented the function in the intel_adsp_timer to reinitialize device driver after the idle exit state. Signed-off-by: Andrey Borisovich --- drivers/timer/intel_adsp_timer.c | 9 +++++++++ soc/xtensa/intel_adsp/ace/power.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/timer/intel_adsp_timer.c b/drivers/timer/intel_adsp_timer.c index 2afc6b10406..de6955dd40f 100644 --- a/drivers/timer/intel_adsp_timer.c +++ b/drivers/timer/intel_adsp_timer.c @@ -225,5 +225,14 @@ static int sys_clock_driver_init(void) return 0; } +#ifdef CONFIG_PM + +void sys_clock_idle_exit(void) +{ + sys_clock_driver_init(); +} + +#endif + SYS_INIT(sys_clock_driver_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); diff --git a/soc/xtensa/intel_adsp/ace/power.c b/soc/xtensa/intel_adsp/ace/power.c index ea3ea2e6d63..4eda6f39df4 100644 --- a/soc/xtensa/intel_adsp/ace/power.c +++ b/soc/xtensa/intel_adsp/ace/power.c @@ -16,6 +16,7 @@ #include #include #include +#include #define LPSRAM_MAGIC_VALUE 0x13579BDF #define LPSCTL_BATTR_MASK GENMASK(16, 12) @@ -317,6 +318,7 @@ __weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) imr_layout->imr_state.header.adsp_imr_magic = 0; imr_layout->imr_state.header.imr_restore_vector = NULL; imr_layout->imr_state.header.imr_ram_storage = NULL; + sys_clock_idle_exit(); } #endif /* CONFIG_ADSP_IMR_CONTEXT_SAVE */ soc_cpus_active[cpu] = true;