power: Use substate-id in pm subsystem
Change subsystem to use struct pm_state with substate-id instead of using only the power state category. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
c5e82ecec3
commit
321ce7fb77
20 changed files with 166 additions and 134 deletions
|
@ -158,7 +158,7 @@ the following function.
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c
|
||||||
|
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks);
|
struct pm_state_info pm_policy_next_state(int32_t ticks);
|
||||||
|
|
||||||
Dummy
|
Dummy
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -133,18 +133,21 @@ static inline void pm_idle_exit_notification_disable(void)
|
||||||
* If enabled PM_DIRECT_FORCE_MODE, this function can only
|
* If enabled PM_DIRECT_FORCE_MODE, this function can only
|
||||||
* run in thread context.
|
* run in thread context.
|
||||||
*
|
*
|
||||||
* @param state Power state which should be used in the ongoing
|
* @param info Power state which should be used in the ongoing
|
||||||
* suspend operation or POWER_STATE_AUTO.
|
* suspend operation.
|
||||||
*/
|
*/
|
||||||
void pm_power_state_force(enum pm_state state);
|
void pm_power_state_force(struct pm_state_info info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Put processor into a power state.
|
* @brief Put processor into a power state.
|
||||||
*
|
*
|
||||||
* This function implements the SoC specific details necessary
|
* This function implements the SoC specific details necessary
|
||||||
* to put the processor into available power states.
|
* to put the processor into available power states.
|
||||||
|
*
|
||||||
|
* @param info Power state which should be used in the ongoing
|
||||||
|
* suspend operation.
|
||||||
*/
|
*/
|
||||||
void pm_power_state_set(enum pm_state state);
|
void pm_power_state_set(struct pm_state_info info);
|
||||||
|
|
||||||
#ifdef CONFIG_PM_DEBUG
|
#ifdef CONFIG_PM_DEBUG
|
||||||
/**
|
/**
|
||||||
|
@ -274,7 +277,7 @@ enum pm_state pm_system_suspend(int32_t ticks);
|
||||||
* interrupts after resuming from sleep state. In future, the enabling
|
* interrupts after resuming from sleep state. In future, the enabling
|
||||||
* of interrupts may be moved into the kernel.
|
* of interrupts may be moved into the kernel.
|
||||||
*/
|
*/
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state);
|
void pm_power_state_exit_post_ops(struct pm_state_info info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register a power management notifier
|
* @brief Register a power management notifier
|
||||||
|
|
|
@ -68,7 +68,7 @@ void main(void)
|
||||||
* controlled delay. Here we need to override that, then
|
* controlled delay. Here we need to override that, then
|
||||||
* force entry to deep sleep on any delay.
|
* force entry to deep sleep on any delay.
|
||||||
*/
|
*/
|
||||||
pm_power_state_force(PM_STATE_SOFT_OFF);
|
pm_power_state_force((struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
|
||||||
k_sleep(K_MSEC(1));
|
k_sleep(K_MSEC(1));
|
||||||
|
|
||||||
printk("ERROR: System off failed\n");
|
printk("ERROR: System off failed\n");
|
||||||
|
|
|
@ -68,7 +68,7 @@ void main(void)
|
||||||
* controlled delay. Here we need to override that, then
|
* controlled delay. Here we need to override that, then
|
||||||
* force a sleep so that the deep sleep takes effect.
|
* force a sleep so that the deep sleep takes effect.
|
||||||
*/
|
*/
|
||||||
pm_power_state_force(PM_STATE_STANDBY);
|
pm_power_state_force((struct pm_state_info){PM_STATE_STANDBY, 0, 0});
|
||||||
k_sleep(K_MSEC(1));
|
k_sleep(K_MSEC(1));
|
||||||
|
|
||||||
printk("ERROR: System off failed\n");
|
printk("ERROR: System off failed\n");
|
||||||
|
|
|
@ -101,9 +101,9 @@ static void z_power_soc_sleep(void)
|
||||||
* For deep sleep pm_system_suspend has executed all the driver
|
* For deep sleep pm_system_suspend has executed all the driver
|
||||||
* power management call backs.
|
* power management call backs.
|
||||||
*/
|
*/
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
case PM_STATE_SUSPEND_TO_IDLE:
|
||||||
z_power_soc_sleep();
|
z_power_soc_sleep();
|
||||||
break;
|
break;
|
||||||
|
@ -115,9 +115,9 @@ void pm_power_state_set(enum pm_state state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
case PM_STATE_SUSPEND_TO_IDLE:
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,27 +11,27 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
nrf_power_system_off(NRF_POWER);
|
nrf_power_system_off(NRF_POWER);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,27 +11,27 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
nrf_power_system_off(NRF_POWER);
|
nrf_power_system_off(NRF_POWER);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,27 +13,27 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
nrf_regulators_system_off(NRF_REGULATORS);
|
nrf_regulators_system_off(NRF_REGULATORS);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,27 +12,27 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
nrf_regulators_system_off(NRF_REGULATORS);
|
nrf_regulators_system_off(NRF_REGULATORS);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SOFT_OFF:
|
case PM_STATE_SOFT_OFF:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
LOG_DBG("SoC entering power state %d", state);
|
LOG_DBG("SoC entering power state %d", info.state);
|
||||||
|
|
||||||
/* FIXME: When this function is entered the Kernel has disabled
|
/* FIXME: When this function is entered the Kernel has disabled
|
||||||
* interrupts using BASEPRI register. This is incorrect as it prevents
|
* interrupts using BASEPRI register. This is incorrect as it prevents
|
||||||
|
@ -34,7 +34,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
/* Set BASEPRI to 0 */
|
/* Set BASEPRI to 0 */
|
||||||
irq_unlock(0);
|
irq_unlock(0);
|
||||||
|
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_RUNTIME_IDLE:
|
case PM_STATE_RUNTIME_IDLE:
|
||||||
EMU_EnterEM1();
|
EMU_EnterEM1();
|
||||||
break;
|
break;
|
||||||
|
@ -45,18 +45,18 @@ void pm_power_state_set(enum pm_state state)
|
||||||
EMU_EnterEM3(true);
|
EMU_EnterEM3(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("SoC leaving power state %d", state);
|
LOG_DBG("SoC leaving power state %d", info.state);
|
||||||
|
|
||||||
/* Clear PRIMASK */
|
/* Clear PRIMASK */
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(state);
|
ARG_UNUSED(info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,15 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
if (info.state != PM_STATE_SUSPEND_TO_IDLE) {
|
||||||
case PM_STATE_RUNTIME_IDLE:
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (info.substate_id) {
|
||||||
|
case 0:
|
||||||
|
|
||||||
/* this corresponds to the STOP0 mode: */
|
/* this corresponds to the STOP0 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
|
@ -35,7 +40,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
/* enter SLEEP mode : WFE or WFI */
|
/* enter SLEEP mode : WFE or WFI */
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
case 1:
|
||||||
/* this corresponds to the STOP1 mode: */
|
/* this corresponds to the STOP1 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
/* Enable the Debug Module during STOP mode */
|
/* Enable the Debug Module during STOP mode */
|
||||||
|
@ -48,7 +53,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
LL_LPM_EnableDeepSleep();
|
LL_LPM_EnableDeepSleep();
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
case PM_STATE_STANDBY:
|
case 2:
|
||||||
/* this corresponds to the STOP2 mode: */
|
/* this corresponds to the STOP2 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
/* Enable the Debug Module during STOP mode */
|
/* Enable the Debug Module during STOP mode */
|
||||||
|
@ -65,26 +70,32 @@ void pm_power_state_set(enum pm_state state)
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state substate-id %u",
|
||||||
|
info.substate_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
if (info.state != PM_STATE_SUSPEND_TO_IDLE) {
|
||||||
case PM_STATE_RUNTIME_IDLE:
|
LOG_DBG("Unsupported power substate-id %u", info.state);
|
||||||
__fallthrough;
|
} else {
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
switch (info.substate_id) {
|
||||||
__fallthrough;
|
case 0: /* STOP0 */
|
||||||
case PM_STATE_STANDBY:
|
__fallthrough;
|
||||||
LL_LPM_DisableSleepOnExit();
|
case 1: /* STOP1 */
|
||||||
LL_LPM_EnableSleep();
|
__fallthrough;
|
||||||
break;
|
case 2: /* STOP2 */
|
||||||
default:
|
LL_LPM_DisableSleepOnExit();
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LL_LPM_EnableSleep();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
LOG_DBG("Unsupported power substate-id %u",
|
||||||
|
info.substate_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -17,11 +17,15 @@
|
||||||
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
if (info.state != PM_STATE_SUSPEND_TO_IDLE) {
|
||||||
case PM_STATE_RUNTIME_IDLE:
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (info.substate_id) {
|
||||||
|
case 0:
|
||||||
/* this corresponds to the STOP0 mode: */
|
/* this corresponds to the STOP0 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
/* Enable the Debug Module during STOP mode */
|
/* Enable the Debug Module during STOP mode */
|
||||||
|
@ -35,7 +39,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
/* enter SLEEP mode : WFE or WFI */
|
/* enter SLEEP mode : WFE or WFI */
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
case 1:
|
||||||
/* this corresponds to the STOP1 mode: */
|
/* this corresponds to the STOP1 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
/* Enable the Debug Module during STOP mode */
|
/* Enable the Debug Module during STOP mode */
|
||||||
|
@ -48,7 +52,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
LL_LPM_EnableDeepSleep();
|
LL_LPM_EnableDeepSleep();
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
case PM_STATE_STANDBY:
|
case 2:
|
||||||
/* this corresponds to the STOP2 mode: */
|
/* this corresponds to the STOP2 mode: */
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
/* Enable the Debug Module during STOP mode */
|
/* Enable the Debug Module during STOP mode */
|
||||||
|
@ -65,26 +69,31 @@ void pm_power_state_set(enum pm_state state)
|
||||||
k_cpu_idle();
|
k_cpu_idle();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power substate-id %u", info.substate_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
switch (state) {
|
if (info.state != PM_STATE_SUSPEND_TO_IDLE) {
|
||||||
case PM_STATE_RUNTIME_IDLE:
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
__fallthrough;
|
} else {
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
switch (info.substate_id) {
|
||||||
__fallthrough;
|
case 0: /* STOP0 */
|
||||||
case PM_STATE_STANDBY:
|
__fallthrough;
|
||||||
LL_LPM_DisableSleepOnExit();
|
case 1: /* STOP1 */
|
||||||
LL_LPM_EnableSleep();
|
__fallthrough;
|
||||||
break;
|
case 2: /* STOP2 */
|
||||||
default:
|
LL_LPM_DisableSleepOnExit();
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LL_LPM_EnableSleep();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
LOG_DBG("Unsupported power substate-id %u",
|
||||||
|
info.substate_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -56,12 +56,12 @@ extern PowerCC26X2_ModuleState PowerCC26X2_module;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Invoke Low Power/System Off specific Tasks */
|
/* Invoke Low Power/System Off specific Tasks */
|
||||||
void pm_power_state_set(enum pm_state state)
|
void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
uint32_t modeVIMS;
|
uint32_t modeVIMS;
|
||||||
uint32_t constraints;
|
uint32_t constraints;
|
||||||
|
|
||||||
LOG_DBG("SoC entering power state %d", state);
|
LOG_DBG("SoC entering power state %d", info.state);
|
||||||
|
|
||||||
/* Switch to using PRIMASK instead of BASEPRI register, since
|
/* Switch to using PRIMASK instead of BASEPRI register, since
|
||||||
* we are only able to wake up from standby while using PRIMASK.
|
* we are only able to wake up from standby while using PRIMASK.
|
||||||
|
@ -71,7 +71,7 @@ void pm_power_state_set(enum pm_state state)
|
||||||
/* Set BASEPRI to 0 */
|
/* Set BASEPRI to 0 */
|
||||||
irq_unlock(0);
|
irq_unlock(0);
|
||||||
|
|
||||||
switch (state) {
|
switch (info.state) {
|
||||||
case PM_STATE_SUSPEND_TO_IDLE:
|
case PM_STATE_SUSPEND_TO_IDLE:
|
||||||
/* query the declared constraints */
|
/* query the declared constraints */
|
||||||
constraints = Power_getConstraintMask();
|
constraints = Power_getConstraintMask();
|
||||||
|
@ -114,15 +114,15 @@ void pm_power_state_set(enum pm_state state)
|
||||||
Power_shutdown(0, 0);
|
Power_shutdown(0, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_DBG("Unsupported power state %u", state);
|
LOG_DBG("Unsupported power state %u", info.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("SoC leaving power state %d", state);
|
LOG_DBG("SoC leaving power state %d", info.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle SOC specific activity after Low Power Mode Exit */
|
/* Handle SOC specific activity after Low Power Mode Exit */
|
||||||
void pm_power_state_exit_post_ops(enum pm_state state)
|
void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* System is now in active mode. Reenable interrupts which were disabled
|
* System is now in active mode. Reenable interrupts which were disabled
|
||||||
|
|
|
@ -41,7 +41,7 @@ void pm_resume_devices(void);
|
||||||
/**
|
/**
|
||||||
* @brief Function to get the next PM state based on the ticks
|
* @brief Function to get the next PM state based on the ticks
|
||||||
*/
|
*/
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks);
|
struct pm_state_info pm_policy_next_state(int32_t ticks);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Function to determine whether to put devices in low
|
* @brief Function to determine whether to put devices in low
|
||||||
|
|
|
@ -12,36 +12,41 @@
|
||||||
#include <logging/log.h>
|
#include <logging/log.h>
|
||||||
LOG_MODULE_DECLARE(power, CONFIG_PM_LOG_LEVEL);
|
LOG_MODULE_DECLARE(power, CONFIG_PM_LOG_LEVEL);
|
||||||
|
|
||||||
|
#define STATE_ACTIVE \
|
||||||
|
(struct pm_state_info){PM_STATE_ACTIVE, 0, 0}
|
||||||
|
|
||||||
static const struct pm_state_info pm_dummy_states[] =
|
static const struct pm_state_info pm_dummy_states[] =
|
||||||
PM_STATE_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
PM_STATE_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
||||||
|
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks)
|
struct pm_state_info pm_policy_next_state(int32_t ticks)
|
||||||
{
|
{
|
||||||
static enum pm_state cur_power_state;
|
static struct pm_state_info cur_pm_state_info;
|
||||||
int i = (int)cur_power_state;
|
int i = (int)cur_pm_state_info.state;
|
||||||
uint8_t states_len = ARRAY_SIZE(pm_dummy_states);
|
uint8_t states_len = ARRAY_SIZE(pm_dummy_states);
|
||||||
|
|
||||||
if (states_len == 0) {
|
if (states_len == 0) {
|
||||||
/* No power states to go through. */
|
/* No power states to go through. */
|
||||||
return PM_STATE_ACTIVE;
|
return STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
i = (i + 1) % states_len;
|
i = (i + 1) % states_len;
|
||||||
|
|
||||||
#ifdef CONFIG_PM_STATE_LOCK
|
#ifdef CONFIG_PM_STATE_LOCK
|
||||||
if (!pm_ctrl_is_state_enabled(pm_dummy_states[i].state)) {
|
if (!pm_ctrl_is_state_enabled(
|
||||||
|
pm_dummy_states[i].state)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
cur_power_state = pm_dummy_states[i].state;
|
cur_pm_state_info = pm_dummy_states[i];
|
||||||
|
|
||||||
LOG_DBG("Selected power state: %u", pm_dummy_states[i].state);
|
LOG_DBG("Selected power state: %u", pm_dummy_states[i].state);
|
||||||
|
|
||||||
return pm_dummy_states[i].state;
|
return pm_dummy_states[i].state;
|
||||||
} while (pm_dummy_states[i].state != cur_power_state);
|
} while (pm_dummy_states[i].state != cur_pm_state_info.state);
|
||||||
|
|
||||||
LOG_DBG("No suitable power state found!");
|
LOG_DBG("No suitable power state found!");
|
||||||
return PM_STATE_ACTIVE;
|
return STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
||||||
|
|
|
@ -15,7 +15,7 @@ LOG_MODULE_DECLARE(power);
|
||||||
static const struct pm_state_info pm_min_residency[] =
|
static const struct pm_state_info pm_min_residency[] =
|
||||||
PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
||||||
|
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks)
|
struct pm_state_info pm_policy_next_state(int32_t ticks)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -32,12 +32,12 @@ enum pm_state pm_policy_next_state(int32_t ticks)
|
||||||
"(ticks: %d, min_residency: %u)",
|
"(ticks: %d, min_residency: %u)",
|
||||||
pm_min_residency[i].state, ticks,
|
pm_min_residency[i].state, ticks,
|
||||||
pm_min_residency[i].min_residency_us);
|
pm_min_residency[i].min_residency_us);
|
||||||
return pm_min_residency[i].state;
|
return pm_min_residency[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("No suitable power state found!");
|
LOG_DBG("No suitable power state found!");
|
||||||
return PM_STATE_ACTIVE;
|
return (struct pm_state_info){PM_STATE_ACTIVE, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
||||||
|
|
|
@ -25,13 +25,17 @@ LOG_MODULE_DECLARE(power);
|
||||||
/* Wakeup delay from standby in microseconds */
|
/* Wakeup delay from standby in microseconds */
|
||||||
#define WAKEDELAYSTANDBY 240
|
#define WAKEDELAYSTANDBY 240
|
||||||
|
|
||||||
|
#define STATE_ACTIVE \
|
||||||
|
(struct pm_state_info){PM_STATE_ACTIVE, 0, 0}
|
||||||
|
|
||||||
|
|
||||||
extern PowerCC26X2_ModuleState PowerCC26X2_module;
|
extern PowerCC26X2_ModuleState PowerCC26X2_module;
|
||||||
|
|
||||||
/* PM Policy based on SoC/Platform residency requirements */
|
/* PM Policy based on SoC/Platform residency requirements */
|
||||||
static const struct pm_state_info residency_info[] =
|
static const struct pm_state_info residency_info[] =
|
||||||
PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
PM_STATE_INFO_DT_ITEMS_LIST(DT_NODELABEL(cpu0));
|
||||||
|
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks)
|
struct pm_state_info pm_policy_next_state(int32_t ticks)
|
||||||
{
|
{
|
||||||
uint32_t constraints;
|
uint32_t constraints;
|
||||||
bool disallowed = false;
|
bool disallowed = false;
|
||||||
|
@ -46,7 +50,7 @@ enum pm_state pm_policy_next_state(int32_t ticks)
|
||||||
if ((ticks != K_TICKS_FOREVER) && (ticks <
|
if ((ticks != K_TICKS_FOREVER) && (ticks <
|
||||||
k_us_to_ticks_ceil32(residency_info[0].min_residency_us))) {
|
k_us_to_ticks_ceil32(residency_info[0].min_residency_us))) {
|
||||||
LOG_DBG("Not enough time for PM operations: %d", ticks);
|
LOG_DBG("Not enough time for PM operations: %d", ticks);
|
||||||
return PM_STATE_ACTIVE;
|
return STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = ARRAY_SIZE(residency_info) - 1; i >= 0; i--) {
|
for (i = ARRAY_SIZE(residency_info) - 1; i >= 0; i--) {
|
||||||
|
@ -127,14 +131,14 @@ enum pm_state pm_policy_next_state(int32_t ticks)
|
||||||
residency_info[i].state, ticks,
|
residency_info[i].state, ticks,
|
||||||
k_us_to_ticks_ceil32(
|
k_us_to_ticks_ceil32(
|
||||||
residency_info[i].min_residency_us));
|
residency_info[i].min_residency_us));
|
||||||
return residency_info[i].state;
|
return residency_info[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("No suitable power state found!");
|
LOG_DBG("No suitable power state found!");
|
||||||
return PM_STATE_ACTIVE;
|
return STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
__weak bool pm_policy_low_power_devices(enum pm_state state)
|
||||||
{
|
{
|
||||||
return state == PM_STATE_STANDBY;
|
return state == PM_STATE_STANDBY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ LOG_MODULE_REGISTER(power);
|
||||||
|
|
||||||
static int post_ops_done = 1;
|
static int post_ops_done = 1;
|
||||||
static bool z_forced_power_state;
|
static bool z_forced_power_state;
|
||||||
static enum pm_state z_power_state;
|
static struct pm_state_info z_power_state;
|
||||||
static sys_slist_t pm_notifiers = SYS_SLIST_STATIC_INIT(&pm_notifiers);
|
static sys_slist_t pm_notifiers = SYS_SLIST_STATIC_INIT(&pm_notifiers);
|
||||||
static struct k_spinlock pm_notifier_lock;
|
static struct k_spinlock pm_notifier_lock;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ static void pm_log_debug_info(enum pm_state state) { }
|
||||||
void pm_dump_debug_info(void) { }
|
void pm_dump_debug_info(void) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__weak void pm_power_state_exit_post_ops(enum pm_state state)
|
__weak void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This function is supposed to be overridden to do SoC or
|
* This function is supposed to be overridden to do SoC or
|
||||||
|
@ -76,7 +76,7 @@ __weak void pm_power_state_exit_post_ops(enum pm_state state)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void pm_power_state_set(enum pm_state state)
|
__weak void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This function is supposed to be overridden to do SoC or
|
* This function is supposed to be overridden to do SoC or
|
||||||
|
@ -84,18 +84,18 @@ __weak void pm_power_state_set(enum pm_state state)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void pm_power_state_force(enum pm_state state)
|
void pm_power_state_force(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
__ASSERT(state < PM_STATES_LEN,
|
__ASSERT(info.state < PM_STATES_LEN,
|
||||||
"Invalid power state %d!", state);
|
"Invalid power state %d!", info.state);
|
||||||
|
|
||||||
#ifdef CONFIG_PM_DIRECT_FORCE_MODE
|
#ifdef CONFIG_PM_DIRECT_FORCE_MODE
|
||||||
(void)arch_irq_lock();
|
(void)arch_irq_lock();
|
||||||
z_forced_power_state = true;
|
z_forced_power_state = true;
|
||||||
z_power_state = state;
|
z_power_state = info;
|
||||||
pm_system_suspend(K_TICKS_FOREVER);
|
pm_system_suspend(K_TICKS_FOREVER);
|
||||||
#else
|
#else
|
||||||
z_power_state = state;
|
z_power_state = info;
|
||||||
z_forced_power_state = true;
|
z_forced_power_state = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -119,20 +119,20 @@ static inline void pm_state_notify(bool entering_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(z_power_state);
|
callback(z_power_state.state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k_spin_unlock(&pm_notifier_lock, pm_notifier_key);
|
k_spin_unlock(&pm_notifier_lock, pm_notifier_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum pm_state _handle_device_abort(enum pm_state state)
|
static enum pm_state _handle_device_abort(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
LOG_DBG("Some devices didn't enter suspend state!");
|
LOG_DBG("Some devices didn't enter suspend state!");
|
||||||
pm_resume_devices();
|
pm_resume_devices();
|
||||||
pm_state_notify(false);
|
pm_state_notify(false);
|
||||||
|
|
||||||
z_power_state = PM_STATE_ACTIVE;
|
z_power_state.state = PM_STATE_ACTIVE;
|
||||||
return z_power_state;
|
return PM_STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum pm_state pm_policy_mgr(int32_t ticks)
|
static enum pm_state pm_policy_mgr(int32_t ticks)
|
||||||
|
@ -146,12 +146,12 @@ static enum pm_state pm_policy_mgr(int32_t ticks)
|
||||||
z_power_state = pm_policy_next_state(ticks);
|
z_power_state = pm_policy_next_state(ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z_power_state == PM_STATE_ACTIVE) {
|
if (z_power_state.state == PM_STATE_ACTIVE) {
|
||||||
LOG_DBG("No PM operations done.");
|
LOG_DBG("No PM operations done.");
|
||||||
return z_power_state;
|
return z_power_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
deep_sleep = pm_is_deep_sleep_state(z_power_state);
|
deep_sleep = pm_is_deep_sleep_state(z_power_state.state);
|
||||||
|
|
||||||
post_ops_done = 0;
|
post_ops_done = 0;
|
||||||
pm_state_notify(true);
|
pm_state_notify(true);
|
||||||
|
@ -168,7 +168,7 @@ static enum pm_state pm_policy_mgr(int32_t ticks)
|
||||||
pm_idle_exit_notification_disable();
|
pm_idle_exit_notification_disable();
|
||||||
#if CONFIG_PM_DEVICE
|
#if CONFIG_PM_DEVICE
|
||||||
} else {
|
} else {
|
||||||
if (pm_policy_low_power_devices(z_power_state)) {
|
if (pm_policy_low_power_devices(z_power_state.state)) {
|
||||||
/* low power peripherals. */
|
/* low power peripherals. */
|
||||||
if (pm_low_power_devices()) {
|
if (pm_low_power_devices()) {
|
||||||
return _handle_device_abort(z_power_state);
|
return _handle_device_abort(z_power_state);
|
||||||
|
@ -191,7 +191,7 @@ static enum pm_state pm_policy_mgr(int32_t ticks)
|
||||||
pm_resume_devices();
|
pm_resume_devices();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pm_log_debug_info(z_power_state);
|
pm_log_debug_info(z_power_state.state);
|
||||||
|
|
||||||
if (!post_ops_done) {
|
if (!post_ops_done) {
|
||||||
post_ops_done = 1;
|
post_ops_done = 1;
|
||||||
|
@ -201,7 +201,7 @@ static enum pm_state pm_policy_mgr(int32_t ticks)
|
||||||
pm_power_state_exit_post_ops(z_power_state);
|
pm_power_state_exit_post_ops(z_power_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return z_power_state;
|
return z_power_state.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,20 +26,20 @@ static void tdata_dump_callback(const struct k_thread *thread, void *user_data)
|
||||||
* Weak power hook functions. Used on systems that have not implemented
|
* Weak power hook functions. Used on systems that have not implemented
|
||||||
* power management.
|
* power management.
|
||||||
*/
|
*/
|
||||||
__weak void pm_power_state_set(enum pm_state state)
|
__weak void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/* Never called. */
|
/* Never called. */
|
||||||
__ASSERT_NO_MSG(false);
|
__ASSERT_NO_MSG(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void pm_power_state_exit_post_ops(enum pm_state state)
|
__weak void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/* Never called. */
|
/* Never called. */
|
||||||
__ASSERT_NO_MSG(false);
|
__ASSERT_NO_MSG(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Our PM policy handler */
|
/* Our PM policy handler */
|
||||||
enum pm_state pm_policy_next_state(int32_t ticks)
|
struct pm_state_info pm_policy_next_state(int32_t ticks)
|
||||||
{
|
{
|
||||||
static bool test_flag;
|
static bool test_flag;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ enum pm_state pm_policy_next_state(int32_t ticks)
|
||||||
test_flag = true;
|
test_flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PM_STATE_ACTIVE;
|
return (struct pm_state_info){PM_STATE_ACTIVE, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*work handler*/
|
/*work handler*/
|
||||||
|
|
|
@ -30,7 +30,7 @@ static struct dummy_driver_api *api;
|
||||||
* Weak power hook functions. Used on systems that have not implemented
|
* Weak power hook functions. Used on systems that have not implemented
|
||||||
* power management.
|
* power management.
|
||||||
*/
|
*/
|
||||||
__weak void pm_power_state_set(enum pm_state state)
|
__weak void pm_power_state_set(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/* at this point, notify_pm_state_entry() implemented in
|
/* at this point, notify_pm_state_entry() implemented in
|
||||||
* this file has been called and set_pm should have been set
|
* this file has been called and set_pm should have been set
|
||||||
|
@ -47,11 +47,11 @@ __weak void pm_power_state_set(enum pm_state state)
|
||||||
/* this function is called when system entering low power state, so
|
/* this function is called when system entering low power state, so
|
||||||
* parameter state should not be POWER_STATE_ACTIVE
|
* parameter state should not be POWER_STATE_ACTIVE
|
||||||
*/
|
*/
|
||||||
zassert_false(state == PM_STATE_ACTIVE,
|
zassert_false(info.state == PM_STATE_ACTIVE,
|
||||||
"Entering low power state with a wrong parameter");
|
"Entering low power state with a wrong parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void pm_power_state_exit_post_ops(enum pm_state state)
|
__weak void pm_power_state_exit_post_ops(struct pm_state_info info)
|
||||||
{
|
{
|
||||||
/* pm_system_suspend is entered with irq locked
|
/* pm_system_suspend is entered with irq locked
|
||||||
* unlock irq before leave pm_system_suspend
|
* unlock irq before leave pm_system_suspend
|
||||||
|
@ -65,9 +65,9 @@ __weak bool pm_policy_low_power_devices(enum pm_state state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Our PM policy handler */
|
/* Our PM policy handler */
|
||||||
enum pm_state pm_policy_next_state(int ticks)
|
struct pm_state_info pm_policy_next_state(int ticks)
|
||||||
{
|
{
|
||||||
enum pm_state state;
|
struct pm_state_info info;
|
||||||
|
|
||||||
/* make sure this is idle thread */
|
/* make sure this is idle thread */
|
||||||
zassert_true(z_is_idle_thread_object(_current), NULL);
|
zassert_true(z_is_idle_thread_object(_current), NULL);
|
||||||
|
@ -77,14 +77,14 @@ enum pm_state pm_policy_next_state(int ticks)
|
||||||
if (enter_low_power) {
|
if (enter_low_power) {
|
||||||
enter_low_power = false;
|
enter_low_power = false;
|
||||||
notify_app_entry = true;
|
notify_app_entry = true;
|
||||||
state = PM_STATE_RUNTIME_IDLE;
|
info.state = PM_STATE_RUNTIME_IDLE;
|
||||||
} else {
|
} else {
|
||||||
/* only test pm_policy_next_state()
|
/* only test pm_policy_next_state()
|
||||||
* no PM operation done
|
* no PM operation done
|
||||||
*/
|
*/
|
||||||
state = PM_STATE_ACTIVE;
|
info.state = PM_STATE_ACTIVE;
|
||||||
}
|
}
|
||||||
return state;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* implement in application, called by idle thread */
|
/* implement in application, called by idle thread */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue