power: modify HAS_STATE_SLEEP_ Kconfig options

Add SYS_POWER_ prefix to HAS_STATE_SLEEP_, HAS_STATE_DEEP_SLEEP_
options to align them with names of power states they control.
Following is a detailed list of string replacements used:
s/HAS_STATE_SLEEP_(\d)/HAS_SYS_POWER_STATE_SLEEP_$1/
s/HAS_STATE_DEEP_SLEEP_(\d)/HAS_SYS_POWER_STATE_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
Piotr Mienkowski 2019-03-16 20:55:56 +01:00 committed by Anas Nashif
parent 17b08ceca5
commit a3082e49a1
18 changed files with 71 additions and 68 deletions

View file

@ -351,42 +351,42 @@ config ARCH_HAS_THREAD_ABORT
# Hidden PM feature configs which are to be selected by
# individual SoC.
#
config HAS_STATE_SLEEP_1
config HAS_SYS_POWER_STATE_SLEEP_1
# Hidden
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_1
configuration option.
config HAS_STATE_SLEEP_2
config HAS_SYS_POWER_STATE_SLEEP_2
# Hidden
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_2
configuration option.
config HAS_STATE_SLEEP_3
config HAS_SYS_POWER_STATE_SLEEP_3
# Hidden
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_3
configuration option.
config HAS_STATE_DEEP_SLEEP_1
config HAS_SYS_POWER_STATE_DEEP_SLEEP_1
# Hidden
bool
help
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_1
configuration option.
config HAS_STATE_DEEP_SLEEP_2
config HAS_SYS_POWER_STATE_DEEP_SLEEP_2
# Hidden
bool
help
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_2
configuration option.
config HAS_STATE_DEEP_SLEEP_3
config HAS_SYS_POWER_STATE_DEEP_SLEEP_3
# Hidden
bool
help

View file

