The type qualifier of the return type is causing warnings if
-Wignored-qualifiers, and it's irrelevant anyways since
the function returns a value and not a pointer
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Change pm_power_state_force to receive which cpu the state should be
forced. Also, it changed the API behavior to force the given state only
when the idle thread for that core is executed.
In a multicore environment force arbitrarily a core to suspend is not
safe because the kernel cannot infer what that cpu is running and how it
impacts the overall system, for example, if it is holding a lock that is
required by a thread that is running in another cpu.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
- Add a new `subsys_pm` group, part of `subsys`
- Improve group naming
- Include conditional code using __DOXYGEN__, it allows to have better
control of inclusion.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a function that can be used by device drivers to know
what will be next power state used by the SoC.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Uses the stats subsys to provide simple but useful debugging stats for
power management state changes and timing.
Removes the no longer needed PM_DEBUG config option
Replaces the use of PM_DEBUG for a test clock output pin for mec1501 and
adds in its place an SoC Kconfig option to enable it.
Adds a STATS_SET macro for assigning a value to a stat group field
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
z_pm_save_idle_exit() is only declared if CONFIG_PM is enabled but
unconditionally defined. Just move it around in the header to always
be declared.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Create stubs for when the subsystem is not compiled. Some drivers need
to use constraints when are in the middle of a transaction to avoid
the system to sleep. As the same driver may be used in a target that
does not support power management, they have to conditionally (#if
CONFIG_PM) call these functions, these stubs avoid this regular problem.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
- Move PM related APIs to `include/pm` so that it follows API `pm_`
prefix namespace. In order to make transition easier
`include/power/power.h` is kept pointing to `include/pm/pm.h`.
- Move most of device PM related content from `include/device.h` to
`include/pm/device.h` and `include/pm/runtime.h`.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>