pm: Rename pm_power_state_set

Aligning with the rest of PM API, replace pm_power_state_set with
pm_state_set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-02-04 17:19:52 -08:00 committed by Anas Nashif
commit 89fee61b43
25 changed files with 32 additions and 32 deletions

View file

@ -12,7 +12,7 @@
* power saving. See your SOC's datasheet for specifics of what peripherals * power saving. See your SOC's datasheet for specifics of what peripherals
* have their clocks gated at each set point. * have their clocks gated at each set point.
* *
* Set point control is implemented at the soc level (see pm_power_state_set()) * Set point control is implemented at the soc level (see pm_state_set())
*/ */
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PM_IMX_SPC_H_ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PM_IMX_SPC_H_

View file

@ -182,7 +182,7 @@ bool pm_constraint_get(enum pm_state state);
* @param state Power state. * @param state Power state.
* @param substate_id Power substate id. * @param substate_id Power substate id.
*/ */
void pm_power_state_set(enum pm_state state, uint8_t substate_id); void pm_state_set(enum pm_state state, uint8_t substate_id);
/** /**
* @brief Do any SoC or architecture specific post ops after sleep state exits. * @brief Do any SoC or architecture specific post ops after sleep state exits.
@ -210,7 +210,7 @@ void pm_power_state_exit_post_ops(enum pm_state state, uint8_t substate_id);
#define pm_constraint_release(pm_state) #define pm_constraint_release(pm_state)
#define pm_constraint_get(pm_state) (true) #define pm_constraint_get(pm_state) (true)
#define pm_power_state_set(state, substate_id) #define pm_state_set(state, substate_id)
#define pm_power_state_exit_post_ops(state, substate_id) #define pm_power_state_exit_post_ops(state, substate_id)
#define pm_power_state_next_get(cpu) \ #define pm_power_state_next_get(cpu) \
(&(struct pm_state_info){PM_STATE_ACTIVE, 0, 0}) (&(struct pm_state_info){PM_STATE_ACTIVE, 0, 0})

View file

@ -101,7 +101,7 @@ static void z_power_soc_sleep(void)
* For deep sleep pm_system_suspend has executed all the driver * For deep sleep pm_system_suspend has executed all the driver
* power management call backs. * power management call backs.
*/ */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -11,7 +11,7 @@
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -11,7 +11,7 @@
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -13,7 +13,7 @@
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -12,7 +12,7 @@
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -144,7 +144,7 @@ static void npcx_power_enter_system_sleep(int slp_mode, int wk_mode)
} }
/* Invoke when enter "Suspend/Low Power" mode. */ /* Invoke when enter "Suspend/Low Power" mode. */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
if (state != PM_STATE_SUSPEND_TO_IDLE) { if (state != PM_STATE_SUSPEND_TO_IDLE) {
LOG_DBG("Unsupported power state %u", state); LOG_DBG("Unsupported power state %u", state);

View file

@ -283,7 +283,7 @@ void cpu_mode_transition(gpc_cpu_mode_t mode, bool enable_standby)
* SOC specific low power mode implementation * SOC specific low power mode implementation
* Drop to lowest power state possible given system's request * Drop to lowest power state possible given system's request
*/ */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(state); ARG_UNUSED(state);

View file

@ -22,7 +22,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
APP_DEEPSLEEP_RAM_APD, APP_DEEPSLEEP_RAM_PPD})) APP_DEEPSLEEP_RAM_APD, APP_DEEPSLEEP_RAM_PPD}))
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -25,7 +25,7 @@ __ramfunc static void wait_for_flash_prefetch_and_idle(void)
} }
#endif /* CONFIG_XIP */ #endif /* CONFIG_XIP */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
switch (state) { switch (state) {
case PM_STATE_RUNTIME_IDLE: case PM_STATE_RUNTIME_IDLE:

View file

@ -18,7 +18,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
*/ */
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -20,7 +20,7 @@
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
if (info->state != PM_STATE_SUSPEND_TO_IDLE) { if (info->state != PM_STATE_SUSPEND_TO_IDLE) {
LOG_DBG("Unsupported power state %u", state); LOG_DBG("Unsupported power state %u", state);

View file

@ -28,7 +28,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
#endif #endif
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -28,7 +28,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
#endif #endif
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
if (state != PM_STATE_SUSPEND_TO_IDLE) { if (state != PM_STATE_SUSPEND_TO_IDLE) {
LOG_DBG("Unsupported power state %u", state); LOG_DBG("Unsupported power state %u", state);

View file

@ -28,7 +28,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
#endif #endif
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
if (state != PM_STATE_SUSPEND_TO_IDLE) { if (state != PM_STATE_SUSPEND_TO_IDLE) {
LOG_DBG("Unsupported power state %u", state); LOG_DBG("Unsupported power state %u", state);

View file

@ -62,7 +62,7 @@ void set_mode_shutdown(uint8_t substate_id)
} }
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
switch (state) { switch (state) {
case PM_STATE_SUSPEND_TO_IDLE: case PM_STATE_SUSPEND_TO_IDLE:

View file

@ -84,7 +84,7 @@ static void shutdown_ble_stack(void)
} }
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
if (state == PM_STATE_SOFT_OFF) { if (state == PM_STATE_SOFT_OFF) {

View file

@ -28,7 +28,7 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
#endif #endif
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
switch (state) { switch (state) {
case PM_STATE_SUSPEND_TO_IDLE: case PM_STATE_SUSPEND_TO_IDLE:

View file

@ -57,7 +57,7 @@ extern PowerCC26X2_ModuleState PowerCC26X2_module;
*/ */
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -17,7 +17,7 @@ static void ite_power_soc_deep_doze(void)
} }
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
__weak void pm_power_state_set(enum pm_state state, uint8_t substate_id) __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);

View file

@ -121,13 +121,13 @@ static inline void pm_exit_pos_ops(struct pm_state_info *info)
} }
} }
static inline void pm_state_set(struct pm_state_info *info) static inline void state_set(struct pm_state_info *info)
{ {
extern __weak void extern __weak void
pm_power_state_set(enum pm_state state, uint8_t substate_id); pm_state_set(enum pm_state state, uint8_t substate_id);
if (pm_power_state_set != NULL) { if (pm_state_set != NULL) {
pm_power_state_set(info->state, info->substate_id); pm_state_set(info->state, info->substate_id);
} }
} }
@ -261,7 +261,7 @@ bool pm_system_suspend(int32_t ticks)
/* Enter power state */ /* Enter power state */
pm_state_notify(true); pm_state_notify(true);
atomic_set_bit(z_post_ops_required, id); atomic_set_bit(z_post_ops_required, id);
pm_state_set(&z_cpus_pm_state[id]); state_set(&z_cpus_pm_state[id]);
pm_stats_stop(); pm_stats_stop();
/* Wake up sequence starts here */ /* Wake up sequence starts here */

View file

@ -16,7 +16,7 @@ static const struct device *dev;
static uint8_t sleep_count; static uint8_t sleep_count;
void pm_power_state_set(enum pm_state state, uint8_t substate_id) void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);
@ -106,7 +106,7 @@ void test_wakeup_device_system_pm(void)
* PM_STATE_SUSPEND_TO_RAM and then the PM subsystem will * PM_STATE_SUSPEND_TO_RAM and then the PM subsystem will
* suspend all devices. As gpio is wakeup capability is not * suspend all devices. As gpio is wakeup capability is not
* enabled, the device will be suspended. This will be * enabled, the device will be suspended. This will be
* confirmed in pm_power_state_set(). * confirmed in pm_state_set().
* *
* As the native posix implementation does not properly sleeps, * As the native posix implementation does not properly sleeps,
* the idle thread will call several times the PM subsystem. This * the idle thread will call several times the PM subsystem. This

View file

@ -141,7 +141,7 @@ DEVICE_DT_DEFINE(DT_INST(2, test_device_pm), device_init,
void pm_power_state_set(enum pm_state state, uint8_t substate_id) void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);
ARG_UNUSED(state); ARG_UNUSED(state);

View file

@ -30,7 +30,7 @@ BUILD_ASSERT(CONFIG_MP_NUM_CPUS == 2, "Invalid number of cpus");
static enum pm_state state_testing[2]; static enum pm_state state_testing[2];
void pm_power_state_set(enum pm_state state, uint8_t substate_id) void pm_state_set(enum pm_state state, uint8_t substate_id)
{ {
ARG_UNUSED(substate_id); ARG_UNUSED(substate_id);
@ -99,7 +99,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int ticks)
* - Iterate a number of times to stress it. * - Iterate a number of times to stress it.
* *
* @see pm_policy_next_state() * @see pm_policy_next_state()
* @see pm_power_state_set() * @see pm_state_set()
* *
* @ingroup power_tests * @ingroup power_tests
*/ */