2021-10-15 13:20:47 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 ITE Corporation. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 17:11:04 +08:00
|
|
|
#include <zephyr/kernel.h>
|
|
|
|
#include <zephyr/pm/pm.h>
|
2021-10-15 13:20:47 +08:00
|
|
|
#include <soc.h>
|
|
|
|
|
|
|
|
/* Handle when enter deep doze mode. */
|
|
|
|
static void ite_power_soc_deep_doze(void)
|
|
|
|
{
|
|
|
|
/* Enter deep doze mode */
|
|
|
|
riscv_idle(CHIP_PLL_DEEP_DOZE, MSTATUS_IEN);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Invoke Low Power/System Off specific Tasks */
|
2022-02-05 09:19:52 +08:00
|
|
|
__weak void pm_state_set(enum pm_state state, uint8_t substate_id)
|
2021-10-15 13:20:47 +08:00
|
|
|
{
|
2022-01-22 01:28:10 +08:00
|
|
|
ARG_UNUSED(substate_id);
|
|
|
|
|
|
|
|
switch (state) {
|
2021-10-15 13:20:47 +08:00
|
|
|
/* Deep doze mode */
|
|
|
|
case PM_STATE_STANDBY:
|
|
|
|
ite_power_soc_deep_doze();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
2022-02-06 14:24:29 +08:00
|
|
|
__weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
|
2021-10-15 13:20:47 +08:00
|
|
|
{
|
2022-01-22 01:28:10 +08:00
|
|
|
ARG_UNUSED(state);
|
|
|
|
ARG_UNUSED(substate_id);
|
2021-10-15 13:20:47 +08:00
|
|
|
}
|