Commit 8beb3423 authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Christopher Friedt
Browse files

pm: Allow override constraints implementation



Implement constraint API as weak symbols so applications or platform
can override them. Constraints are a high-level abstraction to inhibit
the power subsystem of using certain power states. Some platforms can
have their own way to set/release constraints in their drivers that
are not part of Zephyr's code base.

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent c8c3d32a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ LOG_MODULE_DECLARE(power);

static atomic_t power_state_disable_count[PM_STATES_LEN];

void pm_constraint_set(enum pm_state state)
__weak void pm_constraint_set(enum pm_state state)
{
	atomic_val_t v;

@@ -30,7 +30,7 @@ void pm_constraint_set(enum pm_state state)
	(void)(v);
}

void pm_constraint_release(enum pm_state state)
__weak void pm_constraint_release(enum pm_state state)
{
	atomic_val_t v;

@@ -42,7 +42,7 @@ void pm_constraint_release(enum pm_state state)
	(void)(v);
}

bool pm_constraint_get(enum pm_state state)
__weak bool pm_constraint_get(enum pm_state state)
{
	__ASSERT(state < PM_STATES_LEN, "Invalid power state!");