power: Remove PM_STATE_LOCK option

Simplify pm subsystem removing PM_STATE_LOCK option. Constraints API is
small and is a key component of power subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-01-25 20:32:57 -08:00 committed by Anas Nashif
commit 86a624e2a2
8 changed files with 4 additions and 19 deletions

View file

@ -160,7 +160,6 @@ void pm_dump_debug_info(void);
#endif /* CONFIG_PM_DEBUG */
#ifdef CONFIG_PM_STATE_LOCK
/**
* @brief Disable particular power state
*
@ -195,7 +194,6 @@ void pm_constraint_release(enum pm_state state);
*/
bool pm_constraint_get(enum pm_state state);
#endif /* CONFIG_PM_STATE_LOCK */
/**
* @}

View file

@ -1,5 +1,4 @@
CONFIG_PM=y
# Required to disable default behavior of deep sleep on timeout
CONFIG_PM_STATE_LOCK=y
CONFIG_PM_DEVICE=y
CONFIG_GPIO=y

View file

@ -12,6 +12,5 @@ config SOC_SERIES_CC13X2_CC26X2
select SOC_FAMILY_TISIMPLELINK
select HAS_CC13X2_CC26X2_SDK
select HAS_TI_CCFG
select PM_STATE_LOCK if PM
help
Enable support for TI SimpleLink CC13x2 / CC26x2 SoCs

View file

@ -1,8 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(CONFIG_PM power.c)
zephyr_sources_ifdef(CONFIG_PM pm_ctrl.c)
zephyr_sources_ifdef(CONFIG_PM_DEVICE device.c)
zephyr_sources_ifdef(CONFIG_PM_STATE_LOCK pm_ctrl.c)
zephyr_sources_ifdef(CONFIG_PM_DEVICE_IDLE device_pm.c)
zephyr_sources_ifdef(CONFIG_REBOOT reboot.c)
add_subdirectory(policy)

View file

@ -22,14 +22,6 @@ menuconfig PM
if PM
config PM_STATE_LOCK
bool "Power State locking capability"
help
Enable Power Management system state locking capability
if any application wants to temporarily disable certain
Power States while doing any critical work or needs quick
response from hardware resources.
config PM_DIRECT_FORCE_MODE
bool "System power management direct force trigger mode"
help

View file

@ -32,12 +32,11 @@ struct pm_state_info pm_policy_next_state(int32_t ticks)
do {
i = (i + 1) % states_len;
#ifdef CONFIG_PM_STATE_LOCK
if (!pm_constraint_get(
pm_dummy_states[i].state)) {
continue;
}
#endif
cur_pm_state_info = pm_dummy_states[i];
LOG_DBG("Selected power state: %u", pm_dummy_states[i].state);

View file

@ -20,11 +20,10 @@ struct pm_state_info pm_policy_next_state(int32_t ticks)
int i;
for (i = ARRAY_SIZE(pm_min_residency) - 1; i >= 0; i--) {
#ifdef CONFIG_PM_STATE_LOCK
if (!pm_constraint_get(pm_min_residency[i].state)) {
continue;
}
#endif
if ((ticks == K_TICKS_FOREVER) ||
(ticks >= k_us_to_ticks_ceil32(
pm_min_residency[i].min_residency_us))) {

View file

@ -54,11 +54,10 @@ struct pm_state_info pm_policy_next_state(int32_t ticks)
}
for (i = ARRAY_SIZE(residency_info) - 1; i >= 0; i--) {
#ifdef CONFIG_PM_STATE_LOCK
if (!pm_constraint_get(residency_info[i].state)) {
continue;
}
#endif
if ((ticks <
k_us_to_ticks_ceil32(residency_info[i].min_residency_us))
&& (ticks != K_TICKS_FOREVER)) {