Commit graph

9 commits

Author SHA1 Message Date
Flavio Ceolin 02a14d75fc pm: Declare pm state constraints for a device
Declare power state constraints for a device in devicetree.
It allows a map between device instances and power states that disable
their power. This information is used by a new API
(pm_policy_device_power_lock_put/get) that automically set/release
pm state constraints.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-07 19:06:23 -04:00
Benjamin Cabé 9ad403e9ca doc: pm: policy: Hide internal/private fields.
Use INTERNAL_HIDDEN to hide private fields from public
documentation.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-30 18:47:41 +02:00
Gerard Marull-Paretas 9a145e52a0 pm: policy: add support for events
Events in the power-management policy context are defined as any source
that will wake up the system at a known time in the future. By
registering such event, the policy manager will be able to decide wether
certain power states are worth entering or not.

Events will bypass the ticks argument received by the policy manager if
they occur earlier.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-25 16:29:40 -04:00
Gerard Marull-Paretas c8cd40f5ae pm: policy: clarify latency units and clarify private members
Latency is always specified in microseconds, so apend `us` to the
relevant variables. Also, make it clear that latency request structures
are private (they are just exposed publicly to allow static allocation).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-25 16:29:40 -04:00
Gerard Marull-Paretas 8aa0baed3d pm: policy: add missing include
zephyr/pm/policy.h is using ARG_UNUSED without including
zephyr/toolchain.h.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-11 11:00:26 +01:00
Gerard Marull-Paretas a650c6c554 pm: policy: allow multiple subscribers to latency changes
Current API allowed to get notified when the maximum system latency
changes, however, a single callback was allowed. The design was intended
for SoC specific actions when latency changes. However, in some cases
drivers may also want to know the current maximum latency to perform
local actions if other parts of the system modify it.

This patch updates the API with a pair of subscribe/unsubscribe calls to
achieve such goal. Tests have been updated to show how the API can be
used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 11:19:17 +02:00
Gerard Marull-Paretas fb9b3bcd93 include: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:03:00 +02:00
Carlo Caione 69b28bfd07 pm: policy: Consider substates for state lock functions
Extend the current pm_policy_state_lock_*() functions to support
substates.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-28 16:32:23 +02:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Renamed from include/pm/policy.h (Browse further)