power: standarize PM Kconfigs and cleanup

- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-09-01 18:31:40 -04:00
commit dd931f93a2
150 changed files with 551 additions and 526 deletions

View file

@ -32,7 +32,7 @@ struct spi_cc13xx_cc26xx_config {
struct spi_cc13xx_cc26xx_data {
struct spi_context ctx;
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
@ -148,8 +148,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
spi_context_lock(ctx, false, NULL, config);
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
#endif
@ -185,8 +185,8 @@ static int spi_cc13xx_cc26xx_transceive(const struct device *dev,
spi_context_cs_control(ctx, false);
done:
#if defined(CONFIG_SYS_POWER_MANAGEMENT) && \
defined(CONFIG_SYS_POWER_SLEEP_STATES)
#if defined(CONFIG_PM) && \
defined(CONFIG_PM_SLEEP_STATES)
sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
#endif
spi_context_release(ctx, err);
@ -211,7 +211,7 @@ static int spi_cc13xx_cc26xx_release(const struct device *dev,
return 0;
}
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
uint32_t new_state)
{
@ -276,7 +276,7 @@ static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
return ret;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */
static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
@ -284,7 +284,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
.release = spi_cc13xx_cc26xx_release,
};
#ifdef CONFIG_SYS_POWER_MANAGEMENT
#ifdef CONFIG_PM
#define SPI_CC13XX_CC26XX_POWER_SPI(n) \
do { \
/* Set Power dependencies & constraints */ \
@ -337,7 +337,7 @@ static const struct spi_driver_api spi_cc13xx_cc26xx_driver_api = {
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
&spi_cc13xx_cc26xx_driver_api)
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
#define SPI_CC13XX_CC26XX_INIT_PM_STATE \
do { \
get_dev_data(dev)->pm_state = DEVICE_PM_ACTIVE_STATE; \