pm: device: Align state names with system states

Change device pm states to the same pattern used by system power
management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-05-07 14:18:57 -07:00 committed by Anas Nashif
commit 0c607adb63
51 changed files with 258 additions and 258 deletions

View file

@ -476,7 +476,7 @@ static int st7735r_init(const struct device *dev)
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
data->pm_state = PM_DEVICE_ACTIVE_STATE;
data->pm_state = PM_DEVICE_STATE_ACTIVE;
#endif
data->cmd_data_dev = device_get_binding(config->cmd_data.name);
@ -527,18 +527,18 @@ static int st7735r_pm_control(const struct device *dev, uint32_t ctrl_command,
switch (ctrl_command) {
case PM_DEVICE_STATE_SET:
if (*((uint32_t *)context) == PM_DEVICE_ACTIVE_STATE) {
if (*((uint32_t *)context) == PM_DEVICE_STATE_ACTIVE) {
ret = st7735r_exit_sleep(data);
if (ret < 0) {
return ret;
}
data->pm_state = PM_DEVICE_ACTIVE_STATE;
data->pm_state = PM_DEVICE_STATE_ACTIVE;
} else {
ret = st7735r_enter_sleep(data);
if (ret < 0) {
return ret;
}
data->pm_state = PM_DEVICE_LOW_POWER_STATE;
data->pm_state = PM_DEVICE_STATE_LOW_POWER;
}
break;

View file

@ -376,7 +376,7 @@ static int st7789v_init(const struct device *dev)
#endif
#ifdef CONFIG_PM_DEVICE
data->pm_state = PM_DEVICE_ACTIVE_STATE;
data->pm_state = PM_DEVICE_STATE_ACTIVE;
#endif
data->cmd_data_gpio = device_get_binding(
@ -416,13 +416,13 @@ static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command,
switch (ctrl_command) {
case DEVICE_PM_SET_POWER_STATE:
if (*state == PM_DEVICE_ACTIVE_STATE) {
if (*state == PM_DEVICE_STATE_ACTIVE) {
st7789v_exit_sleep(data);
data->pm_state = PM_DEVICE_ACTIVE_STATE;
data->pm_state = PM_DEVICE_STATE_ACTIVE;
ret = 0;
} else {
st7789v_enter_sleep(data);
data->pm_state = PM_DEVICE_LOW_POWER_STATE;
data->pm_state = PM_DEVICE_STATE_LOW_POWER;
ret = 0;
}
break;