Skip to content

Commit

Permalink
feat(power): Update device power management Kconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
think4tomorrow committed Aug 3, 2021
1 parent 04a8fac commit 7f5d0c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ choice SYS_PM_POLICY
default PM_POLICY_APP
endchoice

config DEVICE_POWER_MANAGEMENT
config PM_DEVICE
default y

config ZMK_IDLE_SLEEP_TIMEOUT
Expand Down
8 changes: 4 additions & 4 deletions app/src/ext_power_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct ext_power_generic_data {
#if IS_ENABLED(CONFIG_SETTINGS)
bool settings_init;
#endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
uint32_t pm_state;
#endif
};
Expand Down Expand Up @@ -143,7 +143,7 @@ static int ext_power_generic_init(const struct device *dev) {
return -EIO;
}

#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
data->pm_state = DEVICE_PM_ACTIVE_STATE;
#endif

Expand Down Expand Up @@ -179,7 +179,7 @@ static int ext_power_generic_init(const struct device *dev) {
return 0;
}

#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
#ifdef CONFIG_PM_DEVICE
static int ext_power_generic_pm_control(const struct device *dev, uint32_t ctrl_command,
void *context, device_pm_cb cb, void *arg) {
int rc;
Expand Down Expand Up @@ -210,7 +210,7 @@ static int ext_power_generic_pm_control(const struct device *dev, uint32_t ctrl_

return rc;
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* CONFIG_PM_DEVICE */

static const struct ext_power_generic_config config = {
.label = DT_INST_GPIO_LABEL(0, control_gpios),
Expand Down

0 comments on commit 7f5d0c2

Please sign in to comment.