mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-20 04:55:20 -05:00
feat(power): Update device power management Kconfig
This commit is contained in:
committed by
Pete Johanson
parent
f31ffd8acb
commit
2b9deb824b
@@ -267,7 +267,7 @@ choice SYS_PM_POLICY
|
|||||||
default PM_POLICY_APP
|
default PM_POLICY_APP
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config DEVICE_POWER_MANAGEMENT
|
config PM_DEVICE
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config ZMK_IDLE_SLEEP_TIMEOUT
|
config ZMK_IDLE_SLEEP_TIMEOUT
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct ext_power_generic_data {
|
|||||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||||
bool settings_init;
|
bool settings_init;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
uint32_t pm_state;
|
uint32_t pm_state;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@@ -143,7 +143,7 @@ static int ext_power_generic_init(const struct device *dev) {
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
#ifdef CONFIG_PM_DEVICE
|
||||||
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
data->pm_state = DEVICE_PM_ACTIVE_STATE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ static int ext_power_generic_init(const struct device *dev) {
|
|||||||
return 0;
|
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,
|
static int ext_power_generic_pm_control(const struct device *dev, uint32_t ctrl_command,
|
||||||
void *context, device_pm_cb cb, void *arg) {
|
void *context, device_pm_cb cb, void *arg) {
|
||||||
int rc;
|
int rc;
|
||||||
@@ -210,7 +210,7 @@ static int ext_power_generic_pm_control(const struct device *dev, uint32_t ctrl_
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
|
|
||||||
static const struct ext_power_generic_config config = {
|
static const struct ext_power_generic_config config = {
|
||||||
.label = DT_INST_GPIO_LABEL(0, control_gpios),
|
.label = DT_INST_GPIO_LABEL(0, control_gpios),
|
||||||
|
|||||||
Reference in New Issue
Block a user