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:
parent
2d39c01592
commit
2c7b763e47
52 changed files with 331 additions and 331 deletions
|
@ -183,7 +183,7 @@ static int bme280_sample_fetch(const struct device *dev,
|
|||
|
||||
#ifdef CONFIG_PM_DEVICE
|
||||
/* Do not allow sample fetching from OFF state */
|
||||
if (data->pm_state == DEVICE_PM_OFF_STATE)
|
||||
if (data->pm_state == PM_DEVICE_OFF_STATE)
|
||||
return -EIO;
|
||||
#endif
|
||||
|
||||
|
@ -383,7 +383,7 @@ static int bme280_chip_init(const struct device *dev)
|
|||
|
||||
#ifdef CONFIG_PM_DEVICE
|
||||
/* Set power state to ACTIVE */
|
||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||
data->pm_state = PM_DEVICE_ACTIVE_STATE;
|
||||
#endif
|
||||
LOG_DBG("\"%s\" OK", dev->name);
|
||||
return 0;
|
||||
|
@ -398,19 +398,19 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
|
|||
int ret = 0;
|
||||
|
||||
/* Set power state */
|
||||
if (ctrl_command == DEVICE_PM_SET_POWER_STATE) {
|
||||
if (ctrl_command == PM_DEVICE_SET_POWER_STATE) {
|
||||
uint32_t new_pm_state = *((const uint32_t *)context);
|
||||
|
||||
if (new_pm_state != data->pm_state) {
|
||||
|
||||
/* Switching from OFF to any */
|
||||
if (data->pm_state == DEVICE_PM_OFF_STATE) {
|
||||
if (data->pm_state == PM_DEVICE_OFF_STATE) {
|
||||
|
||||
/* Re-initialize the chip */
|
||||
ret = bme280_chip_init(dev);
|
||||
}
|
||||
/* Switching to OFF from any */
|
||||
else if (new_pm_state == DEVICE_PM_OFF_STATE) {
|
||||
else if (new_pm_state == PM_DEVICE_OFF_STATE) {
|
||||
|
||||
/* Put the chip into sleep mode */
|
||||
ret = bme280_reg_write(dev,
|
||||
|
@ -429,7 +429,7 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
|
|||
}
|
||||
/* Get power state */
|
||||
else {
|
||||
__ASSERT_NO_MSG(ctrl_command == DEVICE_PM_GET_POWER_STATE);
|
||||
__ASSERT_NO_MSG(ctrl_command == PM_DEVICE_GET_POWER_STATE);
|
||||
*((uint32_t *)context) = data->pm_state;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue