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

@ -141,7 +141,7 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
int err;
spi_context_lock(ctx, false, NULL, config);
pm_policy_state_lock_get(PM_STATE_STANDBY);
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
err = spi_cc13xx_cc26xx_configure(dev, config);
if (err) {
@ -175,7 +175,7 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
spi_context_cs_control(ctx, false);
done:
pm_policy_state_lock_put(PM_STATE_STANDBY);
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
spi_context_release(ctx, err);
return err;
}