Browse Source

refactor: Move away from deprecated PM callback.

xmkb
Peter Johanson 3 years ago committed by Pete Johanson
parent
commit
4df83a9c0d
  1. 2
      app/drivers/display/il0323.c
  2. 2
      app/drivers/gpio/gpio_mcp23017.c
  3. 5
      app/drivers/kscan/kscan_composite.c
  4. 2
      app/drivers/kscan/kscan_gpio_demux.c
  5. 2
      app/drivers/kscan/kscan_gpio_direct.c
  6. 4
      app/drivers/kscan/kscan_gpio_matrix.c
  7. 2
      app/drivers/sensor/battery/battery_nrf_vddh.c
  8. 2
      app/drivers/sensor/battery/battery_voltage_divider.c
  9. 4
      app/drivers/sensor/ec11/ec11.c
  10. 2
      app/src/behaviors/behavior_bt.c
  11. 7
      app/src/behaviors/behavior_caps_word.c
  12. 2
      app/src/behaviors/behavior_ext_power.c
  13. 4
      app/src/behaviors/behavior_hold_tap.c
  14. 5
      app/src/behaviors/behavior_key_press.c
  15. 7
      app/src/behaviors/behavior_mod_morph.c
  16. 5
      app/src/behaviors/behavior_momentary_layer.c
  17. 2
      app/src/behaviors/behavior_none.c
  18. 2
      app/src/behaviors/behavior_outputs.c
  19. 6
      app/src/behaviors/behavior_reset.c
  20. 5
      app/src/behaviors/behavior_rgb_underglow.c
  21. 4
      app/src/behaviors/behavior_sensor_rotate_key_press.c
  22. 4
      app/src/behaviors/behavior_sticky_key.c
  23. 2
      app/src/behaviors/behavior_to_layer.c
  24. 5
      app/src/behaviors/behavior_toggle_layer.c
  25. 2
      app/src/behaviors/behavior_transparent.c

2
app/drivers/display/il0323.c