@ -27,25 +27,25 @@ enum power_states {
SYS_POWER_STATE_AUTO = (-2),
SYS_POWER_STATE_ACTIVE = (-1),
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_SLEEP_1
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
SYS_POWER_STATE_SLEEP_1,
# endif
# ifdef CONFIG_HAS_STATE_SLEEP_2
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
SYS_POWER_STATE_SLEEP_2,
# endif
# ifdef CONFIG_HAS_STATE_SLEEP_3
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
SYS_POWER_STATE_SLEEP_3,
# endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
SYS_POWER_STATE_DEEP_SLEEP_1,
# endif
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_2
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
SYS_POWER_STATE_DEEP_SLEEP_2,
# endif
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_3
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
SYS_POWER_STATE_DEEP_SLEEP_3,
# endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
@ -75,15 +75,15 @@ static inline bool sys_pm_is_sleep_state(enum power_states state)
switch (state) {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_SLEEP_1
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
case SYS_POWER_STATE_SLEEP_1:
break;
# endif
# ifdef CONFIG_HAS_STATE_SLEEP_2
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
case SYS_POWER_STATE_SLEEP_2:
break;
# endif
# ifdef CONFIG_HAS_STATE_SLEEP_3
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
case SYS_POWER_STATE_SLEEP_3:
break;
# endif
@ -107,15 +107,15 @@ static inline bool sys_pm_is_deep_sleep_state(enum power_states state)
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
break;
# endif
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_2
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
case SYS_POWER_STATE_DEEP_SLEEP_2:
break;
# endif
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_3
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
case SYS_POWER_STATE_DEEP_SLEEP_3:
break;
# endif

View file

@ -17,7 +17,9 @@ menuconfig SYS_POWER_MANAGEMENT
if SYS_POWER_MANAGEMENT
config SYS_POWER_SLEEP_STATES
bool "Low Power states"
depends on HAS_STATE_SLEEP_1 || HAS_STATE_SLEEP_2 || HAS_STATE_SLEEP_3
depends on HAS_SYS_POWER_STATE_SLEEP_1 || \
HAS_SYS_POWER_STATE_SLEEP_2 || \
HAS_SYS_POWER_STATE_SLEEP_3
help
This option enables the kernel to interface with a power manager
application. This permits the system to enter a custom CPU low power
@ -27,8 +29,9 @@ config SYS_POWER_SLEEP_STATES
config SYS_POWER_DEEP_SLEEP_STATES
bool "Deep Sleep states"
depends on HAS_STATE_DEEP_SLEEP_1 || HAS_STATE_DEEP_SLEEP_2 || \
HAS_STATE_DEEP_SLEEP_3
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_1 || \
HAS_SYS_POWER_STATE_DEEP_SLEEP_2 || \
HAS_SYS_POWER_STATE_DEEP_SLEEP_3
help
This option enables the kernel to interface with a power manager
application. This permits the system to enter a Deep sleep state

View file

@ -1,8 +1,8 @@
config NRF5_POWER_MGMT_EXAMPLE
bool
default y
select HAS_STATE_SLEEP_2
select HAS_STATE_SLEEP_3
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_3
help
Hidden option enabling LPS_1 and LPS_2 low power states.
This is needed, as these states are implemented by this example.

View file

@ -1,9 +1,9 @@
config SOC_QUARK_SE_C1000_SS
bool "Intel Quark SE C1000- Sensor Sub System"
select HAS_STATE_SLEEP_1
select HAS_STATE_SLEEP_2
select HAS_STATE_DEEP_SLEEP_1
select HAS_STATE_DEEP_SLEEP_2
select HAS_STATE_DEEP_SLEEP_3
select HAS_SYS_POWER_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_SYS_POWER_STATE_DEEP_SLEEP_2
select HAS_SYS_POWER_STATE_DEEP_SLEEP_3
select HAS_QMSI
select HAS_SPI_DW

View file

@ -12,7 +12,7 @@ config SOC_SERIES_NRF51X
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_STATE_DEEP_SLEEP_1
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS
select HAS_NRFX

View file

@ -15,7 +15,7 @@ void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_power_system_off();
break;
@ -32,7 +32,7 @@ void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

View file

@ -13,7 +13,7 @@ config SOC_SERIES_NRF52X
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_STATE_DEEP_SLEEP_1
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS
select HAS_NRFX

View file

@ -15,7 +15,7 @@ void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_power_system_off();
break;
@ -32,7 +32,7 @@ void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

View file

@ -15,7 +15,7 @@ config SOC_SERIES_NRF91X
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_STATE_DEEP_SLEEP_1
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS
select HAS_NRFX

View file

@ -36,21 +36,21 @@ void sys_set_power_state(enum power_states state)
switch (state) {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
case SYS_POWER_STATE_SLEEP_1:
EMU_EnterEM1();
break;
#endif /* CONFIG_HAS_STATE_SLEEP_1 */
#ifdef CONFIG_HAS_STATE_SLEEP_2
#endif /* CONFIG_HAS_SYS_POWER_STATE_SLEEP_1 */
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
case SYS_POWER_STATE_SLEEP_2:
EMU_EnterEM2(true);
break;
#endif /* CONFIG_HAS_STATE_SLEEP_2 */
#ifdef CONFIG_HAS_STATE_SLEEP_3
#endif /* CONFIG_HAS_SYS_POWER_STATE_SLEEP_2 */
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
case SYS_POWER_STATE_SLEEP_3:
EMU_EnterEM3(true);
break;
#endif /* CONFIG_HAS_STATE_SLEEP_3 */
#endif /* CONFIG_HAS_SYS_POWER_STATE_SLEEP_3 */
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
default:
LOG_ERR("Unsupported power state %u", state);

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFM32PG12B
select CPU_HAS_FPU
select SOC_FAMILY_EXX32
select CPU_HAS_SYSTICK
select HAS_STATE_SLEEP_1
select HAS_STATE_SLEEP_2
select HAS_STATE_SLEEP_3
select HAS_SYS_POWER_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU
select SOC_GECKO_EMU

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFR32FG1P
select CPU_HAS_FPU
select SOC_FAMILY_EXX32
select CPU_HAS_SYSTICK
select HAS_STATE_SLEEP_1
select HAS_STATE_SLEEP_2
select HAS_STATE_SLEEP_3
select HAS_SYS_POWER_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU
select SOC_GECKO_GPIO

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFR32MG12P
select CPU_HAS_SYSTICK
select HAS_SILABS_GECKO
select HAS_SWO
select HAS_STATE_SLEEP_1
select HAS_STATE_SLEEP_2
select HAS_STATE_SLEEP_3
select HAS_SYS_POWER_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU
select SOC_GECKO_EMU

View file

@ -11,11 +11,11 @@ config SOC_SERIES_QUARK_SE
select LOAPIC
select LOAPIC_TIMER
select XIP
select HAS_STATE_SLEEP_1
select HAS_STATE_SLEEP_2
select HAS_STATE_SLEEP_3
select HAS_STATE_DEEP_SLEEP_1
select HAS_STATE_DEEP_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_2
select HAS_SYS_POWER_STATE_SLEEP_3
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_SYS_POWER_STATE_DEEP_SLEEP_2
select BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
select HAS_QMSI
help

View file

@ -24,7 +24,7 @@ if SYS_PM_POLICY_RESIDENCY
config SYS_PM_SLEEP_1_MIN_RES
int "Sleep State 1 minimum residency"
depends on HAS_STATE_SLEEP_1
depends on HAS_SYS_POWER_STATE_SLEEP_1
default 5000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_1
@ -32,7 +32,7 @@ config SYS_PM_SLEEP_1_MIN_RES
config SYS_PM_SLEEP_2_MIN_RES
int "Sleep State 2 minimum residency"
depends on HAS_STATE_SLEEP_2
depends on HAS_SYS_POWER_STATE_SLEEP_2
default 10000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_2
@ -40,7 +40,7 @@ config SYS_PM_SLEEP_2_MIN_RES
config SYS_PM_SLEEP_3_MIN_RES
int "Sleep State 3 minimum residency"
depends on HAS_STATE_SLEEP_3
depends on HAS_SYS_POWER_STATE_SLEEP_3
default 30000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_3
@ -48,7 +48,7 @@ config SYS_PM_SLEEP_3_MIN_RES
config SYS_PM_DEEP_SLEEP_1_MIN_RES
int "Deep Sleep State 1 minimum residency"
depends on HAS_STATE_DEEP_SLEEP_1
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_1
default 60000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_DEEP_SLEEP_1
@ -56,7 +56,7 @@ config SYS_PM_DEEP_SLEEP_1_MIN_RES
config SYS_PM_DEEP_SLEEP_2_MIN_RES
int "Deep Sleep State 2 minimum residency"
depends on HAS_STATE_DEEP_SLEEP_2
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_2
default 90000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_DEEP_SLEEP_2
@ -64,7 +64,7 @@ config SYS_PM_DEEP_SLEEP_2_MIN_RES
config SYS_PM_DEEP_SLEEP_3_MIN_RES
int "Deep Sleep State 3 minimum residency"
depends on HAS_STATE_DEEP_SLEEP_3
depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_3
default 120000
help
Minimum residency in milliseconds to enter SYS_POWER_STATE_DEEP_SLEEP_3

View file

@ -17,29 +17,29 @@ LOG_MODULE_DECLARE(power);
/* PM Policy based on SoC/Platform residency requirements */
static const unsigned int pm_min_residency[] = {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
CONFIG_SYS_PM_SLEEP_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_STATE_SLEEP_2
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
CONFIG_SYS_PM_SLEEP_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_STATE_SLEEP_3
#ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
CONFIG_SYS_PM_SLEEP_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
CONFIG_SYS_PM_DEEP_SLEEP_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_2
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
CONFIG_SYS_PM_DEEP_SLEEP_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_3
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
CONFIG_SYS_PM_DEEP_SLEEP_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */

View file

@ -1,7 +1,7 @@
config KERNEL_PROFILING_API_TEST
bool
default y
select HAS_STATE_SLEEP_1
select HAS_SYS_POWER_STATE_SLEEP_1
help
Hidden option enabling LPS_0 power state regardless of hardware
support. This ensures that power management hooks used in this