Browse Source

power: standarize PM Kconfigs and cleanup

- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
pull/30568/head
Anas Nashif 5 years ago
parent
commit
dd931f93a2
  1. 2
      Kconfig.zephyr
  2. 12
      arch/Kconfig
  3. 4
      arch/arc/core/isr_wrapper.S
  4. 2
      arch/arc/core/reset.S
  5. 2
      arch/arm/core/aarch32/irq_manage.c
  6. 4
      arch/arm/core/aarch32/isr_wrapper.S
  7. 2
      arch/posix/core/swap.c
  8. 4
      arch/x86/core/ia32/crt0.S
  9. 10
      arch/x86/core/ia32/intstub.S
  10. 8
      boards/arm/cc1352r1_launchxl/Kconfig.defconfig
  11. 8
      boards/arm/cc1352r1_launchxl/doc/index.rst
  12. 8
      boards/arm/cc1352r_sensortag/Kconfig.defconfig
  13. 8
      boards/arm/cc1352r_sensortag/doc/index.rst
  14. 8
      boards/arm/cc26x2r1_launchxl/Kconfig.defconfig
  15. 8
      boards/arm/cc26x2r1_launchxl/doc/index.rst
  16. 8
      boards/arm/mec1501modular_assy6885/Kconfig.defconfig
  17. 2
      boards/arm/mec1501modular_assy6885/pinmux.c
  18. 8
      boards/arm/mec15xxevb_assy6853/Kconfig.defconfig
  19. 2
      boards/arm/mec15xxevb_assy6853/pinmux.c
  20. 2
      boards/posix/native_posix/board_irq.h
  21. 2
      boards/posix/native_posix/irq_handler.c
  22. 2
      boards/posix/nrf52_bsim/board_irq.h
  23. 2
      boards/posix/nrf52_bsim/irq_handler.c
  24. 12
      doc/reference/power_management/index.rst
  25. 6
      doc/zephyr.doxyfile.in
  26. 8
      drivers/display/display_st7789v.c
  27. 26
      drivers/entropy/entropy_cc13xx_cc26xx.c
  28. 2
      drivers/ethernet/Kconfig.mcux
  29. 8
      drivers/flash/spi_flash_at45.c
  30. 2
      drivers/gpio/gpio_cc13xx_cc26xx.c
  31. 4
      drivers/gpio/gpio_dw.c
  32. 2
      drivers/gpio/gpio_dw.h
  33. 24
      drivers/i2c/i2c_cc13xx_cc26xx.c
  34. 8
      drivers/i2c/i2c_nrfx_twi.c
  35. 8
      drivers/i2c/i2c_nrfx_twim.c
  36. 6
      drivers/interrupt_controller/intc_arcv2_irq_unit.c
  37. 8
      drivers/interrupt_controller/intc_ioapic.c
  38. 6
      drivers/interrupt_controller/intc_loapic.c
  39. 4
      drivers/modem/hl7800.c
  40. 4
      drivers/pwm/pwm_nrfx.c
  41. 2
      drivers/sensor/apds9960/apds9960.c
  42. 6
      drivers/sensor/lis2mdl/lis2mdl.c
  43. 2
      drivers/sensor/lis2mdl/lis2mdl.h
  44. 8
      drivers/sensor/qdec_nrfx/qdec_nrfx.c
  45. 2
      drivers/sensor/vcnl4040/vcnl4040.c
  46. 8
      drivers/serial/Kconfig.nrfx
  47. 42
      drivers/serial/uart_cc13xx_cc26xx.c
  48. 2
      drivers/serial/uart_npcx.c
  49. 4
      drivers/serial/uart_nrfx_uart.c
  50. 11
      drivers/serial/uart_nrfx_uarte.c
  51. 18
      drivers/spi/spi_cc13xx_cc26xx.c
  52. 4
      drivers/spi/spi_dw.c
  53. 8
      drivers/spi/spi_nrfx_spi.c
  54. 9
      drivers/spi/spi_nrfx_spim.c
  55. 2
      drivers/timer/Kconfig.stm32_lptim
  56. 6
      drivers/timer/loapic_timer.c
  57. 2
      include/arch/arm/aarch32/irq.h
  58. 2
      include/arch/x86/ia32/arch.h
  59. 12
      include/device.h
  60. 2
      include/kernel_structs.h
  61. 2
      include/linker/common-ram.ld
  62. 54
      include/power/power.h
  63. 2
      kernel/Kconfig
  64. 8
      kernel/device.c
  65. 16
      kernel/idle.c
  66. 2
      kernel/include/kernel_offsets.h
  67. 2
      samples/basic/minimal/common.conf
  68. 4
      samples/boards/mec15xxevb_assy6853/power_management/prj.conf
  69. 10
      samples/boards/mec15xxevb_assy6853/power_management/src/power_mgmt.c
  70. 4
      samples/boards/mec15xxevb_assy6853/power_management/src/power_mgmt.h
  71. 8
      samples/boards/nrf/system_off/prj.conf
  72. 8
      samples/boards/ti/cc13x2_cc26x2/system_off/prj.conf
  73. 2
      samples/drivers/spi_flash_at45/overlay-pm.conf
  74. 1
      samples/drivers/spi_flash_at45/prj.conf
  75. 2
      samples/drivers/spi_flash_at45/src/main.c
  76. 4
      samples/net/sockets/echo_server/boards/frdm_k64f.conf
  77. 2
      samples/philosophers/prj_tickless.conf
  78. 2
      samples/sensor/apds9960/prj.conf
  79. 2
      samples/sensor/apds9960/src/main.c
  80. 6
      samples/subsys/power/device_pm/prj.conf
  81. 2
      soc/arm/microchip_mec/mec1501/CMakeLists.txt
  82. 12
      soc/arm/microchip_mec/mec1501/Kconfig.defconfig.mec1501hsz
  83. 4
      soc/arm/microchip_mec/mec1501/device_power.c
  84. 2
      soc/arm/microchip_mec/mec1501/device_power.h
  85. 12
      soc/arm/microchip_mec/mec1501/power.c
  86. 2
      soc/arm/nordic_nrf/Kconfig.defconfig
  87. 2
      soc/arm/nordic_nrf/nrf51/CMakeLists.txt
  88. 2
      soc/arm/nordic_nrf/nrf51/Kconfig.series
  89. 8
      soc/arm/nordic_nrf/nrf51/power.c
  90. 2
      soc/arm/nordic_nrf/nrf52/CMakeLists.txt
  91. 2
      soc/arm/nordic_nrf/nrf52/Kconfig.series
  92. 8
      soc/arm/nordic_nrf/nrf52/power.c
  93. 2
      soc/arm/nordic_nrf/nrf53/CMakeLists.txt
  94. 2
      soc/arm/nordic_nrf/nrf53/Kconfig.soc
  95. 10
      soc/arm/nordic_nrf/nrf53/power.c
  96. 2
      soc/arm/nordic_nrf/nrf91/CMakeLists.txt
  97. 2
      soc/arm/nordic_nrf/nrf91/Kconfig.series
  98. 8
      soc/arm/nordic_nrf/nrf91/power.c
  99. 2
      soc/arm/silabs_exx32/Kconfig.defconfig
  100. 2
      soc/arm/silabs_exx32/common/CMakeLists.txt
  101. Some files were not shown because too many files have changed in this diff Show More

2
Kconfig.zephyr

@ -498,7 +498,7 @@ endchoice @@ -498,7 +498,7 @@ endchoice
config BOOTLOADER_CONTEXT_RESTORE
bool "Boot loader has context restore support"
default y
depends on SYS_POWER_DEEP_SLEEP_STATES && BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
depends on PM_DEEP_SLEEP_STATES && BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
help
This option signifies that the target has a bootloader
that restores CPU context upon resuming from deep sleep

12
arch/Kconfig

@ -482,37 +482,37 @@ config ARCH_HAS_THREAD_ABORT @@ -482,37 +482,37 @@ config ARCH_HAS_THREAD_ABORT
# individual SoC.
#
config HAS_SYS_POWER_STATE_SLEEP_1
config HAS_POWER_STATE_SLEEP_1
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_1
configuration option.
config HAS_SYS_POWER_STATE_SLEEP_2
config HAS_POWER_STATE_SLEEP_2
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_2
configuration option.
config HAS_SYS_POWER_STATE_SLEEP_3
config HAS_POWER_STATE_SLEEP_3
bool
help
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_3
configuration option.
config HAS_SYS_POWER_STATE_DEEP_SLEEP_1
config HAS_POWER_STATE_DEEP_SLEEP_1
bool
help
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_1
configuration option.
config HAS_SYS_POWER_STATE_DEEP_SLEEP_2
config HAS_POWER_STATE_DEEP_SLEEP_2
bool
help
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_2
configuration option.
config HAS_SYS_POWER_STATE_DEEP_SLEEP_3
config HAS_POWER_STATE_DEEP_SLEEP_3
bool
help
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_3

4
arch/arc/core/isr_wrapper.S

@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
GTEXT(_isr_wrapper)
GTEXT(_isr_demux)
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#if defined(CONFIG_PM)
GTEXT(z_sys_power_save_idle_exit)
#endif
@ -245,7 +245,7 @@ rirq_path: @@ -245,7 +245,7 @@ rirq_path:
/* r0, r1, and r3 will be used in exit_tickless_idle macro */
.macro exit_tickless_idle
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#if defined(CONFIG_PM)
clri r0 /* do not interrupt exiting tickless idle operations */
mov_s r1, _kernel
ld_s r3, [r1, _kernel_offset_to_idle] /* requested idle duration */

2
arch/arc/core/reset.S

@ -154,7 +154,7 @@ done_mpu_regions_reset: @@ -154,7 +154,7 @@ done_mpu_regions_reset:
#endif
#endif
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES) && \
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
jl @_sys_resume_from_deep_sleep
#endif

2
arch/arm/core/aarch32/irq_manage.c

@ -161,7 +161,7 @@ void z_irq_spurious(const void *unused) @@ -161,7 +161,7 @@ void z_irq_spurious(const void *unused)
z_arm_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
void _arch_isr_direct_pm(void)
{
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) \

4
arch/arm/core/aarch32/isr_wrapper.S

@ -84,7 +84,7 @@ SECTION_FUNC(TEXT, _isr_wrapper) @@ -84,7 +84,7 @@ SECTION_FUNC(TEXT, _isr_wrapper)
bl sys_trace_isr_enter
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* All interrupts are disabled when handling idle wakeup. For tickless
* idle, this ensures that the calculation and programming of the
@ -139,7 +139,7 @@ _idle_state_cleared: @@ -139,7 +139,7 @@ _idle_state_cleared:
cpsie i /* re-enable interrupts (PRIMASK = 0) */
#endif
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
#endif /* CONFIG_PM */
#if defined(CONFIG_CPU_CORTEX_M)
mrs r0, IPSR /* get exception number */

