pm: replace DEVICE_PM_* states with PM_DEVICE_*

Prefix device PM states with PM.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-05-03 17:36:10 +02:00 committed by Anas Nashif
commit 2c7b763e47
52 changed files with 331 additions and 331 deletions

View file

@ -256,7 +256,7 @@ static int init_twim(const struct device *dev)
}
#ifdef CONFIG_PM_DEVICE
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE;
get_dev_data(dev)->pm_state = PM_DEVICE_ACTIVE_STATE;
#endif
return 0;
@ -270,12 +270,12 @@ static int twim_nrfx_pm_control(const struct device *dev,
int ret = 0;
uint32_t pm_current_state = get_dev_data(dev)->pm_state;
if (ctrl_command == DEVICE_PM_SET_POWER_STATE) {
if (ctrl_command == PM_DEVICE_SET_POWER_STATE) {
uint32_t new_state = *((const uint32_t *)context);
if (new_state != pm_current_state) {
switch (new_state) {
case DEVICE_PM_ACTIVE_STATE:
case PM_DEVICE_ACTIVE_STATE:
init_twim(dev);
if (get_dev_data(dev)->dev_config) {
i2c_nrfx_twim_configure(
@ -284,10 +284,10 @@ static int twim_nrfx_pm_control(const struct device *dev,
}
break;
case DEVICE_PM_LOW_POWER_STATE:
case DEVICE_PM_SUSPEND_STATE:
case DEVICE_PM_OFF_STATE:
if (pm_current_state != DEVICE_PM_ACTIVE_STATE) {
case PM_DEVICE_LOW_POWER_STATE:
case PM_DEVICE_SUSPEND_STATE:
case PM_DEVICE_OFF_STATE:
if (pm_current_state != PM_DEVICE_ACTIVE_STATE) {
break;
}
nrfx_twim_uninit(&get_dev_config(dev)->twim);
@ -301,7 +301,7 @@ static int twim_nrfx_pm_control(const struct device *dev,
}
}
} else {
__ASSERT_NO_MSG(ctrl_command == DEVICE_PM_GET_POWER_STATE);
__ASSERT_NO_MSG(ctrl_command == PM_DEVICE_GET_POWER_STATE);
*((uint32_t *)context) = get_dev_data(dev)->pm_state;
}