drivers: cc13xx_cc26xx: guard references to sleep states

Use of macros such as SYS_POWER_STATE_SLEEP_2 needs to be guarded by
making sure CONFIG_SYS_POWER_SLEEP_STATES is defined.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2020-03-27 20:54:11 -07:00 committed by Kumar Gala
commit 16fab6c4f8
3 changed files with 16 additions and 8 deletions

View file

@ -206,7 +206,8 @@ static int i2c_cc13xx_cc26xx_transfer(struct device *dev, struct i2c_msg *msgs,
k_sem_take(&get_dev_data(dev)->lock, K_FOREVER);
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
#endif
@ -230,7 +231,8 @@ static int i2c_cc13xx_cc26xx_transfer(struct device *dev, struct i2c_msg *msgs,
}
}
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
#endif