@ -428,5 +428,5 @@ static struct display_driver_api il0323_driver_api = { @@ -428,5 +428,5 @@ static struct display_driver_api il0323_driver_api = {
.set_orientation = il0323_set_orientation,
};
DEVICE_DT_INST_DEFINE(0, il0323_init, device_pm_control_nop, &il0323_driver, NULL, POST_KERNEL,
DEVICE_DT_INST_DEFINE(0, il0323_init, NULL, &il0323_driver, NULL, POST_KERNEL,
CONFIG_APPLICATION_INIT_PRIORITY, &il0323_driver_api);

2
app/drivers/gpio/gpio_mcp23017.c

@ -325,7 +325,7 @@ static int mcp23017_init(const struct device *dev) { @@ -325,7 +325,7 @@ static int mcp23017_init(const struct device *dev) {
}; \
\
/* This has to init after SPI master */ \
DEVICE_DT_INST_DEFINE(inst, mcp23017_init, device_pm_control_nop, &mcp23017_##inst##_drvdata, \
DEVICE_DT_INST_DEFINE(inst, mcp23017_init, NULL, &mcp23017_##inst##_drvdata, \
&mcp23017_##inst##_config, POST_KERNEL, \
CONFIG_GPIO_MCP23017_INIT_PRIORITY, &api_table);

5
app/drivers/kscan/kscan_composite.c

@ -118,6 +118,5 @@ static const struct kscan_composite_config kscan_composite_config = {}; @@ -118,6 +118,5 @@ static const struct kscan_composite_config kscan_composite_config = {};
static struct kscan_composite_data kscan_composite_data;
DEVICE_DT_INST_DEFINE(0, kscan_composite_init, device_pm_control_nop, &kscan_composite_data,
&kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&mock_driver_api);
DEVICE_DT_INST_DEFINE(0, kscan_composite_init, NULL, &kscan_composite_data, &kscan_composite_config,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api);

2
app/drivers/kscan/kscan_gpio_demux.c

@ -246,7 +246,7 @@ struct kscan_gpio_item_config { @@ -246,7 +246,7 @@ struct kscan_gpio_item_config {
.cols = {UTIL_LISTIFY(INST_DEMUX_GPIOS(n), _KSCAN_GPIO_OUTPUT_CFG_INIT, n)}, \
}; \
\
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, NULL, &kscan_gpio_data_##n, \
&kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
&gpio_driver_api_##n);

2
app/drivers/kscan/kscan_gpio_direct.c

@ -237,7 +237,7 @@ static const struct kscan_driver_api gpio_driver_api = { @@ -237,7 +237,7 @@ static const struct kscan_driver_api gpio_driver_api = {
.inputs = {UTIL_LISTIFY(INST_INPUT_LEN(n), KSCAN_DIRECT_INPUT_ITEM, n)}, \
.num_of_inputs = INST_INPUT_LEN(n), \
.debounce_period = DT_INST_PROP(n, debounce_period)}; \
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, NULL, &kscan_gpio_data_##n, \
&kscan_gpio_config_##n, POST_KERNEL, CONFIG_ZMK_KSCAN_INIT_PRIORITY, \
&gpio_driver_api);

4
app/drivers/kscan/kscan_gpio_matrix.c

@ -477,8 +477,8 @@ static const struct kscan_driver_api kscan_matrix_api = { @@ -477,8 +477,8 @@ static const struct kscan_driver_api kscan_matrix_api = {
.diode_direction = INST_DIODE_DIR(index), \
}; \
\
DEVICE_DT_INST_DEFINE(index, &kscan_matrix_init, device_pm_control_nop, \
&kscan_matrix_data_##index, &kscan_matrix_config_##index, APPLICATION, \
DEVICE_DT_INST_DEFINE(index, &kscan_matrix_init, NULL, &kscan_matrix_data_##index, \
&kscan_matrix_config_##index, APPLICATION, \
CONFIG_APPLICATION_INIT_PRIORITY, &kscan_matrix_api);
DT_INST_FOREACH_STATUS_OKAY(KSCAN_MATRIX_INIT);

2
app/drivers/sensor/battery/battery_nrf_vddh.c

@ -112,5 +112,5 @@ static int vddh_init(const struct device *dev) { @@ -112,5 +112,5 @@ static int vddh_init(const struct device *dev) {
static struct vddh_data vddh_data;
DEVICE_DT_INST_DEFINE(0, &vddh_init, device_pm_control_nop, &vddh_data, NULL, POST_KERNEL,
DEVICE_DT_INST_DEFINE(0, &vddh_init, NULL, &vddh_data, NULL, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &vddh_api);

2
app/drivers/sensor/battery/battery_voltage_divider.c

@ -186,5 +186,5 @@ static const struct bvd_config bvd_cfg = { @@ -186,5 +186,5 @@ static const struct bvd_config bvd_cfg = {
.full_ohm = DT_INST_PROP(0, full_ohms),
};
DEVICE_DT_INST_DEFINE(0, &bvd_init, device_pm_control_nop, &bvd_data, &bvd_cfg, POST_KERNEL,
DEVICE_DT_INST_DEFINE(0, &bvd_init, NULL, &bvd_data, &bvd_cfg, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);

4
app/drivers/sensor/ec11/ec11.c

@ -142,7 +142,7 @@ int ec11_init(const struct device *dev) { @@ -142,7 +142,7 @@ int ec11_init(const struct device *dev) {
.b_flags = DT_INST_GPIO_FLAGS(n, b_gpios), \
COND_CODE_0(DT_INST_NODE_HAS_PROP(n, resolution), (1), (DT_INST_PROP(n, resolution))), \
}; \
DEVICE_DT_INST_DEFINE(n, ec11_init, device_pm_control_nop, &ec11_data_##n, &ec11_cfg_##n, \
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
DEVICE_DT_INST_DEFINE(n, ec11_init, NULL, &ec11_data_##n, &ec11_cfg_##n, POST_KERNEL, \
CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
DT_INST_FOREACH_STATUS_OKAY(EC11_INST)

2
app/src/behaviors/behavior_bt.c

@ -49,7 +49,7 @@ static const struct behavior_driver_api behavior_bt_driver_api = { @@ -49,7 +49,7 @@ static const struct behavior_driver_api behavior_bt_driver_api = {
.binding_released = on_keymap_binding_released,
};
DEVICE_DT_INST_DEFINE(0, behavior_bt_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_bt_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_bt_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

7
app/src/behaviors/behavior_caps_word.c

@ -176,10 +176,9 @@ static int behavior_caps_word_init(const struct device *dev) { @@ -176,10 +176,9 @@ static int behavior_caps_word_init(const struct device *dev) {
.continuations = {UTIL_LISTIFY(DT_INST_PROP_LEN(n, continue_list), BREAK_ITEM, n)}, \
.continuations_count = DT_INST_PROP_LEN(n, continue_list), \
}; \
DEVICE_DT_INST_DEFINE(n, behavior_caps_word_init, device_pm_control_nop, \
&behavior_caps_word_data_##n, &behavior_caps_word_config_##n, \
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_caps_word_driver_api);
DEVICE_DT_INST_DEFINE(n, behavior_caps_word_init, NULL, &behavior_caps_word_data_##n, \
&behavior_caps_word_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_caps_word_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

2
app/src/behaviors/behavior_ext_power.c

@ -74,7 +74,7 @@ static const struct behavior_driver_api behavior_ext_power_driver_api = { @@ -74,7 +74,7 @@ static const struct behavior_driver_api behavior_ext_power_driver_api = {
.locality = BEHAVIOR_LOCALITY_GLOBAL,
};
DEVICE_DT_INST_DEFINE(0, behavior_ext_power_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_ext_power_init, NULL, NULL, NULL, APPLICATION,
CONFIG_APPLICATION_INIT_PRIORITY, &behavior_ext_power_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

4
app/src/behaviors/behavior_hold_tap.c

@ -688,8 +688,8 @@ static struct behavior_hold_tap_data behavior_hold_tap_data; @@ -688,8 +688,8 @@ static struct behavior_hold_tap_data behavior_hold_tap_data;
.hold_trigger_key_positions = DT_INST_PROP(n, hold_trigger_key_positions), \
.hold_trigger_key_positions_len = DT_INST_PROP_LEN(n, hold_trigger_key_positions), \
}; \
DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, device_pm_control_nop, \
&behavior_hold_tap_data, &behavior_hold_tap_config_##n, APPLICATION, \
DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, NULL, &behavior_hold_tap_data, \
&behavior_hold_tap_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

5
app/src/behaviors/behavior_key_press.c

@ -36,8 +36,7 @@ static const struct behavior_driver_api behavior_key_press_driver_api = { @@ -36,8 +36,7 @@ static const struct behavior_driver_api behavior_key_press_driver_api = {
.binding_pressed = on_keymap_binding_pressed, .binding_released = on_keymap_binding_released};
#define KP_INST(n) \
DEVICE_DT_INST_DEFINE(n, behavior_key_press_init, device_pm_control_nop, NULL, NULL, \
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_key_press_driver_api);
DEVICE_DT_INST_DEFINE(n, behavior_key_press_init, NULL, NULL, NULL, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_key_press_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

7
app/src/behaviors/behavior_mod_morph.c

@ -90,10 +90,9 @@ static int behavior_mod_morph_init(const struct device *dev) { return 0; } @@ -90,10 +90,9 @@ static int behavior_mod_morph_init(const struct device *dev) { return 0; }
.mods = DT_INST_PROP(n, mods), \
}; \
static struct behavior_mod_morph_data behavior_mod_morph_data_##n = {}; \
DEVICE_DT_INST_DEFINE(n, behavior_mod_morph_init, device_pm_control_nop, \
&behavior_mod_morph_data_##n, &behavior_mod_morph_config_##n, \
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_mod_morph_driver_api);
DEVICE_DT_INST_DEFINE(n, behavior_mod_morph_init, NULL, &behavior_mod_morph_data_##n, \
&behavior_mod_morph_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mod_morph_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

5
app/src/behaviors/behavior_momentary_layer.c

@ -39,6 +39,5 @@ static const struct behavior_mo_config behavior_mo_config = {}; @@ -39,6 +39,5 @@ static const struct behavior_mo_config behavior_mo_config = {};
static struct behavior_mo_data behavior_mo_data;
DEVICE_DT_INST_DEFINE(0, behavior_mo_init, device_pm_control_nop, &behavior_mo_data,
&behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_mo_driver_api);
DEVICE_DT_INST_DEFINE(0, behavior_mo_init, NULL, &behavior_mo_data, &behavior_mo_config,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mo_driver_api);

2
app/src/behaviors/behavior_none.c

@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_none_driver_api = { @@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_none_driver_api = {
.binding_released = on_keymap_binding_released,
};
DEVICE_DT_INST_DEFINE(0, behavior_none_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_none_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_none_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

2
app/src/behaviors/behavior_outputs.c

@ -42,7 +42,7 @@ static const struct behavior_driver_api behavior_outputs_driver_api = { @@ -42,7 +42,7 @@ static const struct behavior_driver_api behavior_outputs_driver_api = {
.binding_pressed = on_keymap_binding_pressed,
};
DEVICE_DT_INST_DEFINE(0, behavior_out_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_out_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_outputs_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

6
app/src/behaviors/behavior_reset.c

@ -42,9 +42,9 @@ static const struct behavior_driver_api behavior_reset_driver_api = { @@ -42,9 +42,9 @@ static const struct behavior_driver_api behavior_reset_driver_api = {
#define RST_INST(n) \
static const struct behavior_reset_config behavior_reset_config_##n = { \
.type = DT_INST_PROP(n, type)}; \
DEVICE_DT_INST_DEFINE(n, behavior_reset_init, device_pm_control_nop, NULL, \
&behavior_reset_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_reset_driver_api);
DEVICE_DT_INST_DEFINE(n, behavior_reset_init, NULL, NULL, &behavior_reset_config_##n, \
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_reset_driver_api);
DT_INST_FOREACH_STATUS_OKAY(RST_INST)

5
app/src/behaviors/behavior_rgb_underglow.c

@ -149,8 +149,7 @@ static const struct behavior_driver_api behavior_rgb_underglow_driver_api = { @@ -149,8 +149,7 @@ static const struct behavior_driver_api behavior_rgb_underglow_driver_api = {
.locality = BEHAVIOR_LOCALITY_GLOBAL,
};
DEVICE_DT_INST_DEFINE(0, behavior_rgb_underglow_init, device_pm_control_nop, NULL, NULL,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_rgb_underglow_driver_api);
DEVICE_DT_INST_DEFINE(0, behavior_rgb_underglow_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_rgb_underglow_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

4
app/src/behaviors/behavior_sensor_rotate_key_press.c

@ -59,8 +59,8 @@ static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_ @@ -59,8 +59,8 @@ static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_
.sensor_binding_triggered = on_sensor_binding_triggered};
#define KP_INST(n) \
DEVICE_DT_INST_DEFINE(n, behavior_sensor_rotate_key_press_init, device_pm_control_nop, NULL, \
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
DEVICE_DT_INST_DEFINE(n, behavior_sensor_rotate_key_press_init, NULL, NULL, NULL, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_sensor_rotate_key_press_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

4
app/src/behaviors/behavior_sticky_key.c

@ -287,8 +287,8 @@ static struct behavior_sticky_key_data behavior_sticky_key_data; @@ -287,8 +287,8 @@ static struct behavior_sticky_key_data behavior_sticky_key_data;
.ignore_modifiers = DT_INST_PROP(n, ignore_modifiers), \
.quick_release = DT_INST_PROP(n, quick_release), \
}; \
DEVICE_DT_INST_DEFINE(n, behavior_sticky_key_init, device_pm_control_nop, \
&behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \
DEVICE_DT_INST_DEFINE(n, behavior_sticky_key_init, NULL, &behavior_sticky_key_data, \
&behavior_sticky_key_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST)

2
app/src/behaviors/behavior_to_layer.c

@ -37,7 +37,7 @@ static const struct behavior_driver_api behavior_to_driver_api = { @@ -37,7 +37,7 @@ static const struct behavior_driver_api behavior_to_driver_api = {
.binding_released = to_keymap_binding_released,
};
DEVICE_DT_INST_DEFINE(0, behavior_to_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_to_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_to_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

5
app/src/behaviors/behavior_toggle_layer.c

@ -43,8 +43,7 @@ static const struct behavior_tog_config behavior_tog_config = {}; @@ -43,8 +43,7 @@ static const struct behavior_tog_config behavior_tog_config = {};
static struct behavior_tog_data behavior_tog_data;
DEVICE_DT_INST_DEFINE(0, behavior_tog_init, device_pm_control_nop, &behavior_tog_data,
&behavior_tog_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_tog_driver_api);
DEVICE_DT_INST_DEFINE(0, behavior_tog_init, NULL, &behavior_tog_data, &behavior_tog_config,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_tog_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

2
app/src/behaviors/behavior_transparent.c

@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_transparent_driver_api = { @@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_transparent_driver_api = {
.binding_released = on_keymap_binding_released,
};
DEVICE_DT_INST_DEFINE(0, behavior_transparent_init, device_pm_control_nop, NULL, NULL, APPLICATION,
DEVICE_DT_INST_DEFINE(0, behavior_transparent_init, NULL, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_transparent_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

Loading…
Cancel
Save