fix(pm): Fix deep sleep with sideband behaviors.

* Properly implement the PM hook needed for sideband behavior
  kscan device to have wakeup source enabled on it.
This commit is contained in:
Peter Johanson
2024-01-03 11:11:24 -08:00
committed by Pete Johanson
parent 09111f1cf3
commit 4198fac90f
3 changed files with 31 additions and 5 deletions

View File

@@ -74,13 +74,14 @@ int zmk_kscan_init(const struct device *dev) {
k_work_init(&msg_processor.work, zmk_kscan_process_msgq);
kscan_config(dev, zmk_kscan_callback);
kscan_enable_callback(dev);
#if IS_ENABLED(CONFIG_PM_DEVICE)
if (pm_device_wakeup_is_capable(dev)) {
pm_device_wakeup_enable(dev, true);
}
#endif // IS_ENABLED(CONFIG_PM_DEVICE)
kscan_config(dev, zmk_kscan_callback);
kscan_enable_callback(dev);
return 0;
}