summaryrefslogtreecommitdiff
path: root/app/drivers
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2021-03-22 10:31:55 -0400
committerPete Johanson <peter@peterjohanson.com>2021-07-17 17:04:25 -0400
commit2a69f31eb0d3af1290152afb1517142100b3316d (patch)
treeb2582b6deb36b59dbdfc82df7808da52475909fe /app/drivers
parentad981c3bbda0c2f047b6387c41d4b02dd30508e7 (diff)
refactor(core): Move away from deprecated DT API.
* Move to `DEVICE_DT_INST_DEFINE` everywhere. See: https://docs.zephyrproject.org/2.5.0/releases/release-notes-2.5.html#deprecated-in-this-release PR: https://github.com/zmkfirmware/zmk/pull/736
Diffstat (limited to 'app/drivers')
-rw-r--r--app/drivers/kscan/kscan_composite.c6
-rw-r--r--app/drivers/kscan/kscan_gpio_demux.c6
-rw-r--r--app/drivers/kscan/kscan_gpio_direct.c6
-rw-r--r--app/drivers/kscan/kscan_gpio_matrix.c6
-rw-r--r--app/drivers/kscan/kscan_mock.c6
-rw-r--r--app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c4
-rw-r--r--app/drivers/sensor/ec11/ec11.c6
7 files changed, 20 insertions, 20 deletions
diff --git a/app/drivers/kscan/kscan_composite.c b/app/drivers/kscan/kscan_composite.c
index d699cfa..2aeb047 100644
--- a/app/drivers/kscan/kscan_composite.c
+++ b/app/drivers/kscan/kscan_composite.c
@@ -108,6 +108,6 @@ static const struct kscan_composite_config kscan_composite_config = {};
static struct kscan_composite_data kscan_composite_data;
-DEVICE_AND_API_INIT(kscan_composite, DT_INST_LABEL(0), kscan_composite_init, &kscan_composite_data,
- &kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
- &mock_driver_api);
+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);
diff --git a/app/drivers/kscan/kscan_gpio_demux.c b/app/drivers/kscan/kscan_gpio_demux.c
index 06a5d27..3f22797 100644
--- a/app/drivers/kscan/kscan_gpio_demux.c
+++ b/app/drivers/kscan/kscan_gpio_demux.c
@@ -248,9 +248,9 @@ struct kscan_gpio_item_config {
.cols = {UTIL_LISTIFY(INST_DEMUX_GPIOS(n), _KSCAN_GPIO_OUTPUT_CFG_INIT, n)}, \
}; \
\
- DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
- &kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \
- CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n);
+ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
+ &kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
+ &gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
diff --git a/app/drivers/kscan/kscan_gpio_direct.c b/app/drivers/kscan/kscan_gpio_direct.c
index b68e4fc..d810881 100644
--- a/app/drivers/kscan/kscan_gpio_direct.c
+++ b/app/drivers/kscan/kscan_gpio_direct.c
@@ -238,9 +238,9 @@ 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_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
- &kscan_gpio_data_##n, &kscan_gpio_config_##n, POST_KERNEL, \
- CONFIG_ZMK_KSCAN_INIT_PRIORITY, &gpio_driver_api);
+ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
+ &kscan_gpio_config_##n, POST_KERNEL, CONFIG_ZMK_KSCAN_INIT_PRIORITY, \
+ &gpio_driver_api);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
diff --git a/app/drivers/kscan/kscan_gpio_matrix.c b/app/drivers/kscan/kscan_gpio_matrix.c
index 9af3171..6985953 100644
--- a/app/drivers/kscan/kscan_gpio_matrix.c
+++ b/app/drivers/kscan/kscan_gpio_matrix.c
@@ -298,9 +298,9 @@ static int kscan_gpio_config_interrupts(const struct device **devices,
.rows = {UTIL_LISTIFY(INST_MATRIX_ROWS(n), _KSCAN_GPIO_ROW_CFG_INIT, n)}, \
.cols = {UTIL_LISTIFY(INST_MATRIX_COLS(n), _KSCAN_GPIO_COL_CFG_INIT, n)}, \
}; \
- DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \
- &kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \
- CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n);
+ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
+ &kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
+ &gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
diff --git a/app/drivers/kscan/kscan_mock.c b/app/drivers/kscan/kscan_mock.c
index fc0c9c5..8d1545c 100644
--- a/app/drivers/kscan/kscan_mock.c
+++ b/app/drivers/kscan/kscan_mock.c
@@ -88,8 +88,8 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
static struct kscan_mock_data kscan_mock_data_##n; \
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_AND_API_INIT(kscan_mock_##n, DT_INST_LABEL(n), kscan_mock_init_##n, \
- &kscan_mock_data_##n, &kscan_mock_config_##n, APPLICATION, \
- CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
+ DEVICE_DT_INST_DEFINE(n, kscan_mock_init_##n, device_pm_control_nop, &kscan_mock_data_##n, \
+ &kscan_mock_config_##n, APPLICATION, \
+ CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(MOCK_INST_INIT)
diff --git a/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c b/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c
index c56dab6..9efd7fb 100644
--- a/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c
+++ b/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c
@@ -217,5 +217,5 @@ static const struct bvd_config bvd_cfg = {
.full_ohm = DT_INST_PROP(0, full_ohms),
};
-DEVICE_AND_API_INIT(bvd_dev, DT_INST_LABEL(0), &bvd_init, &bvd_data, &bvd_cfg, POST_KERNEL,
- CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);
+DEVICE_DT_INST_DEFINE(0, &bvd_init, device_pm_control_nop, &bvd_data, &bvd_cfg, POST_KERNEL,
+ CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);
diff --git a/app/drivers/sensor/ec11/ec11.c b/app/drivers/sensor/ec11/ec11.c
index 38a0578..14ccc91 100644
--- a/app/drivers/sensor/ec11/ec11.c
+++ b/app/drivers/sensor/ec11/ec11.c
@@ -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_AND_API_INIT(ec11_##n, DT_INST_LABEL(n), ec11_init, &ec11_data_##n, &ec11_cfg_##n, \
- POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
+ 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);
-DT_INST_FOREACH_STATUS_OKAY(EC11_INST) \ No newline at end of file
+DT_INST_FOREACH_STATUS_OKAY(EC11_INST)