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>
This commit is contained in:
Carlo Caione 2022-04-07 13:06:12 +02:00 committed by Carles Cufí
commit 69b28bfd07
19 changed files with 145 additions and 55 deletions

View file

@ -196,7 +196,7 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
k_sem_take(&data->lock, K_FOREVER);
pm_policy_state_lock_get(PM_STATE_STANDBY);
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
for (int i = 0; i < num_msgs; i++) {
/* Not supported by hardware */
@ -218,7 +218,7 @@ static int i2c_cc13xx_cc26xx_transfer(const struct device *dev,
}
}
pm_policy_state_lock_put(PM_STATE_STANDBY);
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
k_sem_give(&data->lock);