Skip to content

Commit

Permalink
power: rename residency policy Kconfig options
Browse files Browse the repository at this point in the history
Rename power managment subsystem Kconfig options describing minimum
residency to make them easier to identify with respective policy.

Following is a detailed list of string replacements used:
s/SYS_PM_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_SLEEP_$1/
s/SYS_PM_DEEP_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
  • Loading branch information
mnkp authored and nashif committed Mar 26, 2019
1 parent a3082e4 commit 155e11c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions samples/boards/nrf52/power_mgr/prj.conf
Expand Up @@ -5,6 +5,6 @@ CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_SYS_PM_STATE_LOCK=y
CONFIG_SYS_PM_SLEEP_1_MIN_RES=5000
CONFIG_SYS_PM_SLEEP_2_MIN_RES=15000
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1=5000
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_2=15000
CONFIG_GPIO=y
12 changes: 6 additions & 6 deletions subsys/power/policy/Kconfig
Expand Up @@ -22,47 +22,47 @@ endchoice

if SYS_PM_POLICY_RESIDENCY

config SYS_PM_SLEEP_1_MIN_RES
config SYS_PM_MIN_RESIDENCY_SLEEP_1
int "Sleep State 1 minimum residency"
depends on HAS_SYS_POWER_STATE_SLEEP_1
default 5000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_1
state.

config SYS_PM_SLEEP_2_MIN_RES
config SYS_PM_MIN_RESIDENCY_SLEEP_2
int "Sleep State 2 minimum residency"
depends on HAS_SYS_POWER_STATE_SLEEP_2
default 10000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_2
state.

config SYS_PM_SLEEP_3_MIN_RES
config SYS_PM_MIN_RESIDENCY_SLEEP_3
int "Sleep State 3 minimum residency"
depends on HAS_SYS_POWER_STATE_SLEEP_3
default 30000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_3
state.

config SYS_PM_DEEP_SLEEP_1_MIN_RES
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
int "Deep Sleep State 1 minimum residency"
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_1
default 60000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_DEEP_SLEEP_1
state.

config SYS_PM_DEEP_SLEEP_2_MIN_RES
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_2
int "Deep Sleep State 2 minimum residency"
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_2
default 90000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_DEEP_SLEEP_2
state.

config SYS_PM_DEEP_SLEEP_3_MIN_RES
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_3
int "Deep Sleep State 3 minimum residency"
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_3
default 120000
Expand Down
12 changes: 6 additions & 6 deletions subsys/power/policy/policy_residency.c
Expand Up @@ -18,29 +18,29 @@ LOG_MODULE_DECLARE(power);
static const unsigned int pm_min_residency[] = {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
CONFIG_SYS_PM_SLEEP_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif

#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
CONFIG_SYS_PM_SLEEP_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_2 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif

#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
CONFIG_SYS_PM_SLEEP_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */

#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
CONFIG_SYS_PM_DEEP_SLEEP_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif

#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
CONFIG_SYS_PM_DEEP_SLEEP_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_2 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif

#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
CONFIG_SYS_PM_DEEP_SLEEP_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
};
Expand Down

0 comments on commit 155e11c

Please sign in to comment.