pm: policy: move constraints to policy API
The pm_constraint_* APIs were effectively used by the policy manager only. This patch renames the API to the policy namespace and makes its naming more explicit: - pm_constraint_set -> pm_policy_state_lock_get() - pm_constraint_release -> pm_policy_state_lock_put() - pm_constraint_get -> pm_policy_state_lock_is_active() The reason for these changes is that constraints can be of many types: allow/disallow states, impose latency requirements, etc. The new naming also makes explicit that the API calls will influence the PM policy behavior. All drivers and documentation have been updated accordingly. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
d158f512ac
commit
5a71eeb35c
23 changed files with 191 additions and 195 deletions
|
@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(spi_cc13xx_cc26xx);
|
|||
|
||||
#include <drivers/spi.h>
|
||||
#include <pm/device.h>
|
||||
#include <pm/pm.h>
|
||||
#include <pm/policy.h>
|
||||
|
||||
#include <driverlib/prcm.h>
|
||||
#include <driverlib/ssi.h>
|
||||
|
@ -142,7 +142,7 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
|
|||
spi_context_lock(ctx, false, NULL, config);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
pm_constraint_set(PM_STATE_STANDBY);
|
||||
pm_policy_state_lock_get(PM_STATE_STANDBY);
|
||||
#endif
|
||||
|
||||
err = spi_cc13xx_cc26xx_configure(dev, config);
|
||||
|
@ -178,7 +178,7 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
|
|||
|
||||
done:
|
||||
#ifdef CONFIG_PM
|
||||
pm_constraint_release(PM_STATE_STANDBY);
|
||||
pm_policy_state_lock_put(PM_STATE_STANDBY);
|
||||
#endif
|
||||
spi_context_release(ctx, err);
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue