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>
This commit is contained in:
parent
06a5946266
commit
dd931f93a2
150 changed files with 551 additions and 526 deletions
|
@ -498,7 +498,7 @@ endchoice
|
||||||
config BOOTLOADER_CONTEXT_RESTORE
|
config BOOTLOADER_CONTEXT_RESTORE
|
||||||
bool "Boot loader has context restore support"
|
bool "Boot loader has context restore support"
|
||||||
default y
|
default y
|
||||||
depends on SYS_POWER_DEEP_SLEEP_STATES && BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
|
depends on PM_DEEP_SLEEP_STATES && BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
|
||||||
help
|
help
|
||||||
This option signifies that the target has a bootloader
|
This option signifies that the target has a bootloader
|
||||||
that restores CPU context upon resuming from deep sleep
|
that restores CPU context upon resuming from deep sleep
|
||||||
|
|
12
arch/Kconfig
12
arch/Kconfig
|
@ -482,37 +482,37 @@ config ARCH_HAS_THREAD_ABORT
|
||||||
# individual SoC.
|
# individual SoC.
|
||||||
#
|
#
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_SLEEP_1
|
config HAS_POWER_STATE_SLEEP_1
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_1
|
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_1
|
||||||
configuration option.
|
configuration option.
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_SLEEP_2
|
config HAS_POWER_STATE_SLEEP_2
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_2
|
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_2
|
||||||
configuration option.
|
configuration option.
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_SLEEP_3
|
config HAS_POWER_STATE_SLEEP_3
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_3
|
This option signifies that the target supports the SYS_POWER_STATE_SLEEP_3
|
||||||
configuration option.
|
configuration option.
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
config HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_1
|
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_1
|
||||||
configuration option.
|
configuration option.
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_DEEP_SLEEP_2
|
config HAS_POWER_STATE_DEEP_SLEEP_2
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_2
|
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_2
|
||||||
configuration option.
|
configuration option.
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_DEEP_SLEEP_3
|
config HAS_POWER_STATE_DEEP_SLEEP_3
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_3
|
This option signifies that the target supports the SYS_POWER_STATE_DEEP_SLEEP_3
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
GTEXT(_isr_wrapper)
|
GTEXT(_isr_wrapper)
|
||||||
GTEXT(_isr_demux)
|
GTEXT(_isr_demux)
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#if defined(CONFIG_PM)
|
||||||
GTEXT(z_sys_power_save_idle_exit)
|
GTEXT(z_sys_power_save_idle_exit)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ rirq_path:
|
||||||
|
|
||||||
/* r0, r1, and r3 will be used in exit_tickless_idle macro */
|
/* r0, r1, and r3 will be used in exit_tickless_idle macro */
|
||||||
.macro exit_tickless_idle
|
.macro exit_tickless_idle
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#if defined(CONFIG_PM)
|
||||||
clri r0 /* do not interrupt exiting tickless idle operations */
|
clri r0 /* do not interrupt exiting tickless idle operations */
|
||||||
mov_s r1, _kernel
|
mov_s r1, _kernel
|
||||||
ld_s r3, [r1, _kernel_offset_to_idle] /* requested idle duration */
|
ld_s r3, [r1, _kernel_offset_to_idle] /* requested idle duration */
|
||||||
|
|
|
@ -154,7 +154,7 @@ done_mpu_regions_reset:
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES) && \
|
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
|
||||||
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
|
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
|
||||||
jl @_sys_resume_from_deep_sleep
|
jl @_sys_resume_from_deep_sleep
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -161,7 +161,7 @@ void z_irq_spurious(const void *unused)
|
||||||
z_arm_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
|
z_arm_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
void _arch_isr_direct_pm(void)
|
void _arch_isr_direct_pm(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) \
|
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) \
|
||||||
|
|
|
@ -84,7 +84,7 @@ SECTION_FUNC(TEXT, _isr_wrapper)
|
||||||
bl sys_trace_isr_enter
|
bl sys_trace_isr_enter
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/*
|
/*
|
||||||
* All interrupts are disabled when handling idle wakeup. For tickless
|
* All interrupts are disabled when handling idle wakeup. For tickless
|
||||||
* idle, this ensures that the calculation and programming of the
|
* idle, this ensures that the calculation and programming of the
|
||||||
|
@ -139,7 +139,7 @@ _idle_state_cleared:
|
||||||
cpsie i /* re-enable interrupts (PRIMASK = 0) */
|
cpsie i /* re-enable interrupts (PRIMASK = 0) */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_CORTEX_M)
|
#if defined(CONFIG_CPU_CORTEX_M)
|
||||||
mrs r0, IPSR /* get exception number */
|
mrs r0, IPSR /* get exception number */
|
||||||
|
|
|
@ -103,7 +103,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
|
||||||
} /* LCOV_EXCL_LINE */
|
} /* LCOV_EXCL_LINE */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/**
|
/**
|
||||||
* If the kernel is in idle mode, take it out
|
* If the kernel is in idle mode, take it out
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
GDATA(_sse_mxcsr_default_value)
|
GDATA(_sse_mxcsr_default_value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
GTEXT(_sys_resume_from_deep_sleep)
|
GTEXT(_sys_resume_from_deep_sleep)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ __csSet:
|
||||||
#else
|
#else
|
||||||
addl $CONFIG_ISR_STACK_SIZE, %esp
|
addl $CONFIG_ISR_STACK_SIZE, %esp
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES) && \
|
#if defined(CONFIG_PM_DEEP_SLEEP_STATES) && \
|
||||||
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
|
!defined(CONFIG_BOOTLOADER_CONTEXT_RESTORE)
|
||||||
/*
|
/*
|
||||||
* Invoke _sys_resume_from_deep_sleep() hook to handle resume from
|
* Invoke _sys_resume_from_deep_sleep() hook to handle resume from
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
GTEXT(arch_swap)
|
GTEXT(arch_swap)
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
GTEXT(z_sys_power_save_idle_exit)
|
GTEXT(z_sys_power_save_idle_exit)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -144,11 +144,11 @@ SECTION_FUNC(TEXT, _interrupt_enter)
|
||||||
|
|
||||||
pushl %edi /* Save stack pointer */
|
pushl %edi /* Save stack pointer */
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
cmpl $0, _kernel_offset_to_idle(%ecx)
|
cmpl $0, _kernel_offset_to_idle(%ecx)
|
||||||
jne handle_idle
|
jne handle_idle
|
||||||
/* fast path is !idle, in the pipeline */
|
/* fast path is !idle, in the pipeline */
|
||||||
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
/* fall through to nested case */
|
/* fall through to nested case */
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ nestedInterrupt:
|
||||||
KPTI_IRET
|
KPTI_IRET
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
handle_idle:
|
handle_idle:
|
||||||
pushl %eax
|
pushl %eax
|
||||||
pushl %edx
|
pushl %edx
|
||||||
|
@ -319,7 +319,7 @@ handle_idle:
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %eax
|
popl %eax
|
||||||
jmp alreadyOnIntStack
|
jmp alreadyOnIntStack
|
||||||
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -8,12 +8,12 @@ if BOARD_CC1352R1_LAUNCHXL
|
||||||
config BOARD
|
config BOARD
|
||||||
default "cc1352r1_launchxl"
|
default "cc1352r1_launchxl"
|
||||||
|
|
||||||
if SYS_POWER_MANAGEMENT
|
if PM
|
||||||
|
|
||||||
# Ideally this value could be made to less than 1 ms, as there is
|
# 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
|
# essentially no delay to come out of IDLE mode. However Zephyr only
|
||||||
# supports millisecond precision here, so 1 ms is the best approximation.
|
# 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
|
default 1
|
||||||
|
|
||||||
# The default here is deliberately made higher to be less agressive, to
|
# The default here is deliberately made higher to be less agressive, to
|
||||||
|
@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
|
||||||
# given application, weighing tradeoffs between a lower value that leads to
|
# given application, weighing tradeoffs between a lower value that leads to
|
||||||
# higher power savings vs. a higher value that would accommodate for a higher
|
# higher power savings vs. a higher value that would accommodate for a higher
|
||||||
# wakeup latency.
|
# wakeup latency.
|
||||||
config SYS_PM_MIN_RESIDENCY_SLEEP_2
|
config PM_MIN_RESIDENCY_SLEEP_2
|
||||||
default 5
|
default 5
|
||||||
|
|
||||||
endif # SYS_POWER_MANAGEMENT
|
endif # PM
|
||||||
endif # BOARD_CC1352R1_LAUNCHXL
|
endif # BOARD_CC1352R1_LAUNCHXL
|
||||||
|
|
|
@ -205,11 +205,11 @@ Power Management and UART
|
||||||
|
|
||||||
System and device power management are supported on this platform, and
|
System and device power management are supported on this platform, and
|
||||||
can be enabled via the standard Kconfig options in Zephyr, such as
|
can be enabled via the standard Kconfig options in Zephyr, such as
|
||||||
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
|
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
|
||||||
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
|
:option:`CONFIG_PM_SLEEP_STATES`, and
|
||||||
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
|
: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
|
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
|
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
|
system enters standby mode between calls to uart_poll_in(). This is because
|
||||||
|
|
|
@ -9,12 +9,12 @@ if BOARD_CC1352R_SENSORTAG
|
||||||
config BOARD
|
config BOARD
|
||||||
default "cc1352r_sensortag"
|
default "cc1352r_sensortag"
|
||||||
|
|
||||||
if SYS_POWER_MANAGEMENT
|
if PM
|
||||||
|
|
||||||
# Ideally this value could be made to less than 1 ms, as there is
|
# 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
|
# essentially no delay to come out of IDLE mode. However Zephyr only
|
||||||
# supports millisecond precision here, so 1 ms is the best approximation.
|
# 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
|
default 1
|
||||||
|
|
||||||
# The default here is deliberately made higher to be less agressive, to
|
# The default here is deliberately made higher to be less agressive, to
|
||||||
|
@ -26,8 +26,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
|
||||||
# given application, weighing tradeoffs between a lower value that leads to
|
# given application, weighing tradeoffs between a lower value that leads to
|
||||||
# higher power savings vs. a higher value that would accommodate for a higher
|
# higher power savings vs. a higher value that would accommodate for a higher
|
||||||
# wakeup latency.
|
# wakeup latency.
|
||||||
config SYS_PM_MIN_RESIDENCY_SLEEP_2
|
config PM_MIN_RESIDENCY_SLEEP_2
|
||||||
default 5
|
default 5
|
||||||
|
|
||||||
endif # SYS_POWER_MANAGEMENT
|
endif # PM
|
||||||
endif # BOARD_CC1352R_SENSORTAG
|
endif # BOARD_CC1352R_SENSORTAG
|
||||||
|
|
|
@ -231,11 +231,11 @@ Power Management and UART
|
||||||
|
|
||||||
System and device power management are supported on this platform, and
|
System and device power management are supported on this platform, and
|
||||||
can be enabled via the standard Kconfig options in Zephyr, such as
|
can be enabled via the standard Kconfig options in Zephyr, such as
|
||||||
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
|
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
|
||||||
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
|
:option:`CONFIG_PM_SLEEP_STATES`, and
|
||||||
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
|
: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
|
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
|
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
|
system enters standby mode between calls to uart_poll_in(). This is because
|
||||||
|
|
|
@ -8,12 +8,12 @@ if BOARD_CC26X2R1_LAUNCHXL
|
||||||
config BOARD
|
config BOARD
|
||||||
default "cc26x2r1_launchxl"
|
default "cc26x2r1_launchxl"
|
||||||
|
|
||||||
if SYS_POWER_MANAGEMENT
|
if PM
|
||||||
|
|
||||||
# Ideally this value could be made to less than 1 ms, as there is
|
# 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
|
# essentially no delay to come out of IDLE mode. However Zephyr only
|
||||||
# supports millisecond precision here, so 1 ms is the best approximation.
|
# 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
|
default 1
|
||||||
|
|
||||||
# The default here is deliberately made higher to be less agressive, to
|
# The default here is deliberately made higher to be less agressive, to
|
||||||
|
@ -25,8 +25,8 @@ config SYS_PM_MIN_RESIDENCY_SLEEP_1
|
||||||
# given application, weighing tradeoffs between a lower value that leads to
|
# given application, weighing tradeoffs between a lower value that leads to
|
||||||
# higher power savings vs. a higher value that would accommodate for a higher
|
# higher power savings vs. a higher value that would accommodate for a higher
|
||||||
# wakeup latency.
|
# wakeup latency.
|
||||||
config SYS_PM_MIN_RESIDENCY_SLEEP_2
|
config PM_MIN_RESIDENCY_SLEEP_2
|
||||||
default 5
|
default 5
|
||||||
|
|
||||||
endif # SYS_POWER_MANAGEMENT
|
endif # PM
|
||||||
endif # BOARD_CC26X2R1_LAUNCHXL
|
endif # BOARD_CC26X2R1_LAUNCHXL
|
||||||
|
|
|
@ -211,11 +211,11 @@ Power Management and UART
|
||||||
|
|
||||||
System and device power management are supported on this platform, and
|
System and device power management are supported on this platform, and
|
||||||
can be enabled via the standard Kconfig options in Zephyr, such as
|
can be enabled via the standard Kconfig options in Zephyr, such as
|
||||||
:option:`CONFIG_SYS_POWER_MANAGEMENT`, :option:`CONFIG_DEVICE_POWER_MANAGEMENT`,
|
:option:`CONFIG_PM`, :option:`CONFIG_PM_DEVICE`,
|
||||||
:option:`CONFIG_SYS_POWER_SLEEP_STATES`, and
|
:option:`CONFIG_PM_SLEEP_STATES`, and
|
||||||
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`.
|
: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
|
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
|
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
|
system enters standby mode between calls to uart_poll_in(). This is because
|
||||||
|
|
|
@ -54,13 +54,13 @@ config TACH_XEC
|
||||||
depends on SENSOR
|
depends on SENSOR
|
||||||
|
|
||||||
# power management stuff
|
# power management stuff
|
||||||
if SYS_POWER_MANAGEMENT
|
if PM
|
||||||
|
|
||||||
config SYS_PM_MIN_RESIDENCY_SLEEP_1
|
config PM_MIN_RESIDENCY_SLEEP_1
|
||||||
default 1000
|
default 1000
|
||||||
|
|
||||||
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
|
config PM_MIN_RESIDENCY_DEEP_SLEEP_1
|
||||||
default 2000
|
default 2000
|
||||||
|
|
||||||
endif # SYS_POWER_MANAGEMENT
|
endif # PM
|
||||||
endif # BOARD_MEC1501MODULAR_ASSY6885
|
endif # BOARD_MEC1501MODULAR_ASSY6885
|
||||||
|
|
|
@ -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 /* DT_NODE_HAS_STATUS(DT_INST(0, microchip_xec_qmspi), okay) */
|
||||||
#endif /* CONFIG_SPI_XEC_QMSPI */
|
#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.
|
* Deep sleep testing: Enable TEST_CLK_OUT on GPIO_060 function 2.
|
||||||
* TEST_CLK_OUT is the PLL 48MHz conditioned output.
|
* TEST_CLK_OUT is the PLL 48MHz conditioned output.
|
||||||
|
|
|
@ -71,14 +71,14 @@ config TACH_XEC
|
||||||
depends on SENSOR
|
depends on SENSOR
|
||||||
|
|
||||||
# power management stuff
|
# power management stuff
|
||||||
if SYS_POWER_MANAGEMENT
|
if PM
|
||||||
|
|
||||||
config SYS_PM_MIN_RESIDENCY_SLEEP_1
|
config PM_MIN_RESIDENCY_SLEEP_1
|
||||||
default 1000
|
default 1000
|
||||||
|
|
||||||
config SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1
|
config PM_MIN_RESIDENCY_DEEP_SLEEP_1
|
||||||
default 2000
|
default 2000
|
||||||
|
|
||||||
endif # SYS_POWER_MANAGEMENT
|
endif # PM
|
||||||
|
|
||||||
endif # BOARD_MEC15XXEVB_ASSY6853
|
endif # BOARD_MEC15XXEVB_ASSY6853
|
||||||
|
|
|
@ -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 /* DT_NODE_HAS_STATUS(DT_INST(0, microchip_xec_qmspi), okay) */
|
||||||
#endif /* CONFIG_SPI_XEC_QMSPI */
|
#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.
|
* Deep sleep testing: Enable TEST_CLK_OUT on GPIO_060 function 2.
|
||||||
* TEST_CLK_OUT is the PLL 48MHz conditioned output.
|
* TEST_CLK_OUT is the PLL 48MHz conditioned output.
|
||||||
|
|
|
@ -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_HEADER() do { } while (0)
|
||||||
#define ARCH_ISR_DIRECT_FOOTER(a) 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);
|
extern void posix_irq_check_idle_exit(void);
|
||||||
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
|
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -43,7 +43,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap)
|
||||||
*may_swap |= ((direct_irq_f_ptr)
|
*may_swap |= ((direct_irq_f_ptr)
|
||||||
irq_vector_table[irq_nbr].func)();
|
irq_vector_table[irq_nbr].func)();
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
posix_irq_check_idle_exit();
|
posix_irq_check_idle_exit();
|
||||||
#endif
|
#endif
|
||||||
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)
|
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)
|
||||||
|
|
|
@ -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_HEADER() do { } while (0)
|
||||||
#define ARCH_ISR_DIRECT_FOOTER(a) 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);
|
extern void posix_irq_check_idle_exit(void);
|
||||||
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
|
#define ARCH_ISR_DIRECT_PM() posix_irq_check_idle_exit()
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -98,7 +98,7 @@ static inline void vector_to_irq(int irq_nbr, int *may_swap)
|
||||||
*may_swap |= ((direct_irq_f_ptr)
|
*may_swap |= ((direct_irq_f_ptr)
|
||||||
irq_vector_table[irq_nbr].func)();
|
irq_vector_table[irq_nbr].func)();
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
posix_irq_check_idle_exit();
|
posix_irq_check_idle_exit();
|
||||||
#endif
|
#endif
|
||||||
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)
|
((normal_irq_f_ptr)irq_vector_table[irq_nbr].func)
|
||||||
|
|
|
@ -90,7 +90,7 @@ System Power Management
|
||||||
***********************
|
***********************
|
||||||
|
|
||||||
The kernel enters the idle state when it has nothing to schedule. If enabled via
|
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
|
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
|
on the selected power management policy and the duration of the idle time
|
||||||
allotted by the kernel.
|
allotted by the kernel.
|
||||||
|
@ -491,7 +491,7 @@ Power Management Configuration Flags
|
||||||
The Power Management features can be individually enabled and disabled using
|
The Power Management features can be individually enabled and disabled using
|
||||||
the following configuration flags.
|
the following configuration flags.
|
||||||
|
|
||||||
:option:`CONFIG_SYS_POWER_MANAGEMENT`
|
:option:`CONFIG_PM`
|
||||||
|
|
||||||
This flag enables the power management subsystem.
|
This flag enables the power management subsystem.
|
||||||
|
|
||||||
|
@ -499,20 +499,20 @@ the following configuration flags.
|
||||||
|
|
||||||
This flag enables the tickless idle power saving feature.
|
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.
|
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.
|
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
|
This flag is enabled if the SOC interface and the devices support device power
|
||||||
management.
|
management.
|
||||||
|
|
||||||
:code:`CONFIG_DEVICE_IDLE_PM`
|
:code:`CONFIG_PM_DEVICE_IDLE`
|
||||||
|
|
||||||
This flag enables the Device Idle Power Management.
|
This flag enables the Device Idle Power Management.
|
||||||
|
|
||||||
|
|
|
@ -1966,8 +1966,8 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \
|
||||||
"CONFIG_BT_USER_PHY_UPDATE" \
|
"CONFIG_BT_USER_PHY_UPDATE" \
|
||||||
"CONFIG_BT_SMP" \
|
"CONFIG_BT_SMP" \
|
||||||
"CONFIG_BT_SMP_APP_PAIRING_ACCEPT" \
|
"CONFIG_BT_SMP_APP_PAIRING_ACCEPT" \
|
||||||
"CONFIG_DEVICE_POWER_MANAGEMENT" \
|
"CONFIG_PM_DEVICE" \
|
||||||
"CONFIG_DEVICE_IDLE_PM" \
|
"CONFIG_PM_DEVICE_IDLE" \
|
||||||
"CONFIG_ERRNO" \
|
"CONFIG_ERRNO" \
|
||||||
"CONFIG_FLASH_JESD216_API" \
|
"CONFIG_FLASH_JESD216_API" \
|
||||||
"CONFIG_FLASH_PAGE_LAYOUT" \
|
"CONFIG_FLASH_PAGE_LAYOUT" \
|
||||||
|
@ -1985,7 +1985,7 @@ PREDEFINED = "CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT" \
|
||||||
"CONFIG_SMP" \
|
"CONFIG_SMP" \
|
||||||
"CONFIG_SPI_ASYNC" \
|
"CONFIG_SPI_ASYNC" \
|
||||||
"CONFIG_SYS_CLOCK_EXISTS" \
|
"CONFIG_SYS_CLOCK_EXISTS" \
|
||||||
"CONFIG_SYS_POWER_MANAGEMENT" \
|
"CONFIG_PM" \
|
||||||
"CONFIG_THREAD_CUSTOM_DATA" \
|
"CONFIG_THREAD_CUSTOM_DATA" \
|
||||||
"CONFIG_THREAD_MONITOR" \
|
"CONFIG_THREAD_MONITOR" \
|
||||||
"CONFIG_THREAD_STACK_INFO" \
|
"CONFIG_THREAD_STACK_INFO" \
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct st7789v_data {
|
||||||
uint16_t width;
|
uint16_t width;
|
||||||
uint16_t x_offset;
|
uint16_t x_offset;
|
||||||
uint16_t y_offset;
|
uint16_t y_offset;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -375,7 +375,7 @@ static int st7789v_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ static int st7789v_init(const struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static void st7789v_enter_sleep(struct st7789v_data *data)
|
static void st7789v_enter_sleep(struct st7789v_data *data)
|
||||||
{
|
{
|
||||||
st7789v_transmit(data, ST7789V_CMD_SLEEP_IN, NULL, 0);
|
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,
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static const struct display_driver_api st7789v_api = {
|
static const struct display_driver_api st7789v_api = {
|
||||||
.blanking_on = st7789v_blanking_on,
|
.blanking_on = st7789v_blanking_on,
|
||||||
|
|
|
@ -31,11 +31,11 @@ struct entropy_cc13xx_cc26xx_data {
|
||||||
struct k_sem sync;
|
struct k_sem sync;
|
||||||
struct ring_buf pool;
|
struct ring_buf pool;
|
||||||
uint8_t data[CONFIG_ENTROPY_CC13XX_CC26XX_POOL_SIZE];
|
uint8_t data[CONFIG_ENTROPY_CC13XX_CC26XX_POOL_SIZE];
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
Power_NotifyObj post_notify;
|
Power_NotifyObj post_notify;
|
||||||
bool constrained;
|
bool constrained;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -73,7 +73,7 @@ static void start_trng(struct entropy_cc13xx_cc26xx_data *data)
|
||||||
TRNGIntEnable(TRNG_NUMBER_READY | TRNG_FRO_SHUTDOWN);
|
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)
|
static void stop_trng(struct entropy_cc13xx_cc26xx_data *data)
|
||||||
{
|
{
|
||||||
TRNGDisable();
|
TRNGDisable();
|
||||||
|
@ -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);
|
struct entropy_cc13xx_cc26xx_data *data = get_dev_data(dev);
|
||||||
uint32_t cnt;
|
uint32_t cnt;
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
unsigned int key = irq_lock();
|
unsigned int key = irq_lock();
|
||||||
|
|
||||||
if (!data->constrained) {
|
if (!data->constrained) {
|
||||||
|
@ -155,8 +155,8 @@ static void entropy_cc13xx_cc26xx_isr(const void *arg)
|
||||||
|
|
||||||
/* When pool is full disable interrupt and stop reading numbers */
|
/* When pool is full disable interrupt and stop reading numbers */
|
||||||
if (cnt != sizeof(num)) {
|
if (cnt != sizeof(num)) {
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
if (data->constrained) {
|
if (data->constrained) {
|
||||||
sys_pm_ctrl_enable_state(
|
sys_pm_ctrl_enable_state(
|
||||||
SYS_POWER_STATE_SLEEP_2);
|
SYS_POWER_STATE_SLEEP_2);
|
||||||
|
@ -241,7 +241,7 @@ static int entropy_cc13xx_cc26xx_get_entropy_isr(const struct device *dev,
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/*
|
/*
|
||||||
* ======== post_notify_fxn ========
|
* ======== post_notify_fxn ========
|
||||||
* Called by Power module when waking up the CPU from Standby. The TRNG needs
|
* 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,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
||||||
uint32_t new_state)
|
uint32_t new_state)
|
||||||
{
|
{
|
||||||
|
@ -321,22 +321,22 @@ static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static int entropy_cc13xx_cc26xx_init(const struct device *dev)
|
static int entropy_cc13xx_cc26xx_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
struct entropy_cc13xx_cc26xx_data *data = get_dev_data(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;
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize driver data */
|
/* Initialize driver data */
|
||||||
ring_buf_init(&data->pool, sizeof(data->data), data->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);
|
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 */
|
/* Stay out of standby until buffer is filled with entropy */
|
||||||
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
data->constrained = true;
|
data->constrained = true;
|
||||||
|
|
|
@ -8,7 +8,7 @@ menuconfig ETH_MCUX
|
||||||
depends on HAS_MCUX_ENET
|
depends on HAS_MCUX_ENET
|
||||||
select NOCACHE_MEMORY if HAS_MCUX_CACHE
|
select NOCACHE_MEMORY if HAS_MCUX_CACHE
|
||||||
select ARM_MPU if CPU_CORTEX_M7
|
select ARM_MPU if CPU_CORTEX_M7
|
||||||
select NET_POWER_MANAGEMENT if DEVICE_POWER_MANAGEMENT
|
select NET_POWER_MANAGEMENT if PM_DEVICE
|
||||||
help
|
help
|
||||||
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
|
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
|
||||||
setup. There is no support for PHY disconnect, reconnect or
|
setup. There is no support for PHY disconnect, reconnect or
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct spi_flash_at45_data {
|
||||||
const struct device *spi;
|
const struct device *spi;
|
||||||
struct spi_cs_control spi_cs;
|
struct spi_cs_control spi_cs;
|
||||||
struct k_sem lock;
|
struct k_sem lock;
|
||||||
#if IS_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT)
|
#if IS_ENABLED(CONFIG_PM_DEVICE)
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -585,7 +585,7 @@ static int spi_flash_at45_init(const struct device *dev)
|
||||||
return err;
|
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,
|
static int spi_flash_at45_pm_control(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
@ -634,7 +634,7 @@ static int spi_flash_at45_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif /* IS_ENABLED(CONFIG_DEVICE_POWER_MANAGEMENT) */
|
#endif /* IS_ENABLED(CONFIG_PM_DEVICE) */
|
||||||
|
|
||||||
static const struct flash_parameters *
|
static const struct flash_parameters *
|
||||||
flash_at45_get_parameters(const struct device *dev)
|
flash_at45_get_parameters(const struct device *dev)
|
||||||
|
@ -665,7 +665,7 @@ static const struct flash_driver_api spi_flash_at45_api = {
|
||||||
}; \
|
}; \
|
||||||
static struct spi_flash_at45_data inst_##idx##_data = { \
|
static struct spi_flash_at45_data inst_##idx##_data = { \
|
||||||
.lock = Z_SEM_INITIALIZER(inst_##idx##_data.lock, 1, 1), \
|
.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)) \
|
.pm_state = DEVICE_PM_ACTIVE_STATE)) \
|
||||||
}; \
|
}; \
|
||||||
static const struct spi_flash_at45_config inst_##idx##_config = { \
|
static const struct spi_flash_at45_config inst_##idx##_config = { \
|
||||||
|
|
|
@ -232,7 +232,7 @@ static void gpio_cc13xx_cc26xx_isr(const struct device *dev)
|
||||||
|
|
||||||
static int gpio_cc13xx_cc26xx_init(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 */
|
/* Set dependency on gpio resource to turn on power domains */
|
||||||
Power_setDependency(PowerCC26XX_PERIPH_GPIO);
|
Power_setDependency(PowerCC26XX_PERIPH_GPIO);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <drivers/interrupt_controller/ioapic.h>
|
#include <drivers/interrupt_controller/ioapic.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#include <power/power.h>
|
#include <power/power.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ static inline int gpio_dw_manage_callback(const struct device *port,
|
||||||
return gpio_manage_callback(&context->callbacks, callback, set);
|
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,
|
static void gpio_dw_set_power_state(const struct device *port,
|
||||||
uint32_t power_state)
|
uint32_t power_state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct gpio_dw_runtime {
|
||||||
const struct device *clock;
|
const struct device *clock;
|
||||||
#endif
|
#endif
|
||||||
sys_slist_t callbacks;
|
sys_slist_t callbacks;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t device_power_state;
|
uint32_t device_power_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,11 +29,11 @@ struct i2c_cc13xx_cc26xx_data {
|
||||||
struct k_sem lock;
|
struct k_sem lock;
|
||||||
struct k_sem complete;
|
struct k_sem complete;
|
||||||
volatile uint32_t error;
|
volatile uint32_t error;
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
Power_NotifyObj postNotify;
|
Power_NotifyObj postNotify;
|
||||||
uint32_t dev_config;
|
uint32_t dev_config;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -209,8 +209,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
|
||||||
|
|
||||||
k_sem_take(&get_dev_data(dev)->lock, K_FOREVER);
|
k_sem_take(&get_dev_data(dev)->lock, K_FOREVER);
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -234,8 +234,8 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ static int i2c_cc13xx_cc26xx_configure(const struct device *dev,
|
||||||
/* Enables and configures I2C master */
|
/* Enables and configures I2C master */
|
||||||
I2CMasterInitExpClk(get_dev_config(dev)->base, CPU_FREQ, fast);
|
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;
|
get_dev_data(dev)->dev_config = dev_config;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ static void i2c_cc13xx_cc26xx_isr(const void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/*
|
/*
|
||||||
* ======== postNotifyFxn ========
|
* ======== postNotifyFxn ========
|
||||||
* Called by Power module when waking up the CPU from Standby. The i2c needs
|
* 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,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
||||||
uint32_t new_state)
|
uint32_t new_state)
|
||||||
{
|
{
|
||||||
|
@ -395,18 +395,18 @@ static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static int i2c_cc13xx_cc26xx_init(const struct device *dev)
|
static int i2c_cc13xx_cc26xx_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
uint32_t cfg;
|
uint32_t cfg;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/* Set Power dependencies & constraints */
|
/* Set Power dependencies & constraints */
|
||||||
Power_setDependency(PowerCC26XX_PERIPH_I2C0);
|
Power_setDependency(PowerCC26XX_PERIPH_I2C0);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct i2c_nrfx_twi_data {
|
||||||
struct k_sem completion_sync;
|
struct k_sem completion_sync;
|
||||||
volatile nrfx_err_t res;
|
volatile nrfx_err_t res;
|
||||||
uint32_t dev_config;
|
uint32_t dev_config;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -205,14 +205,14 @@ static int init_twi(const struct device *dev)
|
||||||
dev->name);
|
dev->name);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int twi_nrfx_pm_control(const struct device *dev,
|
static int twi_nrfx_pm_control(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
@ -260,7 +260,7 @@ static int twi_nrfx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
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_INVALID_FREQUENCY ((nrf_twi_frequency_t)-1)
|
||||||
#define I2C_NRFX_TWI_FREQUENCY(bitrate) \
|
#define I2C_NRFX_TWI_FREQUENCY(bitrate) \
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct i2c_nrfx_twim_data {
|
||||||
uint32_t dev_config;
|
uint32_t dev_config;
|
||||||
uint16_t concat_buf_size;
|
uint16_t concat_buf_size;
|
||||||
uint8_t *concat_buf;
|
uint8_t *concat_buf;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -244,14 +244,14 @@ static int init_twim(const struct device *dev)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int twim_nrfx_pm_control(const struct device *dev,
|
static int twim_nrfx_pm_control(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
@ -300,7 +300,7 @@ static int twim_nrfx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
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_INVALID_FREQUENCY ((nrf_twim_frequency_t)-1)
|
||||||
#define I2C_NRFX_TWIM_FREQUENCY(bitrate) \
|
#define I2C_NRFX_TWIM_FREQUENCY(bitrate) \
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
extern void *_VectorTable;
|
extern void *_VectorTable;
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#include <power/power.h>
|
#include <power/power.h>
|
||||||
#include <kernel_structs.h>
|
#include <kernel_structs.h>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ static int arc_v2_irq_unit_init(const struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Suspend the interrupt unit device driver
|
* @brief Suspend the interrupt unit device driver
|
||||||
|
@ -223,4 +223,4 @@ SYS_DEVICE_DEFINE("arc_v2_irq_unit", arc_v2_irq_unit_init,
|
||||||
#else
|
#else
|
||||||
SYS_INIT(arc_v2_irq_unit_init, PRE_KERNEL_1,
|
SYS_INIT(arc_v2_irq_unit_init, PRE_KERNEL_1,
|
||||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
|
@ -92,7 +92,7 @@ DEVICE_MMIO_TOPLEVEL_STATIC(ioapic_regs, DT_DRV_INST(0));
|
||||||
*/
|
*/
|
||||||
#define DEFAULT_RTE_DEST (0xFF << 24)
|
#define DEFAULT_RTE_DEST (0xFF << 24)
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#include <power/power.h>
|
#include <power/power.h>
|
||||||
uint32_t ioapic_suspend_buf[SUSPEND_BITS_REQD / 32] = {0};
|
uint32_t ioapic_suspend_buf[SUSPEND_BITS_REQD / 32] = {0};
|
||||||
static uint32_t ioapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
|
static uint32_t ioapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
|
@ -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)
|
void store_flags(unsigned int irq, uint32_t flags)
|
||||||
{
|
{
|
||||||
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
SYS_DEVICE_DEFINE("ioapic", ioapic_init, ioapic_device_ctrl, PRE_KERNEL_1,
|
SYS_DEVICE_DEFINE("ioapic", ioapic_init, ioapic_device_ctrl, PRE_KERNEL_1,
|
||||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
#define LOPIC_SSPND_BITS_PER_IRQ 1 /* Just the one for enable disable*/
|
#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))
|
#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>
|
#include <power/power.h>
|
||||||
uint32_t loapic_suspend_buf[LOPIC_SUSPEND_BITS_REQD / 32] = {0};
|
uint32_t loapic_suspend_buf[LOPIC_SUSPEND_BITS_REQD / 32] = {0};
|
||||||
static uint32_t loapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
|
static uint32_t loapic_device_power_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
|
@ -332,7 +332,7 @@ int z_irq_controller_isr_vector_get(void)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int loapic_suspend(const struct device *port)
|
static int loapic_suspend(const struct device *port)
|
||||||
{
|
{
|
||||||
volatile uint32_t lvt; /* local vector table entry value */
|
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,
|
||||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
#else
|
#else
|
||||||
SYS_INIT(loapic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
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
|
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
|
||||||
|
|
|
@ -3472,7 +3472,7 @@ static void hl7800_rx(void)
|
||||||
|
|
||||||
static void shutdown_uart(void)
|
static void shutdown_uart(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (ictx.uart_on) {
|
if (ictx.uart_on) {
|
||||||
|
@ -3490,7 +3490,7 @@ static void shutdown_uart(void)
|
||||||
|
|
||||||
static void power_on_uart(void)
|
static void power_on_uart(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!ictx.uart_on) {
|
if (!ictx.uart_on) {
|
||||||
|
|
|
@ -281,7 +281,7 @@ static int pwm_nrfx_init(const struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
|
|
||||||
static void pwm_nrfx_uninit(const struct device *dev)
|
static void pwm_nrfx_uninit(const struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ static int pwm_nrfx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
#define PWM_NRFX_PM_CONTROL(idx)
|
#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(dev_idx) DT_NODELABEL(pwm##dev_idx)
|
||||||
#define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop)
|
#define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop)
|
||||||
|
|
|
@ -407,7 +407,7 @@ static int apds9960_init_interrupt(const struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int apds9960_device_ctrl(const struct device *dev,
|
static int apds9960_device_ctrl(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
|
|
@ -357,7 +357,7 @@ static int lis2mdl_init(const struct device *dev)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
lis2mdl->power_state = DEVICE_PM_ACTIVE_STATE;
|
lis2mdl->power_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ static int lis2mdl_init(const struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl,
|
static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl,
|
||||||
uint32_t new_state)
|
uint32_t new_state)
|
||||||
{
|
{
|
||||||
|
@ -430,7 +430,7 @@ static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command,
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
DEVICE_DEFINE(lis2mdl, DT_INST_LABEL(0), lis2mdl_init,
|
DEVICE_DEFINE(lis2mdl, DT_INST_LABEL(0), lis2mdl_init,
|
||||||
lis2mdl_pm_control, &lis2mdl_data, &lis2mdl_dev_config,
|
lis2mdl_pm_control, &lis2mdl_data, &lis2mdl_dev_config,
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct lis2mdl_data {
|
||||||
|
|
||||||
stmdev_ctx_t *ctx;
|
stmdev_ctx_t *ctx;
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t power_state;
|
uint32_t power_state;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(qdec_nrfx, CONFIG_SENSOR_LOG_LEVEL);
|
||||||
struct qdec_nrfx_data {
|
struct qdec_nrfx_data {
|
||||||
int32_t acc;
|
int32_t acc;
|
||||||
sensor_trigger_handler_t data_ready_handler;
|
sensor_trigger_handler_t data_ready_handler;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -209,7 +209,7 @@ static int qdec_nrfx_init(const struct device *dev)
|
||||||
qdec_nrfx_gpio_ctrl(true);
|
qdec_nrfx_gpio_ctrl(true);
|
||||||
nrfx_qdec_enable();
|
nrfx_qdec_enable();
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
struct qdec_nrfx_data *data = &qdec_nrfx_data;
|
struct qdec_nrfx_data *data = &qdec_nrfx_data;
|
||||||
|
|
||||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
|
@ -218,7 +218,7 @@ static int qdec_nrfx_init(const struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
|
|
||||||
static int qdec_nrfx_pm_get_state(struct qdec_nrfx_data *data,
|
static int qdec_nrfx_pm_get_state(struct qdec_nrfx_data *data,
|
||||||
uint32_t *state)
|
uint32_t *state)
|
||||||
|
@ -299,7 +299,7 @@ static int qdec_nrfx_pm_control(const struct device *dev,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
|
|
||||||
static const struct sensor_driver_api qdec_nrfx_driver_api = {
|
static const struct sensor_driver_api qdec_nrfx_driver_api = {
|
||||||
|
|
|
@ -217,7 +217,7 @@ static int vcnl4040_ambient_setup(const struct device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int vcnl4040_device_ctrl(const struct device *dev,
|
static int vcnl4040_device_ctrl(const struct device *dev,
|
||||||
uint32_t ctrl_command, void *context,
|
uint32_t ctrl_command, void *context,
|
||||||
device_pm_cb cb, void *arg)
|
device_pm_cb cb, void *arg)
|
||||||
|
|
|
@ -91,7 +91,7 @@ config UART_0_NRF_HW_ASYNC_TIMER
|
||||||
|
|
||||||
config UART_0_GPIO_MANAGEMENT
|
config UART_0_GPIO_MANAGEMENT
|
||||||
bool "Enable GPIO management on port 0"
|
bool "Enable GPIO management on port 0"
|
||||||
depends on DEVICE_POWER_MANAGEMENT
|
depends on PM_DEVICE
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
If enabled, the driver will configure the GPIOs used by the uart to
|
If enabled, the driver will configure the GPIOs used by the uart to
|
||||||
|
@ -162,7 +162,7 @@ config UART_1_NRF_HW_ASYNC_TIMER
|
||||||
|
|
||||||
config UART_1_GPIO_MANAGEMENT
|
config UART_1_GPIO_MANAGEMENT
|
||||||
bool "Enable GPIO management on port 1"
|
bool "Enable GPIO management on port 1"
|
||||||
depends on DEVICE_POWER_MANAGEMENT
|
depends on PM_DEVICE
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
If enabled, the driver will configure the GPIOs used by the uart to
|
If enabled, the driver will configure the GPIOs used by the uart to
|
||||||
|
@ -232,7 +232,7 @@ config UART_2_NRF_HW_ASYNC_TIMER
|
||||||
|
|
||||||
config UART_2_GPIO_MANAGEMENT
|
config UART_2_GPIO_MANAGEMENT
|
||||||
bool "Enable GPIO management on port 2"
|
bool "Enable GPIO management on port 2"
|
||||||
depends on DEVICE_POWER_MANAGEMENT
|
depends on PM_DEVICE
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
If enabled, the driver will configure the GPIOs used by the uart to
|
If enabled, the driver will configure the GPIOs used by the uart to
|
||||||
|
@ -302,7 +302,7 @@ config UART_3_NRF_HW_ASYNC_TIMER
|
||||||
|
|
||||||
config UART_3_GPIO_MANAGEMENT
|
config UART_3_GPIO_MANAGEMENT
|
||||||
bool "Enable GPIO management on port 3"
|
bool "Enable GPIO management on port 3"
|
||||||
depends on DEVICE_POWER_MANAGEMENT
|
depends on PM_DEVICE
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
If enabled, the driver will configure the GPIOs used by the uart to
|
If enabled, the driver will configure the GPIOs used by the uart to
|
||||||
|
|
|
@ -30,12 +30,12 @@ struct uart_cc13xx_cc26xx_data {
|
||||||
uart_irq_callback_user_data_t callback;
|
uart_irq_callback_user_data_t callback;
|
||||||
void *user_data;
|
void *user_data;
|
||||||
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
Power_NotifyObj postNotify;
|
Power_NotifyObj postNotify;
|
||||||
bool tx_constrained;
|
bool tx_constrained;
|
||||||
bool rx_constrained;
|
bool rx_constrained;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -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)
|
static void uart_cc13xx_cc26xx_irq_tx_enable(const struct device *dev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
if (!get_dev_data(dev)->tx_constrained) {
|
if (!get_dev_data(dev)->tx_constrained) {
|
||||||
/*
|
/*
|
||||||
* When tx irq is enabled, it is implicit that we are expecting
|
* 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)
|
||||||
{
|
{
|
||||||
UARTIntDisable(get_dev_conf(dev)->regs, UART_INT_TX);
|
UARTIntDisable(get_dev_conf(dev)->regs, UART_INT_TX);
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
if (get_dev_data(dev)->tx_constrained) {
|
if (get_dev_data(dev)->tx_constrained) {
|
||||||
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
get_dev_data(dev)->tx_constrained = false;
|
get_dev_data(dev)->tx_constrained = false;
|
||||||
|
@ -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)
|
static void uart_cc13xx_cc26xx_irq_rx_enable(const struct device *dev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
/*
|
/*
|
||||||
* When rx is enabled, it is implicit that we are expecting
|
* When rx is enabled, it is implicit that we are expecting
|
||||||
* to receive from the uart, hence we can no longer go into
|
* 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)
|
||||||
|
|
||||||
static void uart_cc13xx_cc26xx_irq_rx_disable(const struct device *dev)
|
static void uart_cc13xx_cc26xx_irq_rx_disable(const struct device *dev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
if (get_dev_data(dev)->rx_constrained) {
|
if (get_dev_data(dev)->rx_constrained) {
|
||||||
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
get_dev_data(dev)->rx_constrained = false;
|
get_dev_data(dev)->rx_constrained = false;
|
||||||
|
@ -359,11 +359,11 @@ static void uart_cc13xx_cc26xx_isr(const struct device *dev)
|
||||||
|
|
||||||
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/*
|
/*
|
||||||
* ======== postNotifyFxn ========
|
* ======== postNotifyFxn ========
|
||||||
* Called by Power module when waking up the CPU from Standby, to support
|
* 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
|
* 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
|
* PM turned it off, in which case it'd be responsible for turning it back
|
||||||
* on and reconfiguring it.
|
* on and reconfiguring it.
|
||||||
|
@ -400,7 +400,7 @@ static int postNotifyFxn(unsigned int eventType, uintptr_t eventArg,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
||||||
uint32_t new_state)
|
uint32_t new_state)
|
||||||
{
|
{
|
||||||
|
@ -471,7 +471,7 @@ static int uart_cc13xx_cc26xx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
|
static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
|
||||||
.poll_in = uart_cc13xx_cc26xx_poll_in,
|
.poll_in = uart_cc13xx_cc26xx_poll_in,
|
||||||
|
@ -497,7 +497,7 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
|
||||||
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
#define UART_CC13XX_CC26XX_POWER_UART(n) \
|
#define UART_CC13XX_CC26XX_POWER_UART(n) \
|
||||||
do { \
|
do { \
|
||||||
get_dev_data(dev)->rx_constrained = false; \
|
get_dev_data(dev)->rx_constrained = false; \
|
||||||
|
@ -579,7 +579,17 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
|
||||||
&uart_cc13xx_cc26xx_driver_api)
|
&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 \
|
#define UART_CC13XX_CC26XX_INIT_PM_STATE \
|
||||||
do { \
|
do { \
|
||||||
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \
|
||||||
|
|
|
@ -344,7 +344,7 @@ static int uart_npcx_init(const struct device *dev)
|
||||||
config->uconf.irq_config_func(dev);
|
config->uconf.irq_config_func(dev);
|
||||||
#endif
|
#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
|
* Configure the UART wake-up event triggered from a falling edge
|
||||||
* on CR_SIN pin. No need for callback function.
|
* on CR_SIN pin. No need for callback function.
|
||||||
|
|
|
@ -1091,7 +1091,7 @@ static const struct uart_driver_api uart_nrfx_uart_driver_api = {
|
||||||
#endif /* CONFIG_UART_0_INTERRUPT_DRIVEN */
|
#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)
|
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,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static struct uart_nrfx_data uart_nrfx_uart0_data = {
|
static struct uart_nrfx_data uart_nrfx_uart0_data = {
|
||||||
.uart_config = {
|
.uart_config = {
|
||||||
|
|
|
@ -113,7 +113,8 @@ struct uarte_nrfx_data {
|
||||||
#ifdef CONFIG_UART_ASYNC_API
|
#ifdef CONFIG_UART_ASYNC_API
|
||||||
struct uarte_async_cb *async;
|
struct uarte_async_cb *async;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
atomic_val_t poll_out_lock;
|
||||||
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
uint8_t char_out;
|
uint8_t char_out;
|
||||||
|
@ -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);
|
NRF_UARTE_Type *uarte = get_uarte_instance(dev);
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
if (data->pm_state != DEVICE_PM_ACTIVE_STATE) {
|
if (data->pm_state != DEVICE_PM_ACTIVE_STATE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1430,7 +1431,7 @@ static int uarte_instance_init(const struct device *dev,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1479,7 +1480,7 @@ static int uarte_instance_init(const struct device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
|
|
||||||
static void uarte_nrfx_pins_enable(const struct device *dev, bool enable)
|
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,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
#define UARTE(idx) DT_NODELABEL(uart##idx)
|
#define UARTE(idx) DT_NODELABEL(uart##idx)
|
||||||
#define UARTE_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(UARTE(idx), prop)
|
#define UARTE_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(UARTE(idx), prop)
|
||||||
|
|
|
@ -32,7 +32,7 @@ struct spi_cc13xx_cc26xx_config {
|
||||||
|
|
||||||
struct spi_cc13xx_cc26xx_data {
|
struct spi_cc13xx_cc26xx_data {
|
||||||
struct spi_context ctx;
|
struct spi_context ctx;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -148,8 +148,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
|
||||||
|
|
||||||
spi_context_lock(ctx, false, NULL, config);
|
spi_context_lock(ctx, false, NULL, config);
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -185,8 +185,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
|
||||||
spi_context_cs_control(ctx, false);
|
spi_context_cs_control(ctx, false);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
|
#if defined(CONFIG_PM) && \
|
||||||
defined(CONFIG_SYS_POWER_SLEEP_STATES)
|
defined(CONFIG_PM_SLEEP_STATES)
|
||||||
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
|
||||||
#endif
|
#endif
|
||||||
spi_context_release(ctx, err);
|
spi_context_release(ctx, err);
|
||||||
|
@ -211,7 +211,7 @@ static int spi_cc13xx_cc26xx_release(const struct device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
|
||||||
uint32_t new_state)
|
uint32_t new_state)
|
||||||
{
|
{
|
||||||
|
@ -276,7 +276,7 @@ static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
|
|
||||||
static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
|
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,
|
.release = spi_cc13xx_cc26xx_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
#define SPI_CC13XX_CC26XX_POWER_SPI(n) \
|
#define SPI_CC13XX_CC26XX_POWER_SPI(n) \
|
||||||
do { \
|
do { \
|
||||||
/* Set Power dependencies & constraints */ \
|
/* Set Power dependencies & constraints */ \
|
||||||
|
@ -337,7 +337,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
|
||||||
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
|
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
|
||||||
&spi_cc13xx_cc26xx_driver_api)
|
&spi_cc13xx_cc26xx_driver_api)
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#define SPI_CC13XX_CC26XX_INIT_PM_STATE \
|
#define SPI_CC13XX_CC26XX_INIT_PM_STATE \
|
||||||
do { \
|
do { \
|
||||||
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \
|
||||||
|
|
|
@ -344,11 +344,11 @@ static int transceive(const struct device *dev,
|
||||||
|
|
||||||
spi_context_lock(&spi->ctx, asynchronous, signal, config);
|
spi_context_lock(&spi->ctx, asynchronous, signal, config);
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
if (device_busy_check(dev) != (-EBUSY)) {
|
if (device_busy_check(dev) != (-EBUSY)) {
|
||||||
device_busy_set(dev);
|
device_busy_set(dev);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
/* Configure */
|
/* Configure */
|
||||||
ret = spi_dw_configure(info, spi, config);
|
ret = spi_dw_configure(info, spi, config);
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct spi_nrfx_data {
|
||||||
const struct device *dev;
|
const struct device *dev;
|
||||||
size_t chunk_len;
|
size_t chunk_len;
|
||||||
bool busy;
|
bool busy;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -276,14 +276,14 @@ static int init_spi(const struct device *dev)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
dev_data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
dev_data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int spi_nrfx_pm_control(const struct device *dev,
|
static int spi_nrfx_pm_control(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
@ -329,7 +329,7 @@ static int spi_nrfx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Current factors requiring use of DT_NODELABEL:
|
* Current factors requiring use of DT_NODELABEL:
|
||||||
|
|
|
@ -20,7 +20,7 @@ struct spi_nrfx_data {
|
||||||
const struct device *dev;
|
const struct device *dev;
|
||||||
size_t chunk_len;
|
size_t chunk_len;
|
||||||
bool busy;
|
bool busy;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_SPI_NRFX_RAM_BUFFER_SIZE > 0)
|
#if (CONFIG_SPI_NRFX_RAM_BUFFER_SIZE > 0)
|
||||||
|
@ -318,14 +318,15 @@ static int init_spim(const struct device *dev)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
|
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int spim_nrfx_pm_control(const struct device *dev,
|
static int spim_nrfx_pm_control(const struct device *dev,
|
||||||
uint32_t ctrl_command,
|
uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg)
|
void *context, device_pm_cb cb, void *arg)
|
||||||
|
@ -371,7 +372,7 @@ static int spim_nrfx_pm_control(const struct device *dev,
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We use NODELABEL here because the nrfx API requires us to call
|
* We use NODELABEL here because the nrfx API requires us to call
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
menuconfig STM32_LPTIM_TIMER
|
menuconfig STM32_LPTIM_TIMER
|
||||||
bool "STM32 Low Power Timer [EXPERIMENTAL]"
|
bool "STM32 Low Power Timer [EXPERIMENTAL]"
|
||||||
depends on (SOC_SERIES_STM32L4X || SOC_SERIES_STM32WBX)
|
depends on (SOC_SERIES_STM32L4X || SOC_SERIES_STM32WBX)
|
||||||
depends on CLOCK_CONTROL && SYS_POWER_MANAGEMENT
|
depends on CLOCK_CONTROL && PM
|
||||||
select TICKLESS_CAPABLE
|
select TICKLESS_CAPABLE
|
||||||
help
|
help
|
||||||
This module implements a kernel device driver for the LowPower Timer
|
This module implements a kernel device driver for the LowPower Timer
|
||||||
|
|
|
@ -106,7 +106,7 @@ static unsigned char timer_mode = TIMER_MODE_PERIODIC;
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_TICKLESS_IDLE */
|
#endif /* CONFIG_TICKLESS_IDLE */
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static uint32_t loapic_timer_device_power_state;
|
static uint32_t loapic_timer_device_power_state;
|
||||||
static uint32_t reg_timer_save;
|
static uint32_t reg_timer_save;
|
||||||
static uint32_t reg_timer_cfg_save;
|
static uint32_t reg_timer_cfg_save;
|
||||||
|
@ -568,7 +568,7 @@ int z_clock_driver_init(const struct device *device)
|
||||||
periodic_mode_set();
|
periodic_mode_set();
|
||||||
#endif
|
#endif
|
||||||
initial_count_register_set(cycles_per_tick - 1);
|
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;
|
loapic_timer_device_power_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ int z_clock_driver_init(const struct device *device)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
static int sys_clock_suspend(const struct device *dev)
|
static int sys_clock_suspend(const struct device *dev)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
|
|
@ -117,7 +117,7 @@ extern void z_arm_interrupt_init(void);
|
||||||
z_arm_irq_priority_set(irq_p, priority_p, flags_p); \
|
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);
|
extern void _arch_isr_direct_pm(void);
|
||||||
#define ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
|
#define ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -233,7 +233,7 @@ typedef struct s_isrList {
|
||||||
(flags_p)); \
|
(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
|
* FIXME: z_sys_power_save_idle_exit is defined in kernel.h, which cannot be
|
||||||
* included here due to circular dependency
|
* included here due to circular dependency
|
||||||
|
|
|
@ -335,7 +335,7 @@ struct device {
|
||||||
const void *api;
|
const void *api;
|
||||||
/** Address of the device instance private data */
|
/** Address of the device instance private data */
|
||||||
void * const data;
|
void * const data;
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
/** Power Management function */
|
/** Power Management function */
|
||||||
int (*device_pm_control)(const struct device *dev, uint32_t command,
|
int (*device_pm_control)(const struct device *dev, uint32_t command,
|
||||||
void *context, device_pm_cb cb, void *arg);
|
void *context, device_pm_cb cb, void *arg);
|
||||||
|
@ -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
|
/** @def DEVICE_PM_ACTIVE_STATE
|
||||||
*
|
*
|
||||||
|
@ -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_SET_POWER_STATE 1
|
||||||
#define DEVICE_PM_GET_POWER_STATE 2
|
#define DEVICE_PM_GET_POWER_STATE 2
|
||||||
|
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get name of device PM state
|
* @brief Get name of device PM state
|
||||||
|
@ -492,7 +492,7 @@ void device_busy_set(const struct device *busy_dev);
|
||||||
*/
|
*/
|
||||||
void device_busy_clear(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
|
* Device PM functions
|
||||||
*/
|
*/
|
||||||
|
@ -615,7 +615,7 @@ int device_any_busy_check(void);
|
||||||
*/
|
*/
|
||||||
int device_busy_check(const struct device *chk_dev);
|
int device_busy_check(const struct device *chk_dev);
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_IDLE_PM
|
#ifdef CONFIG_PM_DEVICE_IDLE
|
||||||
|
|
||||||
/* Device PM FSM states */
|
/* Device PM FSM states */
|
||||||
enum device_pm_fsm_state {
|
enum device_pm_fsm_state {
|
||||||
|
@ -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, \
|
Z_INIT_ENTRY_DEFINE(_CONCAT(__device_, dev_name), init_fn, \
|
||||||
(&_CONCAT(__device_, dev_name)), level, prio)
|
(&_CONCAT(__device_, dev_name)), level, prio)
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#define Z_DEVICE_DEFINE_PM(dev_name) \
|
#define Z_DEVICE_DEFINE_PM(dev_name) \
|
||||||
static struct device_pm _CONCAT(__pm_, dev_name) __used = { \
|
static struct device_pm _CONCAT(__pm_, dev_name) __used = { \
|
||||||
.usage = ATOMIC_INIT(0), \
|
.usage = ATOMIC_INIT(0), \
|
||||||
|
|
|
@ -140,7 +140,7 @@ struct z_kernel {
|
||||||
sys_dlist_t timeout_q;
|
sys_dlist_t timeout_q;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
int32_t idle; /* Number of ticks for kernel idling */
|
int32_t idle; /* Number of ticks for kernel idling */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
. = . + DEVICE_BITFIELD_SIZE; \
|
. = . + DEVICE_BITFIELD_SIZE; \
|
||||||
__device_init_status_end = .;
|
__device_init_status_end = .;
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
#define DEVICE_BUSY_BITFIELD() \
|
#define DEVICE_BUSY_BITFIELD() \
|
||||||
FILL(0x00); \
|
FILL(0x00); \
|
||||||
__device_busy_start = .; \
|
__device_busy_start = .; \
|
||||||
|
|
|
@ -27,33 +27,33 @@ extern "C" {
|
||||||
enum power_states {
|
enum power_states {
|
||||||
SYS_POWER_STATE_AUTO = (-2),
|
SYS_POWER_STATE_AUTO = (-2),
|
||||||
SYS_POWER_STATE_ACTIVE = (-1),
|
SYS_POWER_STATE_ACTIVE = (-1),
|
||||||
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
|
#ifdef CONFIG_PM_SLEEP_STATES
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_1
|
||||||
SYS_POWER_STATE_SLEEP_1,
|
SYS_POWER_STATE_SLEEP_1,
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_2
|
||||||
SYS_POWER_STATE_SLEEP_2,
|
SYS_POWER_STATE_SLEEP_2,
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_3
|
||||||
SYS_POWER_STATE_SLEEP_3,
|
SYS_POWER_STATE_SLEEP_3,
|
||||||
# endif
|
# endif
|
||||||
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
|
#endif /* CONFIG_PM_SLEEP_STATES */
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
SYS_POWER_STATE_DEEP_SLEEP_1,
|
SYS_POWER_STATE_DEEP_SLEEP_1,
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
|
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_2
|
||||||
SYS_POWER_STATE_DEEP_SLEEP_2,
|
SYS_POWER_STATE_DEEP_SLEEP_2,
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
|
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_3
|
||||||
SYS_POWER_STATE_DEEP_SLEEP_3,
|
SYS_POWER_STATE_DEEP_SLEEP_3,
|
||||||
# endif
|
# endif
|
||||||
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
|
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */
|
||||||
SYS_POWER_STATE_MAX
|
SYS_POWER_STATE_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
|
|
||||||
extern unsigned char sys_pm_idle_exit_notify;
|
extern unsigned char sys_pm_idle_exit_notify;
|
||||||
|
|
||||||
|
@ -75,20 +75,20 @@ static inline bool sys_pm_is_sleep_state(enum power_states state)
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
|
#ifdef CONFIG_PM_SLEEP_STATES
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_1
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_1
|
||||||
case SYS_POWER_STATE_SLEEP_1:
|
case SYS_POWER_STATE_SLEEP_1:
|
||||||
break;
|
break;
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_2
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_2
|
||||||
case SYS_POWER_STATE_SLEEP_2:
|
case SYS_POWER_STATE_SLEEP_2:
|
||||||
break;
|
break;
|
||||||
# endif
|
# endif
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_SLEEP_3
|
# ifdef CONFIG_HAS_POWER_STATE_SLEEP_3
|
||||||
case SYS_POWER_STATE_SLEEP_3:
|
case SYS_POWER_STATE_SLEEP_3:
|
||||||
break;
|
break;
|
||||||
# endif
|
# endif
|
||||||
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
|
#endif /* CONFIG_PM_SLEEP_STATES */
|
||||||
default:
|
default:
|
||||||
ret = false;
|
ret = false;
|
||||||
break;
|
break;
|
||||||
|
@ -107,20 +107,20 @@ static inline bool sys_pm_is_deep_sleep_state(enum power_states state)
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
# ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
# ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
break;
|
break;
|
||||||
# endif
|
# 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:
|
case SYS_POWER_STATE_DEEP_SLEEP_2:
|
||||||
break;
|
break;
|
||||||
# endif
|
# 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:
|
case SYS_POWER_STATE_DEEP_SLEEP_3:
|
||||||
break;
|
break;
|
||||||
# endif
|
# endif
|
||||||
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
|
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = false;
|
ret = false;
|
||||||
|
@ -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
|
* And before the end of suspend, the state of forced_pm_state
|
||||||
* is cleared with interrupt disabled.
|
* 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.
|
* run in thread context.
|
||||||
*
|
*
|
||||||
* @param state Power state which should be used in the ongoing
|
* @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);
|
||||||
*/
|
*/
|
||||||
void sys_set_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
|
* @brief Dump Low Power states related debug info
|
||||||
*
|
*
|
||||||
|
@ -176,9 +176,9 @@ void sys_set_power_state(enum power_states state);
|
||||||
*/
|
*/
|
||||||
void sys_pm_dump_debug_info(void);
|
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
|
* @brief Disable particular power 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);
|
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);
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -854,7 +854,7 @@ config TICKLESS_IDLE
|
||||||
# NB: This option is deprecated, see TICKLESS_KERNEL and
|
# NB: This option is deprecated, see TICKLESS_KERNEL and
|
||||||
# https://github.com/zephyrproject-rtos/zephyr/pull/12234
|
# https://github.com/zephyrproject-rtos/zephyr/pull/12234
|
||||||
bool "Tickless idle"
|
bool "Tickless idle"
|
||||||
default y if SYS_POWER_MANAGEMENT || TICKLESS_CAPABLE
|
default y if PM || TICKLESS_CAPABLE
|
||||||
help
|
help
|
||||||
This option suppresses periodic system clock interrupts whenever the
|
This option suppresses periodic system clock interrupts whenever the
|
||||||
kernel becomes idle. This permits the system to remain in a power
|
kernel becomes idle. This permits the system to remain in a power
|
||||||
|
|
|
@ -25,7 +25,7 @@ extern const struct device __device_end[];
|
||||||
|
|
||||||
extern uint32_t __device_init_status_start[];
|
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_start[];
|
||||||
extern uint32_t __device_busy_end[];
|
extern uint32_t __device_busy_end[];
|
||||||
#define DEVICE_BUSY_SIZE (__device_busy_end - __device_busy_start)
|
#define DEVICE_BUSY_SIZE (__device_busy_end - __device_busy_start)
|
||||||
|
@ -127,7 +127,7 @@ bool z_device_ready(const struct device *dev)
|
||||||
(dev - __device_start)));
|
(dev - __device_start)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
int device_pm_control_nop(const struct device *unused_device,
|
int device_pm_control_nop(const struct device *unused_device,
|
||||||
uint32_t unused_ctrl_command,
|
uint32_t unused_ctrl_command,
|
||||||
void *unused_context,
|
void *unused_context,
|
||||||
|
@ -162,7 +162,7 @@ int device_busy_check(const struct device *chk_dev)
|
||||||
|
|
||||||
void device_busy_set(const struct device *busy_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,
|
atomic_set_bit((atomic_t *) __device_busy_start,
|
||||||
(busy_dev - __device_start));
|
(busy_dev - __device_start));
|
||||||
#else
|
#else
|
||||||
|
@ -172,7 +172,7 @@ void device_busy_set(const struct device *busy_dev)
|
||||||
|
|
||||||
void device_busy_clear(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,
|
atomic_clear_bit((atomic_t *) __device_busy_start,
|
||||||
(busy_dev - __device_start));
|
(busy_dev - __device_start));
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -29,7 +29,7 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||||
#define SMP_FALLBACK 0
|
#define SMP_FALLBACK 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
/*
|
/*
|
||||||
* Used to allow _sys_suspend() implementation to control notification
|
* Used to allow _sys_suspend() implementation to control notification
|
||||||
* of the event that caused exit from kernel idling after pm operations.
|
* of the event that caused exit from kernel idling after pm operations.
|
||||||
|
@ -40,20 +40,20 @@ unsigned char sys_pm_idle_exit_notify;
|
||||||
/* LCOV_EXCL_START
|
/* LCOV_EXCL_START
|
||||||
* These are almost certainly overidden and in any event do nothing
|
* 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)
|
void __attribute__((weak)) _sys_resume(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
void __attribute__((weak)) _sys_resume_from_deep_sleep(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
#endif /* CONFIG_SYS_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -69,7 +69,7 @@ void __attribute__((weak)) _sys_resume_from_deep_sleep(void)
|
||||||
#if !SMP_FALLBACK
|
#if !SMP_FALLBACK
|
||||||
static void set_kernel_idle_time_in_ticks(int32_t ticks)
|
static void set_kernel_idle_time_in_ticks(int32_t ticks)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
_kernel.idle = ticks;
|
_kernel.idle = ticks;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ static void sys_power_save_idle(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_kernel_idle_time_in_ticks(ticks);
|
set_kernel_idle_time_in_ticks(ticks);
|
||||||
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES) || \
|
#if (defined(CONFIG_PM_SLEEP_STATES) || \
|
||||||
defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
|
defined(CONFIG_PM_DEEP_SLEEP_STATES))
|
||||||
|
|
||||||
sys_pm_idle_exit_notify = 1U;
|
sys_pm_idle_exit_notify = 1U;
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ static void sys_power_save_idle(void)
|
||||||
|
|
||||||
void z_sys_power_save_idle_exit(int32_t ticks)
|
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
|
/* Some CPU low power states require notification at the ISR
|
||||||
* to allow any operations that needs to be done before kernel
|
* to allow any operations that needs to be done before kernel
|
||||||
* switches task or processes nested interrupts. This can be
|
* switches task or processes nested interrupts. This can be
|
||||||
|
|
|
@ -31,7 +31,7 @@ GEN_OFFSET_SYM(_cpu_t, irq_stack);
|
||||||
GEN_OFFSET_SYM(_kernel_t, threads);
|
GEN_OFFSET_SYM(_kernel_t, threads);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
#ifdef CONFIG_PM
|
||||||
GEN_OFFSET_SYM(_kernel_t, idle);
|
GEN_OFFSET_SYM(_kernel_t, idle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ CONFIG_SERIAL=n
|
||||||
CONFIG_FLASH=n
|
CONFIG_FLASH=n
|
||||||
|
|
||||||
# Power management
|
# Power management
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=n
|
CONFIG_PM=n
|
||||||
|
|
||||||
# Interrupts
|
# Interrupts
|
||||||
CONFIG_DYNAMIC_INTERRUPTS=n
|
CONFIG_DYNAMIC_INTERRUPTS=n
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Enable config log
|
# Enable config log
|
||||||
CONFIG_LOG=y
|
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_LOG_PROCESS_THREAD_SLEEP_MS=2100
|
||||||
|
|
||||||
CONFIG_THREAD_NAME=y
|
CONFIG_THREAD_NAME=y
|
||||||
# Enable PM debug in MEC1501 this will give indication in MCHP_060
|
# Enable PM debug in MEC1501 this will give indication in MCHP_060
|
||||||
CONFIG_SYS_PM_DEBUG=y
|
CONFIG_PM_DEBUG=y
|
||||||
|
|
|
@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(pwrmgmt_test);
|
||||||
/* Thread properties */
|
/* Thread properties */
|
||||||
#define TASK_STACK_SIZE 1024ul
|
#define TASK_STACK_SIZE 1024ul
|
||||||
#define PRIORITY K_PRIO_COOP(5)
|
#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_A_SLEEP_TIME 100ul
|
||||||
#define THREAD_B_SLEEP_TIME 1000ul
|
#define THREAD_B_SLEEP_TIME 1000ul
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles)
|
||||||
LOG_INF("Suspend...");
|
LOG_INF("Suspend...");
|
||||||
suspend_all_tasks();
|
suspend_all_tasks();
|
||||||
LOG_INF("About to enter light sleep");
|
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);
|
LT_EXTRA_SLP_TIME);
|
||||||
k_busy_wait(100);
|
k_busy_wait(100);
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles)
|
||||||
|
|
||||||
/* GPIO toggle to measure latency for deep sleep */
|
/* GPIO toggle to measure latency for deep sleep */
|
||||||
pm_trigger_marker();
|
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);
|
DP_EXTRA_SLP_TIME);
|
||||||
k_busy_wait(100);
|
k_busy_wait(100);
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles)
|
||||||
|
|
||||||
/* Trigger Light Sleep 1 state. 48MHz PLL stays on */
|
/* Trigger Light Sleep 1 state. 48MHz PLL stays on */
|
||||||
LOG_INF("About to enter light sleep");
|
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);
|
LT_EXTRA_SLP_TIME);
|
||||||
k_busy_wait(100);
|
k_busy_wait(100);
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles)
|
||||||
|
|
||||||
/* GPIO toggle to measure latency */
|
/* GPIO toggle to measure latency */
|
||||||
pm_trigger_marker();
|
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);
|
DP_EXTRA_SLP_TIME);
|
||||||
k_busy_wait(100);
|
k_busy_wait(100);
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
/** @brief Alternates between light and deep sleep cycles.
|
/** @brief Alternates between light and deep sleep cycles.
|
||||||
*
|
*
|
||||||
* For light sleep, the test sleeps in main thread for 500 ms longer than
|
* 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
|
* 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,
|
* @param use_logging test progress will be reported using logging,
|
||||||
* otherwise printk.
|
* otherwise printk.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=y
|
CONFIG_PM=y
|
||||||
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
|
CONFIG_PM_DEEP_SLEEP_STATES=y
|
||||||
# Required to disable default behavior of deep sleep on timeout
|
# Required to disable default behavior of deep sleep on timeout
|
||||||
CONFIG_SYS_PM_STATE_LOCK=y
|
CONFIG_PM_STATE_LOCK=y
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=y
|
CONFIG_PM_DEVICE=y
|
||||||
CONFIG_GPIO=y
|
CONFIG_GPIO=y
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CONFIG_GPIO=y
|
CONFIG_GPIO=y
|
||||||
|
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=y
|
CONFIG_PM=y
|
||||||
CONFIG_SYS_POWER_SLEEP_STATES=y
|
CONFIG_PM_SLEEP_STATES=y
|
||||||
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
|
CONFIG_PM_DEEP_SLEEP_STATES=y
|
||||||
|
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=y
|
CONFIG_PM_DEVICE=y
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
|
# Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=y
|
CONFIG_PM_DEVICE=y
|
||||||
|
|
|
@ -5,3 +5,4 @@ CONFIG_LOG_IMMEDIATE=y
|
||||||
CONFIG_SPI=y
|
CONFIG_SPI=y
|
||||||
CONFIG_SPI_FLASH_AT45=y
|
CONFIG_SPI_FLASH_AT45=y
|
||||||
CONFIG_FLASH=y
|
CONFIG_FLASH=y
|
||||||
|
CONFIG_PM_DEVICE=y
|
||||||
|
|
|
@ -149,7 +149,7 @@ void main(void)
|
||||||
|
|
||||||
printk("OK\n");
|
printk("OK\n");
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#if IS_ENABLED(CONFIG_PM_DEVICE)
|
||||||
printk("Putting the flash device into low power state... ");
|
printk("Putting the flash device into low power state... ");
|
||||||
err = device_set_power_state(flash_dev, DEVICE_PM_LOW_POWER_STATE,
|
err = device_set_power_state(flash_dev, DEVICE_PM_LOW_POWER_STATE,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=y
|
CONFIG_PM=y
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=y
|
CONFIG_PM_DEVICE=y
|
||||||
CONFIG_NET_STATISTICS_POWER_MANAGEMENT=y
|
CONFIG_NET_STATISTICS_POWER_MANAGEMENT=y
|
||||||
|
|
|
@ -3,7 +3,7 @@ CONFIG_ASSERT=y
|
||||||
CONFIG_ASSERT_LEVEL=2
|
CONFIG_ASSERT_LEVEL=2
|
||||||
CONFIG_NUM_COOP_PRIORITIES=29
|
CONFIG_NUM_COOP_PRIORITIES=29
|
||||||
CONFIG_NUM_PREEMPT_PRIORITIES=40
|
CONFIG_NUM_PREEMPT_PRIORITIES=40
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=y
|
CONFIG_PM=y
|
||||||
CONFIG_TICKLESS_KERNEL=y
|
CONFIG_TICKLESS_KERNEL=y
|
||||||
|
|
||||||
CONFIG_MP_NUM_CPUS=1
|
CONFIG_MP_NUM_CPUS=1
|
||||||
|
|
|
@ -9,4 +9,4 @@ CONFIG_I2C_LOG_LEVEL_INF=y
|
||||||
|
|
||||||
CONFIG_APDS9960=y
|
CONFIG_APDS9960=y
|
||||||
CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD=n
|
CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD=n
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=n
|
CONFIG_PM_DEVICE=n
|
||||||
|
|
|
@ -76,7 +76,7 @@ void main(void)
|
||||||
printk("ambient light intensity %d, proximity %d\n",
|
printk("ambient light intensity %d, proximity %d\n",
|
||||||
intensity.val1, pdata.val1);
|
intensity.val1, pdata.val1);
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t p_state;
|
uint32_t p_state;
|
||||||
|
|
||||||
p_state = DEVICE_PM_LOW_POWER_STATE;
|
p_state = DEVICE_PM_LOW_POWER_STATE;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
CONFIG_SYS_POWER_MANAGEMENT=y
|
CONFIG_PM=y
|
||||||
CONFIG_DEVICE_POWER_MANAGEMENT=y
|
CONFIG_PM_DEVICE=y
|
||||||
CONFIG_DEVICE_IDLE_PM=y
|
CONFIG_PM_DEVICE_IDLE=y
|
||||||
|
|
|
@ -8,7 +8,7 @@ zephyr_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
|
zephyr_sources_ifdef(CONFIG_PM
|
||||||
device_power.c
|
device_power.c
|
||||||
power.c
|
power.c
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,22 +61,22 @@ config SPI_XEC_QMSPI
|
||||||
|
|
||||||
if SOC_POWER_MANAGEMENT
|
if SOC_POWER_MANAGEMENT
|
||||||
|
|
||||||
config SYS_POWER_MANAGEMENT
|
config PM
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config SYS_POWER_SLEEP_STATES
|
config PM_SLEEP_STATES
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_SLEEP_1
|
config HAS_POWER_STATE_SLEEP_1
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config SYS_POWER_DEEP_SLEEP_STATES
|
config PM_DEEP_SLEEP_STATES
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
config HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config DEVICE_POWER_MANAGEMENT
|
config PM_DEVICE
|
||||||
default n
|
default n
|
||||||
|
|
||||||
endif # SOC_POWER_MANAGEMENT
|
endif # SOC_POWER_MANAGEMENT
|
||||||
|
|
|
@ -48,7 +48,7 @@ void soc_lite_sleep_enable(void)
|
||||||
* will be ramping up from ~16 to 24 MHz.
|
* 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)
|
void soc_deep_sleep_enable(void)
|
||||||
{
|
{
|
||||||
|
@ -228,4 +228,4 @@ void soc_deep_sleep_periph_restore(void)
|
||||||
|
|
||||||
#endif /* DEEP_SLEEP_PERIPH_SAVE_RESTORE */
|
#endif /* DEEP_SLEEP_PERIPH_SAVE_RESTORE */
|
||||||
|
|
||||||
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
|
#endif /* CONFIG_PM_DEEP_SLEEP_STATES */
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
void soc_lite_sleep_enable(void);
|
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_enable(void);
|
||||||
void soc_deep_sleep_disable(void);
|
void soc_deep_sleep_disable(void);
|
||||||
void soc_deep_sleep_periph_save(void);
|
void soc_deep_sleep_periph_save(void);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include "device_power.h"
|
#include "device_power.h"
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)
|
#if defined(CONFIG_PM_DEEP_SLEEP_STATES)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deep Sleep
|
* Deep Sleep
|
||||||
|
@ -79,7 +79,7 @@ static void z_power_soc_deep_sleep(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
|
#ifdef CONFIG_PM_SLEEP_STATES
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Light Sleep
|
* Light Sleep
|
||||||
|
@ -110,12 +110,12 @@ static void z_power_soc_sleep(void)
|
||||||
void sys_set_power_state(enum power_states state)
|
void sys_set_power_state(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
|
#if (defined(CONFIG_PM_SLEEP_STATES))
|
||||||
case SYS_POWER_STATE_SLEEP_1:
|
case SYS_POWER_STATE_SLEEP_1:
|
||||||
z_power_soc_sleep();
|
z_power_soc_sleep();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
|
#if (defined(CONFIG_PM_DEEP_SLEEP_STATES))
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
z_power_soc_deep_sleep();
|
z_power_soc_deep_sleep();
|
||||||
break;
|
break;
|
||||||
|
@ -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)
|
void _sys_pm_power_state_exit_post_ops(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
|
#if (defined(CONFIG_PM_SLEEP_STATES))
|
||||||
case SYS_POWER_STATE_SLEEP_1:
|
case SYS_POWER_STATE_SLEEP_1:
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
|
#if (defined(CONFIG_PM_DEEP_SLEEP_STATES))
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -27,7 +27,7 @@ config SYS_CLOCK_TICKS_PER_SEC
|
||||||
config ARCH_HAS_CUSTOM_BUSY_WAIT
|
config ARCH_HAS_CUSTOM_BUSY_WAIT
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config SYS_POWER_MANAGEMENT
|
config PM
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config BUILD_OUTPUT_HEX
|
config BUILD_OUTPUT_HEX
|
||||||
|
|
|
@ -6,7 +6,7 @@ zephyr_library_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
|
zephyr_library_sources_ifdef(CONFIG_PM
|
||||||
power.c
|
power.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ config SOC_SERIES_NRF51X
|
||||||
select ARM
|
select ARM
|
||||||
select CPU_CORTEX_M0
|
select CPU_CORTEX_M0
|
||||||
select SOC_FAMILY_NRF
|
select SOC_FAMILY_NRF
|
||||||
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
select HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
select XIP
|
select XIP
|
||||||
select HAS_NRFX
|
select HAS_NRFX
|
||||||
select HAS_SEGGER_RTT
|
select HAS_SEGGER_RTT
|
||||||
|
|
|
@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
void sys_set_power_state(enum power_states state)
|
void sys_set_power_state(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
nrf_power_system_off(NRF_POWER);
|
nrf_power_system_off(NRF_POWER);
|
||||||
break;
|
break;
|
||||||
|
@ -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)
|
void _sys_pm_power_state_exit_post_ops(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,7 +6,7 @@ zephyr_library_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
|
zephyr_library_sources_ifdef(CONFIG_PM
|
||||||
power.c
|
power.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ config SOC_SERIES_NRF52X
|
||||||
select CPU_CORTEX_M4
|
select CPU_CORTEX_M4
|
||||||
select CPU_HAS_ARM_MPU
|
select CPU_HAS_ARM_MPU
|
||||||
select SOC_FAMILY_NRF
|
select SOC_FAMILY_NRF
|
||||||
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
select HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
select XIP
|
select XIP
|
||||||
select HAS_NRFX
|
select HAS_NRFX
|
||||||
select HAS_NORDIC_DRIVERS
|
select HAS_NORDIC_DRIVERS
|
||||||
|
|
|
@ -14,8 +14,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
void sys_set_power_state(enum power_states state)
|
void sys_set_power_state(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
nrf_power_system_off(NRF_POWER);
|
nrf_power_system_off(NRF_POWER);
|
||||||
break;
|
break;
|
||||||
|
@ -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)
|
void _sys_pm_power_state_exit_post_ops(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,6 +4,6 @@ zephyr_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
|
zephyr_library_sources_ifdef(CONFIG_PM
|
||||||
power.c
|
power.c
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,7 +9,7 @@ config SOC_NRF5340_CPUAPP
|
||||||
select CPU_HAS_NRF_IDAU
|
select CPU_HAS_NRF_IDAU
|
||||||
select CPU_HAS_FPU
|
select CPU_HAS_FPU
|
||||||
select ARMV8_M_DSP
|
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_CC312
|
||||||
select HAS_HW_NRF_CLOCK
|
select HAS_HW_NRF_CLOCK
|
||||||
select HAS_HW_NRF_DPPIC
|
select HAS_HW_NRF_DPPIC
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <power/power.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>
|
#include <hal/nrf_regulators.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
void sys_set_power_state(enum power_states state)
|
void sys_set_power_state(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
nrf_regulators_system_off(NRF_REGULATORS);
|
nrf_regulators_system_off(NRF_REGULATORS);
|
||||||
break;
|
break;
|
||||||
|
@ -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)
|
void _sys_pm_power_state_exit_post_ops(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,6 +4,6 @@ zephyr_sources(
|
||||||
soc.c
|
soc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_SYS_POWER_MANAGEMENT
|
zephyr_library_sources_ifdef(CONFIG_PM
|
||||||
power.c
|
power.c
|
||||||
)
|
)
|
||||||
|
|
|
@ -13,7 +13,7 @@ config SOC_SERIES_NRF91X
|
||||||
select CPU_HAS_FPU
|
select CPU_HAS_FPU
|
||||||
select ARMV8_M_DSP
|
select ARMV8_M_DSP
|
||||||
select SOC_FAMILY_NRF
|
select SOC_FAMILY_NRF
|
||||||
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
select HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
select XIP
|
select XIP
|
||||||
select HAS_NRFX
|
select HAS_NRFX
|
||||||
select HAS_SEGGER_RTT
|
select HAS_SEGGER_RTT
|
||||||
|
|
|
@ -15,8 +15,8 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
|
||||||
void sys_set_power_state(enum power_states state)
|
void sys_set_power_state(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
nrf_regulators_system_off(NRF_REGULATORS);
|
nrf_regulators_system_off(NRF_REGULATORS);
|
||||||
break;
|
break;
|
||||||
|
@ -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)
|
void _sys_pm_power_state_exit_post_ops(enum power_states state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
|
#ifdef CONFIG_PM_DEEP_SLEEP_STATES
|
||||||
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
|
#ifdef CONFIG_HAS_POWER_STATE_DEEP_SLEEP_1
|
||||||
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
case SYS_POWER_STATE_DEEP_SLEEP_1:
|
||||||
/* Nothing to do. */
|
/* Nothing to do. */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,6 +6,6 @@ source "soc/arm/silabs_exx32/*/Kconfig.defconfig.series"
|
||||||
|
|
||||||
config SOC_GECKO_EMU
|
config SOC_GECKO_EMU
|
||||||
default y
|
default y
|
||||||
depends on SYS_POWER_MANAGEMENT
|
depends on PM
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
zephyr_sources(soc.c soc_gpio.c)
|
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…
Add table
Add a link
Reference in a new issue