Commit Graph

13 Commits

Author SHA1 Message Date
Emil Lindqvist 5af3bbb27b pm: remove irrelevant type qualifier on pm_power_state_next_get
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>
2021-12-01 14:03:55 -06:00
Flavio Ceolin 00252b8d9e pm: Fix documentation section
pm_power_state_next_get does not belong the pm subsys hooks section.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Flavio Ceolin 4998c52ba8 pm: Make pm_power_state_force multicore aware
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>
2021-11-18 13:56:15 +01:00
Flavio Ceolin 7dd4297214 pm: Remove unused parameter
The number of ticks on z_pm_save_idle_exit is not used and there is
no need to have it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-17 11:15:49 -05:00
Flavio Ceolin 8c3d9afed7 pm: Change pm_power_state_next_get to support SMP
Change the API to account multiple CPUs.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin af2def14d8 pm: Document missing parameter in exit post ops
info parameter was not properly documented.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Gerard Marull-Paretas 4daf285c8c pm: cleanup Doxygen groups and inclusion
- 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>
2021-11-04 16:49:08 +01:00
Flavio Ceolin a507f60390 pm: Add a new function to query the next power state
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>
2021-10-26 15:02:15 -05:00
Tom Burdick f523c336ef pm: Use stats subsys for tracking system states
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>
2021-10-17 10:56:21 -04:00
Flavio Ceolin c8c3d32a0f pm: Fix function prototype visibility
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>
2021-09-12 18:20:34 -04:00
Flavio Ceolin 32cc7bc039 pm: Implement function stubs when PM is not enabled
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>
2021-09-12 18:20:34 -04:00
Meng xianglin f039cc44a1 pm: refine defination of pm_dump_debug_info()
Provide dummy implementation of pm_dump_debug_info() as a
static inline function in pm.h.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2021-08-19 10:19:24 -04:00
Gerard Marull-Paretas 25bb163dc2 pm: reorganize headers
- 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>
2021-05-05 18:35:49 -04:00