1 /*
2  * Copyright (c) 2021 ITE Corporation. All Rights Reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/pm/pm.h>
9 #include <soc.h>
10 
11 /* Handle when enter deep doze mode. */
ite_power_soc_deep_doze(void)12 static void ite_power_soc_deep_doze(void)
13 {
14 	/* Enter deep doze mode */
15 	riscv_idle(CHIP_PLL_DEEP_DOZE, MSTATUS_IEN);
16 }
17 
18 /* Invoke Low Power/System Off specific Tasks */
pm_state_set(enum pm_state state,uint8_t substate_id)19 void pm_state_set(enum pm_state state, uint8_t substate_id)
20 {
21 	ARG_UNUSED(substate_id);
22 
23 	switch (state) {
24 	/* Deep doze mode */
25 	case PM_STATE_STANDBY:
26 		ite_power_soc_deep_doze();
27 		break;
28 	default:
29 		break;
30 	}
31 }
32 
33 /* Handle SOC specific activity after Low Power Mode Exit */
pm_state_exit_post_ops(enum pm_state state,uint8_t substate_id)34 void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
35 {
36 	ARG_UNUSED(state);
37 	ARG_UNUSED(substate_id);
38 }
39