2
arch/posix/core/swap.c

@ -103,7 +103,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr, @@ -103,7 +103,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
} /* LCOV_EXCL_LINE */
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/**
* If the kernel is in idle mode, take it out
*/

4
arch/x86/core/ia32/crt0.S

@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
GDATA(_sse_mxcsr_default_value)
#endif
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
GTEXT(_sys_resume_from_deep_sleep)
#endif
@ -163,7 +163,7 @@ __csSet: @@ -163,7 +163,7 @@ __csSet:
#else
addl $CONFIG_ISR_STACK_SIZE, %esp
#endif
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES) && \
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
/*
* Invoke _sys_resume_from_deep_sleep() hook to handle resume from

10
arch/x86/core/ia32/intstub.S

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
GTEXT(arch_swap)
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
GTEXT(z_sys_power_save_idle_exit)
#endif
@ -144,11 +144,11 @@ SECTION_FUNC(TEXT, _interrupt_enter) @@ -144,11 +144,11 @@ SECTION_FUNC(TEXT, _interrupt_enter)
pushl %edi /* Save stack pointer */
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
cmpl $0, _kernel_offset_to_idle(%ecx)
jne handle_idle
/* fast path is !idle, in the pipeline */
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
#endif /* CONFIG_PM */
/* fall through to nested case */
@ -297,7 +297,7 @@ nestedInterrupt: @@ -297,7 +297,7 @@ nestedInterrupt:
KPTI_IRET
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
handle_idle:
pushl %eax
pushl %edx
@ -319,7 +319,7 @@ handle_idle: @@ -319,7 +319,7 @@ handle_idle:
popl %edx
popl %eax
jmp alreadyOnIntStack
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
#endif /* CONFIG_PM */
/**
*

8
boards/arm/cc1352r1_launchxl/Kconfig.defconfig

@ -8,12 +8,12 @@ if BOARD_CC1352R1_LAUNCHXL @@ -8,12 +8,12 @@ if BOARD_CC1352R1_LAUNCHXL
config BOARD
default "cc1352r1_launchxl"
if SYS_POWER_MANAGEMENT
if PM
# Ideally this value could be made to less than 1 ms, as there is
# essentially no delay to come out of IDLE mode. However Zephyr only
# supports millisecond precision here, so 1 ms is the best approximation.
config SYS_PM_MIN_RESIDENCY_SLEEP_1
config PM_MIN_RESIDENCY_SLEEP_1
default 1
# The default here is deliberately made higher to be less agressive, to
@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1 @@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
# given application, weighing tradeoffs between a lower value that leads to
# higher power savings vs. a higher value that would accommodate for a higher
# wakeup latency.
config SYS_PM_MIN_RESIDENCY_SLEEP_2
config PM_MIN_RESIDENCY_SLEEP_2
default 5
endif # SYS_POWER_MANAGEMENT
endif # PM
endif # BOARD_CC1352R1_LAUNCHXL

8
boards/arm/cc1352r1_launchxl/doc/index.rst

@ -205,11 +205,11 @@ Power Management and UART @@ -205,11 +205,11 @@ Power Management and UART
System and device power management are supported on this platform, and
can be enabled via the standard Kconfig options in Zephyr, such as
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
:option:`CONFIG_PM_SLEEP_STATES`, and
:option:`CONFIG_PM_DEEP_SLEEP_STATES`.
When system power management is turned on (CONFIG_SYS_POWER_MANAGEMENT=y),
When system power management is turned on (CONFIG_PM=y),
sleep state 2 (standby mode) is allowed, and polling is used to retrieve input
by calling uart_poll_in(), it is possible for characters to be missed if the
system enters standby mode between calls to uart_poll_in(). This is because

8
boards/arm/cc1352r_sensortag/Kconfig.defconfig

@ -9,12 +9,12 @@ if BOARD_CC1352R_SENSORTAG @@ -9,12 +9,12 @@ if BOARD_CC1352R_SENSORTAG
config BOARD
default "cc1352r_sensortag"
if SYS_POWER_MANAGEMENT
if PM
# Ideally this value could be made to less than 1 ms, as there is
# essentially no delay to come out of IDLE mode. However Zephyr only
# supports millisecond precision here, so 1 ms is the best approximation.
config SYS_PM_MIN_RESIDENCY_SLEEP_1
config PM_MIN_RESIDENCY_SLEEP_1
default 1
# The default here is deliberately made higher to be less agressive, to
@ -26,8 +26,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1 @@ -26,8 +26,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
# given application, weighing tradeoffs between a lower value that leads to
# higher power savings vs. a higher value that would accommodate for a higher
# wakeup latency.
config SYS_PM_MIN_RESIDENCY_SLEEP_2
config PM_MIN_RESIDENCY_SLEEP_2
default 5
endif # SYS_POWER_MANAGEMENT
endif # PM
endif # BOARD_CC1352R_SENSORTAG

8
boards/arm/cc1352r_sensortag/doc/index.rst

@ -231,11 +231,11 @@ Power Management and UART @@ -231,11 +231,11 @@ Power Management and UART
System and device power management are supported on this platform, and
can be enabled via the standard Kconfig options in Zephyr, such as
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
:option:`CONFIG_PM_SLEEP_STATES`, and
:option:`CONFIG_PM_DEEP_SLEEP_STATES`.
When system power management is turned on (CONFIG_SYS_POWER_MANAGEMENT=y),
When system power management is turned on (CONFIG_PM=y),
sleep state 2 (standby mode) is allowed, and polling is used to retrieve input
by calling uart_poll_in(), it is possible for characters to be missed if the
system enters standby mode between calls to uart_poll_in(). This is because

8
boards/arm/cc26x2r1_launchxl/Kconfig.defconfig

@ -8,12 +8,12 @@ if BOARD_CC26X2R1_LAUNCHXL @@ -8,12 +8,12 @@ if BOARD_CC26X2R1_LAUNCHXL
config BOARD
default "cc26x2r1_launchxl"
if SYS_POWER_MANAGEMENT
if PM
# Ideally this value could be made to less than 1 ms, as there is
# essentially no delay to come out of IDLE mode. However Zephyr only
# supports millisecond precision here, so 1 ms is the best approximation.
config SYS_PM_MIN_RESIDENCY_SLEEP_1
config PM_MIN_RESIDENCY_SLEEP_1
default 1
# The default here is deliberately made higher to be less agressive, to
@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1 @@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
# given application, weighing tradeoffs between a lower value that leads to
# higher power savings vs. a higher value that would accommodate for a higher
# wakeup latency.
config SYS_PM_MIN_RESIDENCY_SLEEP_2
config PM_MIN_RESIDENCY_SLEEP_2
default 5
endif # SYS_POWER_MANAGEMENT
endif # PM
endif # BOARD_CC26X2R1_LAUNCHXL

8
boards/arm/cc26x2r1_launchxl/doc/index.rst

@ -211,11 +211,11 @@ Power Management and UART @@ -211,11 +211,11 @@ Power Management and UART
System and device power management are supported on this platform, and
can be enabled via the standard Kconfig options in Zephyr, such as
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
:option:`CONFIG_PM_SLEEP_STATES`, and
:option:`CONFIG_PM_DEEP_SLEEP_STATES`.
When system power management is turned on (CONFIG_SYS_POWER_MANAGEMENT=y),
When system power management is turned on (CONFIG_PM=y),
sleep state 2 (standby mode) is allowed, and polling is used to retrieve input
by calling uart_poll_in(), it is possible for characters to be missed if the
system enters standby mode between calls to uart_poll_in(). This is because

8
boards/arm/mec1501modular_assy6885/Kconfig.defconfig

@ -54,13 +54,13 @@ config TACH_XEC @@ -54,13 +54,13 @@ config TACH_XEC
depends on SENSOR
# power management stuff
if SYS_POWER_MANAGEMENT
if PM
config SYS_PM_MIN_RESIDENCY_SLEEP_1
config PM_MIN_RESIDENCY_SLEEP_1
default 1000
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
config PM_MIN_RESIDENCY_DEEP_SLEEP_1
default 2000
endif # SYS_POWER_MANAGEMENT
endif # PM
endif # BOARD_MEC1501MODULAR_ASSY6885

2
boards/arm/mec1501modular_assy6885/pinmux.c

@ -448,7 +448,7 @@ static int board_pinmux_init(const struct device *dev) @@ -448,7 +448,7 @@ static int board_pinmux_init(const struct device *dev)
#endif /* DT_NODE_HAS_STATUS(DT_INST(0, microchip_xec_qmspi), okay) */
#endif /* CONFIG_SPI_XEC_QMSPI */
#ifdef CONFIG_SYS_PM_DEBUG
#ifdef CONFIG_PM_DEBUG
/*
* Deep sleep testing: Enable TEST_CLK_OUT on GPIO_060 function 2.
* TEST_CLK_OUT is the PLL 48MHz conditioned output.

8
boards/arm/mec15xxevb_assy6853/Kconfig.defconfig

@ -71,14 +71,14 @@ config TACH_XEC @@ -71,14 +71,14 @@ config TACH_XEC
depends on SENSOR
# power management stuff
if SYS_POWER_MANAGEMENT
if PM
config SYS_PM_MIN_RESIDENCY_SLEEP_1
config PM_MIN_RESIDENCY_SLEEP_1
default 1000
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
config PM_MIN_RESIDENCY_DEEP_SLEEP_1
default 2000
endif # SYS_POWER_MANAGEMENT
endif # PM
endif # BOARD_MEC15XXEVB_ASSY6853

2
boards/arm/mec15xxevb_assy6853/pinmux.c

@ -438,7 +438,7 @@ static int board_pinmux_init(const struct device *dev) @@ -438,7 +438,7 @@ static int board_pinmux_init(const struct device *dev)
#endif /* DT_NODE_HAS_STATUS(DT_INST(0, microchip_xec_qmspi), okay) */
#endif /* CONFIG_SPI_XEC_QMSPI */
#ifdef CONFIG_SYS_PM_DEBUG
#ifdef CONFIG_PM_DEBUG
/*
* Deep sleep testing: Enable TEST_CLK_OUT on GPIO_060 function 2.
* TEST_CLK_OUT is the PLL 48MHz conditioned output.

2
boards/posix/native_posix/board_irq.h

@ -73,7 +73,7 @@ void posix_irq_priority_set(unsigned int irq, unsigned int prio, @@ -73,7 +73,7 @@ void posix_irq_priority_set(unsigned int irq, unsigned int prio,
#define ARCH_ISR_DIRECT_HEADER() do { } while (0)
#define ARCH_ISR_DIRECT_FOOTER(a) do { } while (0)
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
extern void posix_irq_check_idle_exit(void);
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
#else

2
boards/posix/native_posix/irq_handler.c

@ -43,7 +43,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap) @@ -43,7 +43,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap)
*may_swap |= ((direct_irq_f_ptr)
irq_vector_table[irq_nbr].func)();
} else {
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
posix_irq_check_idle_exit();
#endif
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)

2
boards/posix/nrf52_bsim/board_irq.h

@ -73,7 +73,7 @@ void posix_irq_priority_set(unsigned int irq, unsigned int prio, @@ -73,7 +73,7 @@ void posix_irq_priority_set(unsigned int irq, unsigned int prio,
#define ARCH_ISR_DIRECT_HEADER() do { } while (0)
#define ARCH_ISR_DIRECT_FOOTER(a) do { } while (0)
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
extern void posix_irq_check_idle_exit(void);
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
#else

2
boards/posix/nrf52_bsim/irq_handler.c

@ -98,7 +98,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap) @@ -98,7 +98,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap)
*may_swap |= ((direct_irq_f_ptr)
irq_vector_table[irq_nbr].func)();
} else {
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
posix_irq_check_idle_exit();
#endif
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)

12
doc/reference/power_management/index.rst

@ -90,7 +90,7 @@ System Power Management @@ -90,7 +90,7 @@ System Power Management
***********************
The kernel enters the idle state when it has nothing to schedule. If enabled via
the :option:`CONFIG_SYS_POWER_MANAGEMENT` Kconfig option, the Power Management
the :option:`CONFIG_PM` Kconfig option, the Power Management
Subsystem can put an idle system in one of the supported power states, based
on the selected power management policy and the duration of the idle time
allotted by the kernel.
@ -491,7 +491,7 @@ Power Management Configuration Flags @@ -491,7 +491,7 @@ Power Management Configuration Flags
The Power Management features can be individually enabled and disabled using
the following configuration flags.
:option:`CONFIG_SYS_POWER_MANAGEMENT`
:option:`CONFIG_PM`
This flag enables the power management subsystem.
@ -499,20 +499,20 @@ the following configuration flags. @@ -499,20 +499,20 @@ the following configuration flags.
This flag enables the tickless idle power saving feature.
:option:`CONFIG_SYS_POWER_SLEEP_STATES`
:option:`CONFIG_PM_SLEEP_STATES`
This flag enables support for the Sleep states.
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`
:option:`CONFIG_PM_DEEP_SLEEP_STATES`
This flag enables support for the Deep Sleep states.
:option:`CONFIG_DEVICE_POWER_MANAGEMENT`
:option:`CONFIG_PM_DEVICE`
This flag is enabled if the SOC interface and the devices support device power
management.
:code:`CONFIG_DEVICE_IDLE_PM`
:code:`CONFIG_PM_DEVICE_IDLE`
This flag enables the Device Idle Power Management.

6
doc/zephyr.doxyfile.in

@ -1966,8 +1966,8 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \ @@ -1966,8 +1966,8 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \
"CONFIG_BT_USER_PHY_UPDATE" \
"CONFIG_BT_SMP" \
"CONFIG_BT_SMP_APP_PAIRING_ACCEPT" \
"CONFIG_DEVICE_POWER_MANAGEMENT" \
"CONFIG_DEVICE_IDLE_PM" \
"CONFIG_PM_DEVICE" \
"CONFIG_PM_DEVICE_IDLE" \
"CONFIG_ERRNO" \
"CONFIG_FLASH_JESD216_API" \
"CONFIG_FLASH_PAGE_LAYOUT" \
@ -1985,7 +1985,7 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \ @@ -1985,7 +1985,7 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \
"CONFIG_SMP" \
"CONFIG_SPI_ASYNC" \
"CONFIG_SYS_CLOCK_EXISTS" \
"CONFIG_SYS_POWER_MANAGEMENT" \
"CONFIG_PM" \
"CONFIG_THREAD_CUSTOM_DATA" \
"CONFIG_THREAD_MONITOR" \
"CONFIG_THREAD_STACK_INFO" \

8
drivers/display/display_st7789v.c

@ -52,7 +52,7 @@ struct st7789v_data { @@ -52,7 +52,7 @@ struct st7789v_data {
uint16_t width;
uint16_t x_offset;
uint16_t y_offset;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -375,7 +375,7 @@ static int st7789v_init(const struct device *dev) @@ -375,7 +375,7 @@ static int st7789v_init(const struct device *dev)
}
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
data->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
@ -402,7 +402,7 @@ static int st7789v_init(const struct device *dev) @@ -402,7 +402,7 @@ static int st7789v_init(const struct device *dev)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void st7789v_enter_sleep(struct st7789v_data *data)
{
st7789v_transmit(data, ST7789V_CMD_SLEEP_IN, NULL, 0);
@ -438,7 +438,7 @@ static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command, @@ -438,7 +438,7 @@ static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command,
}
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static const struct display_driver_api st7789v_api = {
.blanking_on = st7789v_blanking_on,

26
drivers/entropy/entropy_cc13xx_cc26xx.c

@ -31,11 +31,11 @@ struct entropy_cc13xx_cc26xx_data { @@ -31,11 +31,11 @@ struct entropy_cc13xx_cc26xx_data {
struct k_sem sync;
struct ring_buf pool;
uint8_t data[CONFIG_ENTROPY_CC13XX_CC26XX_POOL_SIZE];
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
Power_NotifyObj post_notify;
bool constrained;
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -73,7 +73,7 @@ static void start_trng(struct entropy_cc13xx_cc26xx_data *data) @@ -73,7 +73,7 @@ static void start_trng(struct entropy_cc13xx_cc26xx_data *data)
TRNGIntEnable(TRNG_NUMBER_READY | TRNG_FRO_SHUTDOWN);
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void stop_trng(struct entropy_cc13xx_cc26xx_data *data)
{
TRNGDisable();
@ -107,8 +107,8 @@ static int entropy_cc13xx_cc26xx_get_entropy(const struct device *dev, @@ -107,8 +107,8 @@ static int entropy_cc13xx_cc26xx_get_entropy(const struct device *dev,
struct entropy_cc13xx_cc26xx_data *data = get_dev_data(dev);
uint32_t cnt;
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
unsigned int key = irq_lock();
if (!data->constrained) {
@ -155,8 +155,8 @@ static void entropy_cc13xx_cc26xx_isr(const void *arg) @@ -155,8 +155,8 @@ static void entropy_cc13xx_cc26xx_isr(const void *arg)
/* When pool is full disable interrupt and stop reading numbers */
if (cnt != sizeof(num)) {
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
if (data->constrained) {
sys_pm_ctrl_enable_state(
SYS_POWER_STATE_SLEEP_2);
@ -241,7 +241,7 @@ static int entropy_cc13xx_cc26xx_get_entropy_isr(const struct device *dev, @@ -241,7 +241,7 @@ static int entropy_cc13xx_cc26xx_get_entropy_isr(const struct device *dev,
return read;
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* ======== post_notify_fxn ========
* Called by Power module when waking up the CPU from Standby. The TRNG needs
@ -269,7 +269,7 @@ static int post_notify_fxn(unsigned int eventType, uintptr_t eventArg, @@ -269,7 +269,7 @@ static int post_notify_fxn(unsigned int eventType, uintptr_t eventArg,
}
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev,
uint32_t new_state)
{
@ -321,22 +321,22 @@ static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev, @@ -321,22 +321,22 @@ static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static int entropy_cc13xx_cc26xx_init(const struct device *dev)
{
struct entropy_cc13xx_cc26xx_data *data = get_dev_data(dev);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
/* Initialize driver data */
ring_buf_init(&data->pool, sizeof(data->data), data->data);
#if defined(CONFIG_SYS_POWER_MANAGEMENT)
#if defined(CONFIG_PM)
Power_setDependency(PowerCC26XX_PERIPH_TRNG);
#if defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM_SLEEP_STATES)
/* Stay out of standby until buffer is filled with entropy */
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
data->constrained = true;

2
drivers/ethernet/Kconfig.mcux

@ -8,7 +8,7 @@ menuconfig ETH_MCUX @@ -8,7 +8,7 @@ menuconfig ETH_MCUX
depends on HAS_MCUX_ENET
select NOCACHE_MEMORY if HAS_MCUX_CACHE
select ARM_MPU if CPU_CORTEX_M7
select NET_POWER_MANAGEMENT if DEVICE_POWER_MANAGEMENT
select NET_POWER_MANAGEMENT if PM_DEVICE
help
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
setup. There is no support for PHY disconnect, reconnect or

8
drivers/flash/spi_flash_at45.c

@ -53,7 +53,7 @@ struct spi_flash_at45_data { @@ -53,7 +53,7 @@ struct spi_flash_at45_data {
const struct device *spi;
struct spi_cs_control spi_cs;
struct k_sem lock;
#if IS_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT)
#if IS_ENABLED(CONFIG_PM_DEVICE)
uint32_t pm_state;
#endif
};
@ -585,7 +585,7 @@ static int spi_flash_at45_init(const struct device *dev) @@ -585,7 +585,7 @@ static int spi_flash_at45_init(const struct device *dev)
return err;
}
#if IS_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT)
#if IS_ENABLED(CONFIG_PM_DEVICE)
static int spi_flash_at45_pm_control(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
@ -634,7 +634,7 @@ static int spi_flash_at45_pm_control(const struct device *dev, @@ -634,7 +634,7 @@ static int spi_flash_at45_pm_control(const struct device *dev,
return err;
}
#endif /* IS_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT) */
#endif /* IS_ENABLED(CONFIG_PM_DEVICE) */
static const struct flash_parameters *
flash_at45_get_parameters(const struct device *dev)
@ -665,7 +665,7 @@ static const struct flash_driver_api spi_flash_at45_api = { @@ -665,7 +665,7 @@ static const struct flash_driver_api spi_flash_at45_api = {
}; \
static struct spi_flash_at45_data inst_##idx##_data = { \
.lock = Z_SEM_INITIALIZER(inst_##idx##_data.lock, 1, 1), \
IF_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT, ( \
IF_ENABLED(CONFIG_PM_DEVICE, ( \
.pm_state = DEVICE_PM_ACTIVE_STATE)) \
}; \
static const struct spi_flash_at45_config inst_##idx##_config = { \

2
drivers/gpio/gpio_cc13xx_cc26xx.c

@ -232,7 +232,7 @@ static void gpio_cc13xx_cc26xx_isr(const struct device *dev) @@ -232,7 +232,7 @@ static void gpio_cc13xx_cc26xx_isr(const struct device *dev)
static int gpio_cc13xx_cc26xx_init(const struct device *dev)
{
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/* Set dependency on gpio resource to turn on power domains */
Power_setDependency(PowerCC26XX_PERIPH_GPIO);
#else

4
drivers/gpio/gpio_dw.c

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
#include <drivers/interrupt_controller/ioapic.h>
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#include <power/power.h>
#endif
@ -424,7 +424,7 @@ static inline int gpio_dw_manage_callback(const struct device *port, @@ -424,7 +424,7 @@ static inline int gpio_dw_manage_callback(const struct device *port,
return gpio_manage_callback(&context->callbacks, callback, set);
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void gpio_dw_set_power_state(const struct device *port,
uint32_t power_state)
{

2
drivers/gpio/gpio_dw.h

@ -41,7 +41,7 @@ struct gpio_dw_runtime { @@ -41,7 +41,7 @@ struct gpio_dw_runtime {
const struct device *clock;
#endif
sys_slist_t callbacks;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t device_power_state;
#endif
};

24
drivers/i2c/i2c_cc13xx_cc26xx.c

@ -29,11 +29,11 @@ struct i2c_cc13xx_cc26xx_data { @@ -29,11 +29,11 @@ struct i2c_cc13xx_cc26xx_data {
struct k_sem lock;
struct k_sem complete;
volatile uint32_t error;
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
Power_NotifyObj postNotify;
uint32_t dev_config;
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -209,8 +209,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev, @@ -209,8 +209,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
k_sem_take(&get_dev_data(dev)->lock, K_FOREVER);
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
#endif
@ -234,8 +234,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev, @@ -234,8 +234,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
}
}
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
#endif
@ -277,7 +277,7 @@ static int i2c_cc13xx_cc26xx_configure(const struct device *dev, @@ -277,7 +277,7 @@ static int i2c_cc13xx_cc26xx_configure(const struct device *dev,
/* Enables and configures I2C master */
I2CMasterInitExpClk(get_dev_config(dev)->base, CPU_FREQ, fast);
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
get_dev_data(dev)->dev_config = dev_config;
#endif
@ -298,7 +298,7 @@ static void i2c_cc13xx_cc26xx_isr(const void *arg) @@ -298,7 +298,7 @@ static void i2c_cc13xx_cc26xx_isr(const void *arg)
}
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* ======== postNotifyFxn ========
* Called by Power module when waking up the CPU from Standby. The i2c needs
@ -331,7 +331,7 @@ static int postNotifyFxn(unsigned int eventType, uintptr_t eventArg, @@ -331,7 +331,7 @@ static int postNotifyFxn(unsigned int eventType, uintptr_t eventArg,
}
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev,
uint32_t new_state)
{
@ -395,18 +395,18 @@ static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev, @@ -395,18 +395,18 @@ static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static int i2c_cc13xx_cc26xx_init(const struct device *dev)
{
uint32_t cfg;
int err;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/* Set Power dependencies & constraints */
Power_setDependency(PowerCC26XX_PERIPH_I2C0);

8
drivers/i2c/i2c_nrfx_twi.c

@ -19,7 +19,7 @@ struct i2c_nrfx_twi_data { @@ -19,7 +19,7 @@ struct i2c_nrfx_twi_data {
struct k_sem completion_sync;
volatile nrfx_err_t res;
uint32_t dev_config;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -205,14 +205,14 @@ static int init_twi(const struct device *dev) @@ -205,14 +205,14 @@ static int init_twi(const struct device *dev)
dev->name);
return -EBUSY;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int twi_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
@ -260,7 +260,7 @@ static int twi_nrfx_pm_control(const struct device *dev, @@ -260,7 +260,7 @@ static int twi_nrfx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
#define I2C_NRFX_TWI_INVALID_FREQUENCY ((nrf_twi_frequency_t)-1)
#define I2C_NRFX_TWI_FREQUENCY(bitrate) \

8
drivers/i2c/i2c_nrfx_twim.c

@ -22,7 +22,7 @@ struct i2c_nrfx_twim_data { @@ -22,7 +22,7 @@ struct i2c_nrfx_twim_data {
uint32_t dev_config;
uint16_t concat_buf_size;
uint8_t *concat_buf;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -244,14 +244,14 @@ static int init_twim(const struct device *dev) @@ -244,14 +244,14 @@ static int init_twim(const struct device *dev)
return -EBUSY;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int twim_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
@ -300,7 +300,7 @@ static int twim_nrfx_pm_control(const struct device *dev, @@ -300,7 +300,7 @@ static int twim_nrfx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
#define I2C_NRFX_TWIM_INVALID_FREQUENCY ((nrf_twim_frequency_t)-1)
#define I2C_NRFX_TWIM_FREQUENCY(bitrate) \

6
drivers/interrupt_controller/intc_arcv2_irq_unit.c

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
extern void *_VectorTable;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#include <power/power.h>
#include <kernel_structs.h>
@ -87,7 +87,7 @@ static int arc_v2_irq_unit_init(const struct device *unused) @@ -87,7 +87,7 @@ static int arc_v2_irq_unit_init(const struct device *unused)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
/*
* @brief Suspend the interrupt unit device driver
@ -223,4 +223,4 @@ SYS_DEVICE_DEFINE("arc_v2_irq_unit", arc_v2_irq_unit_init, @@ -223,4 +223,4 @@ SYS_DEVICE_DEFINE("arc_v2_irq_unit", arc_v2_irq_unit_init,
#else
SYS_INIT(arc_v2_irq_unit_init, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */

8
drivers/interrupt_controller/intc_ioapic.c

@ -92,7 +92,7 @@ DEVICE_MMIO_TOPLEVEL_STATIC(ioapic_regs, DT_DRV_INST(0)); @@ -92,7 +92,7 @@ DEVICE_MMIO_TOPLEVEL_STATIC(ioapic_regs, DT_DRV_INST(0));
*/
#define DEFAULT_RTE_DEST (0xFF << 24)
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#include <power/power.h>
uint32_t ioapic_suspend_buf[SUSPEND_BITS_REQD / 32] = {0};
static uint32_t ioapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
@ -179,7 +179,7 @@ void z_ioapic_irq_disable(unsigned int irq) @@ -179,7 +179,7 @@ void z_ioapic_irq_disable(unsigned int irq)
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
void store_flags(unsigned int irq, uint32_t flags)
{
@ -317,7 +317,7 @@ static int ioapic_device_ctrl(const struct device *device, @@ -317,7 +317,7 @@ static int ioapic_device_ctrl(const struct device *device,
}
#endif /*CONFIG_DEVICE_POWER_MANAGEMENT*/
#endif /*CONFIG_PM_DEVICE*/
/**
*
@ -477,7 +477,7 @@ static void IoApicRedUpdateLo(unsigned int irq, @@ -477,7 +477,7 @@ static void IoApicRedUpdateLo(unsigned int irq,
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
SYS_DEVICE_DEFINE("ioapic", ioapic_init, ioapic_device_ctrl, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else

6
drivers/interrupt_controller/intc_loapic.c

@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
#define LOPIC_SSPND_BITS_PER_IRQ 1 /* Just the one for enable disable*/
#define LOPIC_SUSPEND_BITS_REQD (ROUND_UP((LOAPIC_IRQ_COUNT * LOPIC_SSPND_BITS_PER_IRQ), 32))
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#include <power/power.h>
uint32_t loapic_suspend_buf[LOPIC_SUSPEND_BITS_REQD / 32] = {0};
static uint32_t loapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
@ -332,7 +332,7 @@ int z_irq_controller_isr_vector_get(void) @@ -332,7 +332,7 @@ int z_irq_controller_isr_vector_get(void)
return -1;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int loapic_suspend(const struct device *port)
{
volatile uint32_t lvt; /* local vector table entry value */
@ -421,7 +421,7 @@ SYS_DEVICE_DEFINE("loapic", loapic_init, loapic_device_ctrl, PRE_KERNEL_1, @@ -421,7 +421,7 @@ SYS_DEVICE_DEFINE("loapic", loapic_init, loapic_device_ctrl, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else
SYS_INIT(loapic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
#if CONFIG_LOAPIC_SPURIOUS_VECTOR

4
drivers/modem/hl7800.c

@ -3472,7 +3472,7 @@ static void hl7800_rx(void) @@ -3472,7 +3472,7 @@ static void hl7800_rx(void)
static void shutdown_uart(void)
{
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
int rc;
if (ictx.uart_on) {
@ -3490,7 +3490,7 @@ static void shutdown_uart(void) @@ -3490,7 +3490,7 @@ static void shutdown_uart(void)
static void power_on_uart(void)
{
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
int rc;
if (!ictx.uart_on) {

4
drivers/pwm/pwm_nrfx.c

@ -281,7 +281,7 @@ static int pwm_nrfx_init(const struct device *dev) @@ -281,7 +281,7 @@ static int pwm_nrfx_init(const struct device *dev)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void pwm_nrfx_uninit(const struct device *dev)
{
@ -361,7 +361,7 @@ static int pwm_nrfx_pm_control(const struct device *dev, @@ -361,7 +361,7 @@ static int pwm_nrfx_pm_control(const struct device *dev,
#define PWM_NRFX_PM_CONTROL(idx)
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
#define PWM(dev_idx) DT_NODELABEL(pwm##dev_idx)
#define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop)

2
drivers/sensor/apds9960/apds9960.c

@ -407,7 +407,7 @@ static int apds9960_init_interrupt(const struct device *dev) @@ -407,7 +407,7 @@ static int apds9960_init_interrupt(const struct device *dev)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int apds9960_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)

6
drivers/sensor/lis2mdl/lis2mdl.c

@ -357,7 +357,7 @@ static int lis2mdl_init(const struct device *dev) @@ -357,7 +357,7 @@ static int lis2mdl_init(const struct device *dev)
return -EIO;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
lis2mdl->power_state = DEVICE_PM_ACTIVE_STATE;
#endif
@ -371,7 +371,7 @@ static int lis2mdl_init(const struct device *dev) @@ -371,7 +371,7 @@ static int lis2mdl_init(const struct device *dev)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl,
uint32_t new_state)
{
@ -430,7 +430,7 @@ static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command, @@ -430,7 +430,7 @@ static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command,
return status;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
DEVICE_DEFINE(lis2mdl, DT_INST_LABEL(0), lis2mdl_init,
lis2mdl_pm_control, &lis2mdl_data, &lis2mdl_dev_config,

2
drivers/sensor/lis2mdl/lis2mdl.h

@ -57,7 +57,7 @@ struct lis2mdl_data { @@ -57,7 +57,7 @@ struct lis2mdl_data {
stmdev_ctx_t *ctx;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t power_state;
#endif

8
drivers/sensor/qdec_nrfx/qdec_nrfx.c

@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(qdec_nrfx, CONFIG_SENSOR_LOG_LEVEL); @@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(qdec_nrfx, CONFIG_SENSOR_LOG_LEVEL);
struct qdec_nrfx_data {
int32_t acc;
sensor_trigger_handler_t data_ready_handler;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -209,7 +209,7 @@ static int qdec_nrfx_init(const struct device *dev) @@ -209,7 +209,7 @@ static int qdec_nrfx_init(const struct device *dev)
qdec_nrfx_gpio_ctrl(true);
nrfx_qdec_enable();
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
struct qdec_nrfx_data *data = &qdec_nrfx_data;
data->pm_state = DEVICE_PM_ACTIVE_STATE;
@ -218,7 +218,7 @@ static int qdec_nrfx_init(const struct device *dev) @@ -218,7 +218,7 @@ static int qdec_nrfx_init(const struct device *dev)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int qdec_nrfx_pm_get_state(struct qdec_nrfx_data *data,
uint32_t *state)
@ -299,7 +299,7 @@ static int qdec_nrfx_pm_control(const struct device *dev, @@ -299,7 +299,7 @@ static int qdec_nrfx_pm_control(const struct device *dev,
return err;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static const struct sensor_driver_api qdec_nrfx_driver_api = {

2
drivers/sensor/vcnl4040/vcnl4040.c

@ -217,7 +217,7 @@ static int vcnl4040_ambient_setup(const struct device *dev) @@ -217,7 +217,7 @@ static int vcnl4040_ambient_setup(const struct device *dev)
}
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int vcnl4040_device_ctrl(const struct device *dev,
uint32_t ctrl_command, void *context,
device_pm_cb cb, void *arg)

8
drivers/serial/Kconfig.nrfx

@ -91,7 +91,7 @@ config UART_0_NRF_HW_ASYNC_TIMER @@ -91,7 +91,7 @@ config UART_0_NRF_HW_ASYNC_TIMER
config UART_0_GPIO_MANAGEMENT
bool "Enable GPIO management on port 0"
depends on DEVICE_POWER_MANAGEMENT
depends on PM_DEVICE
default y
help
If enabled, the driver will configure the GPIOs used by the uart to
@ -162,7 +162,7 @@ config UART_1_NRF_HW_ASYNC_TIMER @@ -162,7 +162,7 @@ config UART_1_NRF_HW_ASYNC_TIMER
config UART_1_GPIO_MANAGEMENT
bool "Enable GPIO management on port 1"
depends on DEVICE_POWER_MANAGEMENT
depends on PM_DEVICE
default y
help
If enabled, the driver will configure the GPIOs used by the uart to
@ -232,7 +232,7 @@ config UART_2_NRF_HW_ASYNC_TIMER @@ -232,7 +232,7 @@ config UART_2_NRF_HW_ASYNC_TIMER
config UART_2_GPIO_MANAGEMENT
bool "Enable GPIO management on port 2"
depends on DEVICE_POWER_MANAGEMENT
depends on PM_DEVICE
default y
help
If enabled, the driver will configure the GPIOs used by the uart to
@ -302,7 +302,7 @@ config UART_3_NRF_HW_ASYNC_TIMER @@ -302,7 +302,7 @@ config UART_3_NRF_HW_ASYNC_TIMER
config UART_3_GPIO_MANAGEMENT
bool "Enable GPIO management on port 3"
depends on DEVICE_POWER_MANAGEMENT
depends on PM_DEVICE
default y
help
If enabled, the driver will configure the GPIOs used by the uart to

42
drivers/serial/uart_cc13xx_cc26xx.c

@ -30,12 +30,12 @@ struct uart_cc13xx_cc26xx_data { @@ -30,12 +30,12 @@ struct uart_cc13xx_cc26xx_data {
uart_irq_callback_user_data_t callback;
void *user_data;
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
Power_NotifyObj postNotify;
bool tx_constrained;
bool rx_constrained;
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -231,8 +231,8 @@ static int uart_cc13xx_cc26xx_fifo_read(const struct device *dev, @@ -231,8 +231,8 @@ static int uart_cc13xx_cc26xx_fifo_read(const struct device *dev,
static void uart_cc13xx_cc26xx_irq_tx_enable(const struct device *dev)
{
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
if (!get_dev_data(dev)->tx_constrained) {
/*
* When tx irq is enabled, it is implicit that we are expecting
@ -256,8 +256,8 @@ static void uart_cc13xx_cc26xx_irq_tx_disable(const struct device *dev) @@ -256,8 +256,8 @@ static void uart_cc13xx_cc26xx_irq_tx_disable(const struct device *dev)
{
UARTIntDisable(get_dev_conf(dev)->regs, UART_INT_TX);
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
if (get_dev_data(dev)->tx_constrained) {
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
get_dev_data(dev)->tx_constrained = false;
@ -272,8 +272,8 @@ static int uart_cc13xx_cc26xx_irq_tx_ready(const struct device *dev) @@ -272,8 +272,8 @@ static int uart_cc13xx_cc26xx_irq_tx_ready(const struct device *dev)
static void uart_cc13xx_cc26xx_irq_rx_enable(const struct device *dev)
{
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
/*
* When rx is enabled, it is implicit that we are expecting
* to receive from the uart, hence we can no longer go into
@ -290,8 +290,8 @@ static void uart_cc13xx_cc26xx_irq_rx_enable(const struct device *dev) @@ -290,8 +290,8 @@ static void uart_cc13xx_cc26xx_irq_rx_enable(const struct device *dev)
static void uart_cc13xx_cc26xx_irq_rx_disable(const struct device *dev)
{
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
if (get_dev_data(dev)->rx_constrained) {
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
get_dev_data(dev)->rx_constrained = false;
@ -359,11 +359,11 @@ static void uart_cc13xx_cc26xx_isr(const struct device *dev) @@ -359,11 +359,11 @@ static void uart_cc13xx_cc26xx_isr(const struct device *dev)
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* ======== postNotifyFxn ========
* Called by Power module when waking up the CPU from Standby, to support
* the case when SYS_POWER_MANAGEMENT is set but DEVICE_POWER_MANAGEMENT is
* the case when PM is set but PM_DEVICE is
* not. The uart needs to be reconfigured afterwards unless Zephyr's device
* PM turned it off, in which case it'd be responsible for turning it back
* on and reconfiguring it.
@ -400,7 +400,7 @@ static int postNotifyFxn(unsigned int eventType, uintptr_t eventArg, @@ -400,7 +400,7 @@ static int postNotifyFxn(unsigned int eventType, uintptr_t eventArg,
}
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev,
uint32_t new_state)
{
@ -471,7 +471,7 @@ static int uart_cc13xx_cc26xx_pm_control(const struct device *dev, @@ -471,7 +471,7 @@ static int uart_cc13xx_cc26xx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
.poll_in = uart_cc13xx_cc26xx_poll_in,
@ -497,7 +497,7 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { @@ -497,7 +497,7 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
};
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
#define UART_CC13XX_CC26XX_POWER_UART(n) \
do { \
get_dev_data(dev)->rx_constrained = false; \
@ -579,7 +579,17 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { @@ -579,7 +579,17 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&uart_cc13xx_cc26xx_driver_api)
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#define UART_CC13XX_CC26XX_DEVICE_API_INIT(n) \
DEVICE_AND_API_INIT(uart_cc13xx_cc26xx_##n, DT_INST_LABEL(n), \
uart_cc13xx_cc26xx_init_##n, &uart_cc13xx_cc26xx_data_##n, \
&uart_cc13xx_cc26xx_config_##n, PRE_KERNEL_1, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&uart_cc13xx_cc26xx_driver_api)
#ifdef CONFIG_PM_DEVICE
#define UART_CC13XX_CC26XX_DEVICE_INIT(n) \
UART_CC13XX_CC26XX_DEVICE_DEFINE(n)
#define UART_CC13XX_CC26XX_INIT_PM_STATE \
do { \
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \

2
drivers/serial/uart_npcx.c

@ -344,7 +344,7 @@ static int uart_npcx_init(const struct device *dev) @@ -344,7 +344,7 @@ static int uart_npcx_init(const struct device *dev)
config->uconf.irq_config_func(dev);
#endif
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
/*
* Configure the UART wake-up event triggered from a falling edge
* on CR_SIN pin. No need for callback function.

4
drivers/serial/uart_nrfx_uart.c

@ -1091,7 +1091,7 @@ static const struct uart_driver_api uart_nrfx_uart_driver_api = { @@ -1091,7 +1091,7 @@ static const struct uart_driver_api uart_nrfx_uart_driver_api = {
#endif /* CONFIG_UART_0_INTERRUPT_DRIVEN */
};
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void uart_nrfx_pins_enable(const struct device *dev, bool enable)
{
@ -1178,7 +1178,7 @@ static int uart_nrfx_pm_control(const struct device *dev, @@ -1178,7 +1178,7 @@ static int uart_nrfx_pm_control(const struct device *dev,
return 0;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static struct uart_nrfx_data uart_nrfx_uart0_data = {
.uart_config = {

11
drivers/serial/uart_nrfx_uarte.c

@ -113,7 +113,8 @@ struct uarte_nrfx_data { @@ -113,7 +113,8 @@ struct uarte_nrfx_data {
#ifdef CONFIG_UART_ASYNC_API
struct uarte_async_cb *async;
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
atomic_val_t poll_out_lock;
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
uint8_t char_out;
@ -1122,7 +1123,7 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) @@ -1122,7 +1123,7 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c)
NRF_UARTE_Type *uarte = get_uarte_instance(dev);
int key;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
if (data->pm_state != DEVICE_PM_ACTIVE_STATE) {
return;
}
@ -1430,7 +1431,7 @@ static int uarte_instance_init(const struct device *dev, @@ -1430,7 +1431,7 @@ static int uarte_instance_init(const struct device *dev,
return err;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
data->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
@ -1479,7 +1480,7 @@ static int uarte_instance_init(const struct device *dev, @@ -1479,7 +1480,7 @@ static int uarte_instance_init(const struct device *dev,
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static void uarte_nrfx_pins_enable(const struct device *dev, bool enable)
{
@ -1615,7 +1616,7 @@ static int uarte_nrfx_pm_control(const struct device *dev, @@ -1615,7 +1616,7 @@ static int uarte_nrfx_pm_control(const struct device *dev,
return 0;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
#define UARTE(idx) DT_NODELABEL(uart##idx)
#define UARTE_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(UARTE(idx), prop)

18
drivers/spi/spi_cc13xx_cc26xx.c

@ -32,7 +32,7 @@ struct spi_cc13xx_cc26xx_config { @@ -32,7 +32,7 @@ struct spi_cc13xx_cc26xx_config {
struct spi_cc13xx_cc26xx_data {
struct spi_context ctx;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -148,8 +148,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev, @@ -148,8 +148,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
spi_context_lock(ctx, false, NULL, config);
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
#endif
@ -185,8 +185,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev, @@ -185,8 +185,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
spi_context_cs_control(ctx, false);
done:
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
#endif
spi_context_release(ctx, err);
@ -211,7 +211,7 @@ static int spi_cc13xx_cc26xx_release(const struct device *dev, @@ -211,7 +211,7 @@ static int spi_cc13xx_cc26xx_release(const struct device *dev,
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
uint32_t new_state)
{
@ -276,7 +276,7 @@ static int spi_cc13xx_cc26xx_pm_control(const struct device *dev, @@ -276,7 +276,7 @@ static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
@ -284,7 +284,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = { @@ -284,7 +284,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
.release = spi_cc13xx_cc26xx_release,
};
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
#define SPI_CC13XX_CC26XX_POWER_SPI(n) \
do { \
/* Set Power dependencies & constraints */ \
@ -337,7 +337,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = { @@ -337,7 +337,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
&spi_cc13xx_cc26xx_driver_api)
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#define SPI_CC13XX_CC26XX_INIT_PM_STATE \
do { \
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \

4
drivers/spi/spi_dw.c

@ -344,11 +344,11 @@ static int transceive(const struct device *dev, @@ -344,11 +344,11 @@ static int transceive(const struct device *dev,
spi_context_lock(&spi->ctx, asynchronous, signal, config);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
if (device_busy_check(dev) != (-EBUSY)) {
device_busy_set(dev);
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
/* Configure */
ret = spi_dw_configure(info, spi, config);

8
drivers/spi/spi_nrfx_spi.c

@ -19,7 +19,7 @@ struct spi_nrfx_data { @@ -19,7 +19,7 @@ struct spi_nrfx_data {
const struct device *dev;
size_t chunk_len;
bool busy;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -276,14 +276,14 @@ static int init_spi(const struct device *dev) @@ -276,14 +276,14 @@ static int init_spi(const struct device *dev)
return -EBUSY;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
dev_data->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int spi_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
@ -329,7 +329,7 @@ static int spi_nrfx_pm_control(const struct device *dev, @@ -329,7 +329,7 @@ static int spi_nrfx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
/*
* Current factors requiring use of DT_NODELABEL:

9
drivers/spi/spi_nrfx_spim.c

@ -20,7 +20,7 @@ struct spi_nrfx_data { @@ -20,7 +20,7 @@ struct spi_nrfx_data {
const struct device *dev;
size_t chunk_len;
bool busy;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
#if (CONFIG_SPI_NRFX_RAM_BUFFER_SIZE > 0)
@ -318,14 +318,15 @@ static int init_spim(const struct device *dev) @@ -318,14 +318,15 @@ static int init_spim(const struct device *dev)
return -EBUSY;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
data->pm_state = DEVICE_PM_ACTIVE_STATE;
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int spim_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg)
@ -371,7 +372,7 @@ static int spim_nrfx_pm_control(const struct device *dev, @@ -371,7 +372,7 @@ static int spim_nrfx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
/*
* We use NODELABEL here because the nrfx API requires us to call

2
drivers/timer/Kconfig.stm32_lptim

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
menuconfig STM32_LPTIM_TIMER
bool "STM32 Low Power Timer [EXPERIMENTAL]"
depends on (SOC_SERIES_STM32L4X || SOC_SERIES_STM32WBX)
depends on CLOCK_CONTROL && SYS_POWER_MANAGEMENT
depends on CLOCK_CONTROL && PM
select TICKLESS_CAPABLE
help
This module implements a kernel device driver for the LowPower Timer

6
drivers/timer/loapic_timer.c

@ -106,7 +106,7 @@ static unsigned char timer_mode = TIMER_MODE_PERIODIC; @@ -106,7 +106,7 @@ static unsigned char timer_mode = TIMER_MODE_PERIODIC;
#endif
#endif /* CONFIG_TICKLESS_IDLE */
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static uint32_t loapic_timer_device_power_state;
static uint32_t reg_timer_save;
static uint32_t reg_timer_cfg_save;
@ -568,7 +568,7 @@ int z_clock_driver_init(const struct device *device) @@ -568,7 +568,7 @@ int z_clock_driver_init(const struct device *device)
periodic_mode_set();
#endif
initial_count_register_set(cycles_per_tick - 1);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
loapic_timer_device_power_state = DEVICE_PM_ACTIVE_STATE;
#endif
@ -579,7 +579,7 @@ int z_clock_driver_init(const struct device *device) @@ -579,7 +579,7 @@ int z_clock_driver_init(const struct device *device)
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int sys_clock_suspend(const struct device *dev)
{
ARG_UNUSED(dev);

2
include/arch/arm/aarch32/irq.h

@ -117,7 +117,7 @@ extern void z_arm_interrupt_init(void); @@ -117,7 +117,7 @@ extern void z_arm_interrupt_init(void);
z_arm_irq_priority_set(irq_p, priority_p, flags_p); \
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
extern void _arch_isr_direct_pm(void);
#define ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
#else

2
include/arch/x86/ia32/arch.h

@ -233,7 +233,7 @@ typedef struct s_isrList { @@ -233,7 +233,7 @@ typedef struct s_isrList {
(flags_p)); \
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* FIXME: z_sys_power_save_idle_exit is defined in kernel.h, which cannot be
* included here due to circular dependency

12
include/device.h

@ -335,7 +335,7 @@ struct device { @@ -335,7 +335,7 @@ struct device {
const void *api;
/** Address of the device instance private data */
void * const data;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
/** Power Management function */
int (*device_pm_control)(const struct device *dev, uint32_t command,
void *context, device_pm_cb cb, void *arg);
@ -409,7 +409,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev) @@ -409,7 +409,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
* @{
*/
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
/** @def DEVICE_PM_ACTIVE_STATE
*
@ -464,7 +464,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev) @@ -464,7 +464,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
#define DEVICE_PM_SET_POWER_STATE 1
#define DEVICE_PM_GET_POWER_STATE 2
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
/**
* @brief Get name of device PM state
@ -492,7 +492,7 @@ void device_busy_set(const struct device *busy_dev); @@ -492,7 +492,7 @@ void device_busy_set(const struct device *busy_dev);
*/
void device_busy_clear(const struct device *busy_dev);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
/*
* Device PM functions
*/
@ -615,7 +615,7 @@ int device_any_busy_check(void); @@ -615,7 +615,7 @@ int device_any_busy_check(void);
*/
int device_busy_check(const struct device *chk_dev);
#ifdef CONFIG_DEVICE_IDLE_PM
#ifdef CONFIG_PM_DEVICE_IDLE
/* Device PM FSM states */
enum device_pm_fsm_state {
@ -741,7 +741,7 @@ static inline int device_pm_put_sync(const struct device *dev) { return -ENOTSUP @@ -741,7 +741,7 @@ static inline int device_pm_put_sync(const struct device *dev) { return -ENOTSUP
Z_INIT_ENTRY_DEFINE(_CONCAT(__device_, dev_name), init_fn, \
(&_CONCAT(__device_, dev_name)), level, prio)
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#define Z_DEVICE_DEFINE_PM(dev_name) \
static struct device_pm _CONCAT(__pm_, dev_name) __used = { \
.usage = ATOMIC_INIT(0), \

2
include/kernel_structs.h

@ -140,7 +140,7 @@ struct z_kernel { @@ -140,7 +140,7 @@ struct z_kernel {
sys_dlist_t timeout_q;
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
int32_t idle; /* Number of ticks for kernel idling */
#endif

2
include/linker/common-ram.ld

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
. = . + DEVICE_BITFIELD_SIZE; \
__device_init_status_end = .;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#define DEVICE_BUSY_BITFIELD() \
FILL(0x00); \
__device_busy_start = .; \

54
include/power/power.h

@ -27,33 +27,33 @@ extern "C" { @@ -27,33 +27,33 @@ extern "C" {
enum power_states {
SYS_POWER_STATE_AUTO = (-2),
SYS_POWER_STATE_ACTIVE = (-1),
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
#ifdef CONFIG_PM_SLEEP_STATES
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_1
SYS_POWER_STATE_SLEEP_1,
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_2
SYS_POWER_STATE_SLEEP_2,
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_3
SYS_POWER_STATE_SLEEP_3,
# endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#endif /* CONFIG_PM_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
SYS_POWER_STATE_DEEP_SLEEP_1,
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_2
SYS_POWER_STATE_DEEP_SLEEP_2,
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_3
SYS_POWER_STATE_DEEP_SLEEP_3,
# endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */
SYS_POWER_STATE_MAX
};
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
extern unsigned char sys_pm_idle_exit_notify;
@ -75,20 +75,20 @@ static inline bool sys_pm_is_sleep_state(enum power_states state) @@ -75,20 +75,20 @@ static inline bool sys_pm_is_sleep_state(enum power_states state)
bool ret = true;
switch (state) {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
#ifdef CONFIG_PM_SLEEP_STATES
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_1
case SYS_POWER_STATE_SLEEP_1:
break;
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_2
case SYS_POWER_STATE_SLEEP_2:
break;
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_3
case SYS_POWER_STATE_SLEEP_3:
break;
# endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#endif /* CONFIG_PM_SLEEP_STATES */
default:
ret = false;
break;
@ -107,20 +107,20 @@ static inline bool sys_pm_is_deep_sleep_state(enum power_states state) @@ -107,20 +107,20 @@ static inline bool sys_pm_is_deep_sleep_state(enum power_states state)
bool ret = true;
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
break;
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_2
case SYS_POWER_STATE_DEEP_SLEEP_2:
break;
# endif
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_3
case SYS_POWER_STATE_DEEP_SLEEP_3:
break;
# endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */
default:
ret = false;
@ -152,7 +152,7 @@ static inline void _sys_pm_idle_exit_notification_disable(void) @@ -152,7 +152,7 @@ static inline void _sys_pm_idle_exit_notification_disable(void)
* And before the end of suspend, the state of forced_pm_state
* is cleared with interrupt disabled.
*
* If enabled SYS_PM_DIRECT_FORCE_MODE, this function can only
* If enabled PM_DIRECT_FORCE_MODE, this function can only
* run in thread context.
*
* @param state Power state which should be used in the ongoing
@ -168,7 +168,7 @@ void sys_pm_force_power_state(enum power_states state); @@ -168,7 +168,7 @@ void sys_pm_force_power_state(enum power_states state);
*/
void sys_set_power_state(enum power_states state);
#ifdef CONFIG_SYS_PM_DEBUG
#ifdef CONFIG_PM_DEBUG
/**
* @brief Dump Low Power states related debug info
*
@ -176,9 +176,9 @@ void sys_set_power_state(enum power_states state); @@ -176,9 +176,9 @@ void sys_set_power_state(enum power_states state);
*/
void sys_pm_dump_debug_info(void);
#endif /* CONFIG_SYS_PM_DEBUG */
#endif /* CONFIG_PM_DEBUG */
#ifdef CONFIG_SYS_PM_STATE_LOCK
#ifdef CONFIG_PM_STATE_LOCK
/**
* @brief Disable particular power state
*
@ -213,7 +213,7 @@ void sys_pm_ctrl_enable_state(enum power_states state); @@ -213,7 +213,7 @@ void sys_pm_ctrl_enable_state(enum power_states state);
*/
bool sys_pm_ctrl_is_state_enabled(enum power_states state);
#endif /* CONFIG_SYS_PM_STATE_LOCK */
#endif /* CONFIG_PM_STATE_LOCK */
/**
* @}
@ -318,7 +318,7 @@ void sys_pm_notify_power_state_exit(enum power_states state); @@ -318,7 +318,7 @@ void sys_pm_notify_power_state_exit(enum power_states state);
* @}
*/
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
#endif /* CONFIG_PM */
#ifdef __cplusplus
}

2
kernel/Kconfig

@ -854,7 +854,7 @@ config TICKLESS_IDLE @@ -854,7 +854,7 @@ config TICKLESS_IDLE
# NB: This option is deprecated, see TICKLESS_KERNEL and
# https://github.com/zephyrproject-rtos/zephyr/pull/12234
bool "Tickless idle"
default y if SYS_POWER_MANAGEMENT || TICKLESS_CAPABLE
default y if PM || TICKLESS_CAPABLE
help
This option suppresses periodic system clock interrupts whenever the
kernel becomes idle. This permits the system to remain in a power

8
kernel/device.c

@ -25,7 +25,7 @@ extern const struct device __device_end[]; @@ -25,7 +25,7 @@ extern const struct device __device_end[];
extern uint32_t __device_init_status_start[];
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
extern uint32_t __device_busy_start[];
extern uint32_t __device_busy_end[];
#define DEVICE_BUSY_SIZE (__device_busy_end - __device_busy_start)
@ -127,7 +127,7 @@ bool z_device_ready(const struct device *dev) @@ -127,7 +127,7 @@ bool z_device_ready(const struct device *dev)
(dev - __device_start)));
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
int device_pm_control_nop(const struct device *unused_device,
uint32_t unused_ctrl_command,
void *unused_context,
@ -162,7 +162,7 @@ int device_busy_check(const struct device *chk_dev) @@ -162,7 +162,7 @@ int device_busy_check(const struct device *chk_dev)
void device_busy_set(const struct device *busy_dev)
{
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
atomic_set_bit((atomic_t *) __device_busy_start,
(busy_dev - __device_start));
#else
@ -172,7 +172,7 @@ void device_busy_set(const struct device *busy_dev) @@ -172,7 +172,7 @@ void device_busy_set(const struct device *busy_dev)
void device_busy_clear(const struct device *busy_dev)
{
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
atomic_clear_bit((atomic_t *) __device_busy_start,
(busy_dev - __device_start));
#else

16
kernel/idle.c

@ -29,7 +29,7 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); @@ -29,7 +29,7 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
#define SMP_FALLBACK 0
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
/*
* Used to allow _sys_suspend() implementation to control notification
* of the event that caused exit from kernel idling after pm operations.
@ -40,20 +40,20 @@ unsigned char sys_pm_idle_exit_notify; @@ -40,20 +40,20 @@ unsigned char sys_pm_idle_exit_notify;
/* LCOV_EXCL_START
* These are almost certainly overidden and in any event do nothing
*/
#if defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM_SLEEP_STATES)
void __attribute__((weak)) _sys_resume(void)
{
}
#endif
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
void __attribute__((weak)) _sys_resume_from_deep_sleep(void)
{
}
#endif
/* LCOV_EXCL_STOP */
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
#endif /* CONFIG_PM */
/**
*
@ -69,7 +69,7 @@ void __attribute__((weak)) _sys_resume_from_deep_sleep(void) @@ -69,7 +69,7 @@ void __attribute__((weak)) _sys_resume_from_deep_sleep(void)
#if !SMP_FALLBACK
static void set_kernel_idle_time_in_ticks(int32_t ticks)
{
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
_kernel.idle = ticks;
#endif
}
@ -89,8 +89,8 @@ static void sys_power_save_idle(void) @@ -89,8 +89,8 @@ static void sys_power_save_idle(void)
#endif
set_kernel_idle_time_in_ticks(ticks);
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES) || \
defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
#if (defined(CONFIG_PM_SLEEP_STATES) || \
defined(CONFIG_PM_DEEP_SLEEP_STATES))
sys_pm_idle_exit_notify = 1U;
@ -119,7 +119,7 @@ static void sys_power_save_idle(void) @@ -119,7 +119,7 @@ static void sys_power_save_idle(void)
void z_sys_power_save_idle_exit(int32_t ticks)
{
#if defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM_SLEEP_STATES)
/* Some CPU low power states require notification at the ISR
* to allow any operations that needs to be done before kernel
* switches task or processes nested interrupts. This can be

2
kernel/include/kernel_offsets.h

@ -31,7 +31,7 @@ GEN_OFFSET_SYM(_cpu_t, irq_stack); @@ -31,7 +31,7 @@ GEN_OFFSET_SYM(_cpu_t, irq_stack);
GEN_OFFSET_SYM(_kernel_t, threads);
#endif
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
GEN_OFFSET_SYM(_kernel_t, idle);
#endif

2
samples/basic/minimal/common.conf

@ -8,7 +8,7 @@ CONFIG_SERIAL=n @@ -8,7 +8,7 @@ CONFIG_SERIAL=n
CONFIG_FLASH=n
# Power management
CONFIG_SYS_POWER_MANAGEMENT=n
CONFIG_PM=n
# Interrupts
CONFIG_DYNAMIC_INTERRUPTS=n

4
samples/boards/mec15xxevb_assy6853/power_management/prj.conf

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
# Enable config log
CONFIG_LOG=y
# Logging thread frequency higher than CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
# Logging thread frequency higher than CONFIG_PM_MIN_RESIDENCY_DEEP_SLEEP_1
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=2100
CONFIG_THREAD_NAME=y
# Enable PM debug in MEC1501 this will give indication in MCHP_060
CONFIG_SYS_PM_DEBUG=y
CONFIG_PM_DEBUG=y

10
samples/boards/mec15xxevb_assy6853/power_management/src/power_mgmt.c

@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(pwrmgmt_test); @@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(pwrmgmt_test);
/* Thread properties */
#define TASK_STACK_SIZE 1024ul
#define PRIORITY K_PRIO_COOP(5)
/* Sleep time should be lower than CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1 */
/* Sleep time should be lower than CONFIG_PM_MIN_RESIDENCY_SLEEP_1 */
#define THREAD_A_SLEEP_TIME 100ul
#define THREAD_B_SLEEP_TIME 1000ul
@ -272,7 +272,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles) @@ -272,7 +272,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles)
LOG_INF("Suspend...");
suspend_all_tasks();
LOG_INF("About to enter light sleep");
k_msleep(CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1 +
k_msleep(CONFIG_PM_MIN_RESIDENCY_SLEEP_1 +
LT_EXTRA_SLP_TIME);
k_busy_wait(100);
@ -292,7 +292,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles) @@ -292,7 +292,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles)
/* GPIO toggle to measure latency for deep sleep */
pm_trigger_marker();
k_msleep(CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1 +
k_msleep(CONFIG_PM_MIN_RESIDENCY_DEEP_SLEEP_1 +
DP_EXTRA_SLP_TIME);
k_busy_wait(100);
@ -328,7 +328,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles) @@ -328,7 +328,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles)
/* Trigger Light Sleep 1 state. 48MHz PLL stays on */
LOG_INF("About to enter light sleep");
k_msleep(CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1 +
k_msleep(CONFIG_PM_MIN_RESIDENCY_SLEEP_1 +
LT_EXTRA_SLP_TIME);
k_busy_wait(100);
@ -343,7 +343,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles) @@ -343,7 +343,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles)
/* GPIO toggle to measure latency */
pm_trigger_marker();
k_msleep(CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1 +
k_msleep(CONFIG_PM_MIN_RESIDENCY_DEEP_SLEEP_1 +
DP_EXTRA_SLP_TIME);
k_busy_wait(100);

4
samples/boards/mec15xxevb_assy6853/power_management/src/power_mgmt.h

@ -11,10 +11,10 @@ @@ -11,10 +11,10 @@
/** @brief Alternates between light and deep sleep cycles.
*
* For light sleep, the test sleeps in main thread for 500 ms longer than
* CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_1.
* CONFIG_PM_MIN_RESIDENCY_SLEEP_1.
*
* Similarly for deep sleep, the test sleeps in the main thread for 500 ms
* longer than CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1.
* longer than CONFIG_PM_MIN_RESIDENCY_DEEP_SLEEP_1.
*
* @param use_logging test progress will be reported using logging,
* otherwise printk.

8
samples/boards/nrf/system_off/prj.conf

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_PM=y
CONFIG_PM_DEEP_SLEEP_STATES=y
# Required to disable default behavior of deep sleep on timeout
CONFIG_SYS_PM_STATE_LOCK=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_PM_STATE_LOCK=y
CONFIG_PM_DEVICE=y
CONFIG_GPIO=y

8
samples/boards/ti/cc13x2_cc26x2/system_off/prj.conf

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
CONFIG_GPIO=y
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_PM=y
CONFIG_PM_SLEEP_STATES=y
CONFIG_PM_DEEP_SLEEP_STATES=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_PM_DEVICE=y

2
samples/drivers/spi_flash_at45/overlay-pm.conf

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_PM_DEVICE=y

1
samples/drivers/spi_flash_at45/prj.conf

@ -5,3 +5,4 @@ CONFIG_LOG_IMMEDIATE=y @@ -5,3 +5,4 @@ CONFIG_LOG_IMMEDIATE=y
CONFIG_SPI=y
CONFIG_SPI_FLASH_AT45=y
CONFIG_FLASH=y
CONFIG_PM_DEVICE=y

2
samples/drivers/spi_flash_at45/src/main.c

@ -149,7 +149,7 @@ void main(void) @@ -149,7 +149,7 @@ void main(void)
printk("OK\n");
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#if IS_ENABLED(CONFIG_PM_DEVICE)
printk("Putting the flash device into low power state... ");
err = device_set_power_state(flash_dev, DEVICE_PM_LOW_POWER_STATE,
NULL, NULL);

4
samples/net/sockets/echo_server/boards/frdm_k64f.conf

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_NET_STATISTICS_POWER_MANAGEMENT=y

2
samples/philosophers/prj_tickless.conf

@ -3,7 +3,7 @@ CONFIG_ASSERT=y @@ -3,7 +3,7 @@ CONFIG_ASSERT=y
CONFIG_ASSERT_LEVEL=2
CONFIG_NUM_COOP_PRIORITIES=29
CONFIG_NUM_PREEMPT_PRIORITIES=40
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_PM=y
CONFIG_TICKLESS_KERNEL=y
CONFIG_MP_NUM_CPUS=1

2
samples/sensor/apds9960/prj.conf

@ -9,4 +9,4 @@ CONFIG_I2C_LOG_LEVEL_INF=y @@ -9,4 +9,4 @@ CONFIG_I2C_LOG_LEVEL_INF=y
CONFIG_APDS9960=y
CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD=n
CONFIG_DEVICE_POWER_MANAGEMENT=n
CONFIG_PM_DEVICE=n

2
samples/sensor/apds9960/src/main.c

@ -76,7 +76,7 @@ void main(void) @@ -76,7 +76,7 @@ void main(void)
printk("ambient light intensity %d, proximity %d\n",
intensity.val1, pdata.val1);
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t p_state;
p_state = DEVICE_PM_LOW_POWER_STATE;

6
samples/subsys/power/device_pm/prj.conf

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_DEVICE_IDLE_PM=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_IDLE=y

2
soc/arm/microchip_mec/mec1501/CMakeLists.txt

@ -8,7 +8,7 @@ zephyr_sources( @@ -8,7 +8,7 @@ zephyr_sources(
soc.c
)
zephyr_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
zephyr_sources_ifdef(CONFIG_PM
device_power.c
power.c
)

12
soc/arm/microchip_mec/mec1501/Kconfig.defconfig.mec1501hsz

@ -61,22 +61,22 @@ config SPI_XEC_QMSPI @@ -61,22 +61,22 @@ config SPI_XEC_QMSPI
if SOC_POWER_MANAGEMENT
config SYS_POWER_MANAGEMENT
config PM
default y
config SYS_POWER_SLEEP_STATES
config PM_SLEEP_STATES
default y
config HAS_SYS_POWER_STATE_SLEEP_1
config HAS_POWER_STATE_SLEEP_1
default y
config SYS_POWER_DEEP_SLEEP_STATES
config PM_DEEP_SLEEP_STATES
default y
config HAS_SYS_POWER_STATE_DEEP_SLEEP_1
config HAS_POWER_STATE_DEEP_SLEEP_1
default y
config DEVICE_POWER_MANAGEMENT
config PM_DEVICE
default n
endif # SOC_POWER_MANAGEMENT

4
soc/arm/microchip_mec/mec1501/device_power.c

@ -48,7 +48,7 @@ void soc_lite_sleep_enable(void) @@ -48,7 +48,7 @@ void soc_lite_sleep_enable(void)
* will be ramping up from ~16 to 24 MHz.
*/
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
void soc_deep_sleep_enable(void)
{
@ -228,4 +228,4 @@ void soc_deep_sleep_periph_restore(void) @@ -228,4 +228,4 @@ void soc_deep_sleep_periph_restore(void)
#endif /* DEEP_SLEEP_PERIPH_SAVE_RESTORE */
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */

2
soc/arm/microchip_mec/mec1501/device_power.h

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
void soc_lite_sleep_enable(void);
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
void soc_deep_sleep_enable(void);
void soc_deep_sleep_disable(void);
void soc_deep_sleep_periph_save(void);

12
soc/arm/microchip_mec/mec1501/power.c

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
#include <soc.h>
#include "device_power.h"
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
/*
* Deep Sleep
@ -79,7 +79,7 @@ static void z_power_soc_deep_sleep(void) @@ -79,7 +79,7 @@ static void z_power_soc_deep_sleep(void)
}
#endif
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_PM_SLEEP_STATES
/*
* Light Sleep
@ -110,12 +110,12 @@ static void z_power_soc_sleep(void) @@ -110,12 +110,12 @@ static void z_power_soc_sleep(void)
void sys_set_power_state(enum power_states state)
{
switch (state) {
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
#if (defined(CONFIG_PM_SLEEP_STATES))
case SYS_POWER_STATE_SLEEP_1:
z_power_soc_sleep();
break;
#endif
#if (defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
#if (defined(CONFIG_PM_DEEP_SLEEP_STATES))
case SYS_POWER_STATE_DEEP_SLEEP_1:
z_power_soc_deep_sleep();
break;
@ -128,12 +128,12 @@ void sys_set_power_state(enum power_states state) @@ -128,12 +128,12 @@ void sys_set_power_state(enum power_states state)
void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
#if (defined(CONFIG_PM_SLEEP_STATES))
case SYS_POWER_STATE_SLEEP_1:
__enable_irq();
break;
#endif
#if (defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
#if (defined(CONFIG_PM_DEEP_SLEEP_STATES))
case SYS_POWER_STATE_DEEP_SLEEP_1:
__enable_irq();
break;

2
soc/arm/nordic_nrf/Kconfig.defconfig

@ -27,7 +27,7 @@ config SYS_CLOCK_TICKS_PER_SEC @@ -27,7 +27,7 @@ config SYS_CLOCK_TICKS_PER_SEC
config ARCH_HAS_CUSTOM_BUSY_WAIT
default y
config SYS_POWER_MANAGEMENT
config PM
default y
config BUILD_OUTPUT_HEX

2
soc/arm/nordic_nrf/nrf51/CMakeLists.txt

@ -6,7 +6,7 @@ zephyr_library_sources( @@ -6,7 +6,7 @@ zephyr_library_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)

2
soc/arm/nordic_nrf/nrf51/Kconfig.series

@ -9,7 +9,7 @@ config SOC_SERIES_NRF51X @@ -9,7 +9,7 @@ config SOC_SERIES_NRF51X
select ARM
select CPU_CORTEX_M0
select SOC_FAMILY_NRF
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_NRFX
select HAS_SEGGER_RTT

8
soc/arm/nordic_nrf/nrf51/power.c

@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); @@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_power_system_off(NRF_POWER);
break;
@ -31,8 +31,8 @@ void sys_set_power_state(enum power_states state) @@ -31,8 +31,8 @@ void sys_set_power_state(enum power_states state)
void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

2
soc/arm/nordic_nrf/nrf52/CMakeLists.txt

@ -6,7 +6,7 @@ zephyr_library_sources( @@ -6,7 +6,7 @@ zephyr_library_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)

2
soc/arm/nordic_nrf/nrf52/Kconfig.series

@ -10,7 +10,7 @@ config SOC_SERIES_NRF52X @@ -10,7 +10,7 @@ config SOC_SERIES_NRF52X
select CPU_CORTEX_M4
select CPU_HAS_ARM_MPU
select SOC_FAMILY_NRF
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_NRFX
select HAS_NORDIC_DRIVERS

8
soc/arm/nordic_nrf/nrf52/power.c

@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); @@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_power_system_off(NRF_POWER);
break;
@ -31,8 +31,8 @@ void sys_set_power_state(enum power_states state) @@ -31,8 +31,8 @@ void sys_set_power_state(enum power_states state)
void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

2
soc/arm/nordic_nrf/nrf53/CMakeLists.txt

@ -4,6 +4,6 @@ zephyr_sources( @@ -4,6 +4,6 @@ zephyr_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)

2
soc/arm/nordic_nrf/nrf53/Kconfig.soc

@ -9,7 +9,7 @@ config SOC_NRF5340_CPUAPP @@ -9,7 +9,7 @@ config SOC_NRF5340_CPUAPP
select CPU_HAS_NRF_IDAU
select CPU_HAS_FPU
select ARMV8_M_DSP
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_POWER_STATE_DEEP_SLEEP_1
select HAS_HW_NRF_CC312
select HAS_HW_NRF_CLOCK
select HAS_HW_NRF_DPPIC

10
soc/arm/nordic_nrf/nrf53/power.c

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
#include <zephyr.h>
#include <power/power.h>
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
#include <hal/nrf_regulators.h>
#endif
@ -18,8 +18,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); @@ -18,8 +18,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_regulators_system_off(NRF_REGULATORS);
break;
@ -35,8 +35,8 @@ void sys_set_power_state(enum power_states state) @@ -35,8 +35,8 @@ void sys_set_power_state(enum power_states state)
void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

2
soc/arm/nordic_nrf/nrf91/CMakeLists.txt

@ -4,6 +4,6 @@ zephyr_sources( @@ -4,6 +4,6 @@ zephyr_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)

2
soc/arm/nordic_nrf/nrf91/Kconfig.series

@ -13,7 +13,7 @@ config SOC_SERIES_NRF91X @@ -13,7 +13,7 @@ config SOC_SERIES_NRF91X
select CPU_HAS_FPU
select ARMV8_M_DSP
select SOC_FAMILY_NRF
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select HAS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_NRFX
select HAS_SEGGER_RTT

8
soc/arm/nordic_nrf/nrf91/power.c

@ -15,8 +15,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); @@ -15,8 +15,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
void sys_set_power_state(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
nrf_regulators_system_off(NRF_REGULATORS);
break;
@ -32,8 +32,8 @@ void sys_set_power_state(enum power_states state) @@ -32,8 +32,8 @@ void sys_set_power_state(enum power_states state)
void _sys_pm_power_state_exit_post_ops(enum power_states state)
{
switch (state) {
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
case SYS_POWER_STATE_DEEP_SLEEP_1:
/* Nothing to do. */
break;

2
soc/arm/silabs_exx32/Kconfig.defconfig

@ -6,6 +6,6 @@ source "soc/arm/silabs_exx32/*/Kconfig.defconfig.series" @@ -6,6 +6,6 @@ source "soc/arm/silabs_exx32/*/Kconfig.defconfig.series"
config SOC_GECKO_EMU
default y
depends on SYS_POWER_MANAGEMENT
depends on PM
endif

2
soc/arm/silabs_exx32/common/CMakeLists.txt

@ -2,4 +2,4 @@ @@ -2,4 +2,4 @@
zephyr_sources(soc.c soc_gpio.c)
zephyr_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT soc_power.c)
zephyr_sources_ifdef(CONFIG_PM soc_power.c)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save