power: Remove sys_is_valid_power_state() interface

Each platform is now specifying list of supported power states
as a Kconfig options. Some of the specified states could be
disabled in runtime. As result there is no need for the removed
interface.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
Piotr Zięcik 2019-01-09 13:15:48 +01:00 committed by Carles Cufí
commit 28576260c3
6 changed files with 0 additions and 100 deletions

View file

@ -50,42 +50,3 @@ void sys_power_state_post_ops(enum power_states state)
irq_unlock(0);
}
bool sys_is_valid_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATE
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_SUPPORTED
case SYS_POWER_STATE_CPU_LPS:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_1_SUPPORTED
case SYS_POWER_STATE_CPU_LPS_1:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_2_SUPPORTED
case SYS_POWER_STATE_CPU_LPS_2:
return true;
#endif
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATE */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_1_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP_1:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_2_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP_2:
return true;
#endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP */
default:
return false;
}
/* Not reached */
}

View file

@ -24,11 +24,6 @@ extern "C" {
*/
void sys_set_power_state(enum power_states state);
/**
* @brief Check the low power state is supported by SoC
*/
bool sys_is_valid_power_state(enum power_states state);
/**
* @brief Do any SoC or architecture specific post ops after low power states.
*/

View file

@ -50,42 +50,3 @@ void sys_power_state_post_ops(enum power_states state)
irq_unlock(0);
}
bool sys_is_valid_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATE
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_SUPPORTED
case SYS_POWER_STATE_CPU_LPS:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_1_SUPPORTED
case SYS_POWER_STATE_CPU_LPS_1:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_CPU_LPS_2_SUPPORTED
case SYS_POWER_STATE_CPU_LPS_2:
return true;
#endif
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATE */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_1_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP_1:
return true;
#endif
#ifdef CONFIG_SYS_POWER_STATE_DEEP_SLEEP_2_SUPPORTED
case SYS_POWER_STATE_DEEP_SLEEP_2:
return true;
#endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP */
default:
return false;
}
/* Not reached */
}

View file

@ -24,11 +24,6 @@ extern "C" {
*/
void sys_set_power_state(enum power_states state);
/**
* @brief Check the low power state is supported by SoC
*/
bool sys_is_valid_power_state(enum power_states state);
/**
* @brief Do any SoC or architecture specific post ops after low power states.
*/

View file

@ -62,12 +62,6 @@ int sys_pm_policy_next_state(s32_t ticks, enum power_states *pm_state)
cur_pm_idx = 0;
}
if (!sys_is_valid_power_state(pm_policy[cur_pm_idx].pm_state)) {
LOG_ERR("pm_state(%d) not supported by SoC\n",
pm_policy[cur_pm_idx].pm_state);
return SYS_PM_NOT_HANDLED;
}
*pm_state = pm_policy[cur_pm_idx].pm_state;
LOG_DBG("pm_state: %d, idx: %d\n", *pm_state, cur_pm_idx);

View file

@ -79,12 +79,6 @@ int sys_pm_policy_next_state(s32_t ticks, enum power_states *pm_state)
}
}
if (!sys_is_valid_power_state(pm_policy[i].pm_state)) {
LOG_ERR("pm_state(%d) not supported by SoC\n",
pm_policy[i].pm_state);
return SYS_PM_NOT_HANDLED;
}
*pm_state = pm_policy[i].pm_state;
LOG_DBG("ticks: %d, pm_state: %d, min_residency: %d, idx: %d\n",
ticks, *pm_state, pm_policy[i].min_residency, i);