refactor(drivers): Use proper init stage/priority.
* Avoid APPLICATION stage and use the proper earlier stage for kscan drivers.
This commit is contained in:
parent
690bc1bb44
commit
c28ef1b61e
6 changed files with 6 additions and 12 deletions
|
@ -89,10 +89,4 @@ config ZMK_KSCAN_DEBOUNCE_RELEASE_MS
|
|||
|
||||
endif
|
||||
|
||||
# config ZMK_KSCAN_INIT_PRIORITY
|
||||
# int "Keyboard scan driver init priority"
|
||||
# default 40
|
||||
# help
|
||||
# Keyboard scan device driver initialization priority.
|
||||
|
||||
endif # KSCAN
|
||||
|
|
|
@ -109,4 +109,4 @@ 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, NULL, &kscan_composite_data, &kscan_composite_config,
|
||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api);
|
||||
POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, &mock_driver_api);
|
||||
|
|
|
@ -201,7 +201,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|||
}; \
|
||||
\
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, NULL, &kscan_gpio_data_##n, \
|
||||
&kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
|
||||
&kscan_gpio_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||
&gpio_driver_api_##n);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
|
||||
|
|
|
@ -354,7 +354,7 @@ static const struct kscan_driver_api kscan_direct_api = {
|
|||
}; \
|
||||
\
|
||||
DEVICE_DT_INST_DEFINE(n, &kscan_direct_init, NULL, &kscan_direct_data_##n, \
|
||||
&kscan_direct_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
|
||||
&kscan_direct_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||
&kscan_direct_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KSCAN_DIRECT_INIT);
|
||||
|
|
|
@ -465,7 +465,7 @@ static const struct kscan_driver_api kscan_matrix_api = {
|
|||
}; \
|
||||
\
|
||||
DEVICE_DT_INST_DEFINE(n, &kscan_matrix_init, NULL, &kscan_matrix_data_##n, \
|
||||
&kscan_matrix_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
|
||||
&kscan_matrix_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||
&kscan_matrix_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(KSCAN_MATRIX_INIT);
|
||||
|
|
|
@ -89,7 +89,7 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
|
|||
static const struct kscan_mock_config_##n kscan_mock_config_##n = { \
|
||||
.events = DT_INST_PROP(n, events), .exit_after = DT_INST_PROP(n, exit_after)}; \
|
||||
DEVICE_DT_INST_DEFINE(n, kscan_mock_init_##n, NULL, &kscan_mock_data_##n, \
|
||||
&kscan_mock_config_##n, APPLICATION, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
|
||||
&kscan_mock_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||
&mock_driver_api_##n);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(MOCK_INST_INIT)
|
||||
|
|
Loading…
Add table
Reference in a new issue