From d100d89f4d1c6accb543eac2b7dcc3bfe3004d9d Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 28 Sep 2024 10:25:03 +0900 Subject: [PATCH 1/3] drivers: input: sbus: Remove unused `pinctrl.h` including This source does not reference any pinctrl functions. Removing the unused header. Signed-off-by: TOKITA Hiroshi --- drivers/input/input_sbus.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/input_sbus.c b/drivers/input/input_sbus.c index ef88f5fc677f01..b720e1427a0130 100644 --- a/drivers/input/input_sbus.c +++ b/drivers/input/input_sbus.c @@ -8,7 +8,6 @@ #define DT_DRV_COMPAT futaba_sbus #include -#include #include #include #include From d00023708bacf81f82c1452401dff2295310c53f Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 28 Sep 2024 10:30:35 +0900 Subject: [PATCH 2/3] drivers: input: sbus: Fix incorrect index reference of INPUT_SBUS_INIT The argument of INPUT_SBUS_INIT is named `n,` but there are some places where it references `id.` Correcting these. Signed-off-by: TOKITA Hiroshi --- drivers/input/input_sbus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/input_sbus.c b/drivers/input/input_sbus.c index b720e1427a0130..b9eb44e03e668c 100644 --- a/drivers/input/input_sbus.c +++ b/drivers/input/input_sbus.c @@ -355,7 +355,7 @@ static int input_sbus_init(const struct device *dev) #define INPUT_SBUS_INIT(n) \ \ - static const struct sbus_input_channel input_##id[] = { \ + static const struct sbus_input_channel input_##n[] = { \ DT_INST_FOREACH_CHILD(n, SBUS_INPUT_CHANNEL_INITIALIZER) \ }; \ DT_INST_FOREACH_CHILD(n, INPUT_CHANNEL_CHECK) \ @@ -363,9 +363,9 @@ static int input_sbus_init(const struct device *dev) static struct input_sbus_data sbus_data_##n; \ \ static const struct input_sbus_config sbus_cfg_##n = { \ - .channel_info = input_##id, \ + .channel_info = input_##n, \ .uart_dev = DEVICE_DT_GET(DT_INST_BUS(n)), \ - .num_channels = ARRAY_SIZE(input_##id), \ + .num_channels = ARRAY_SIZE(input_##n), \ .cb = sbus_uart_isr, \ }; \ \ From 6cd12d94c19a2297787f21d3e76ad3adc8f35569 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Fri, 27 Sep 2024 11:16:55 +0900 Subject: [PATCH 3/3] tests: drivers: build_all: input: Add config for futaba,sbus Add configuration to add `futaba,sbus` to build test. Signed-off-by: TOKITA Hiroshi --- tests/drivers/build_all/input/app.overlay | 20 ++++++++++++++++++++ tests/drivers/build_all/input/prj.conf | 2 ++ 2 files changed, 22 insertions(+) diff --git a/tests/drivers/build_all/input/app.overlay b/tests/drivers/build_all/input/app.overlay index 06e91145fa132a..80be92b765d25b 100644 --- a/tests/drivers/build_all/input/app.overlay +++ b/tests/drivers/build_all/input/app.overlay @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + / { test { #address-cells = <1>; @@ -162,6 +164,24 @@ double-tap-delay-ms = <0>; }; + test_uart: uart@55556666 { + compatible = "vnd,serial"; + reg = <0x55556666 0x1000>; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + sbus { + compatible = "futaba,sbus"; + right_stick_x { + channel = <1>; + type = ; + zephyr,code = ; + }; + }; + }; + i2c@1 { #address-cells = <1>; #size-cells = <0>; diff --git a/tests/drivers/build_all/input/prj.conf b/tests/drivers/build_all/input/prj.conf index d87817b31bd7c6..9f77aa3dfa3c5b 100644 --- a/tests/drivers/build_all/input/prj.conf +++ b/tests/drivers/build_all/input/prj.conf @@ -1,2 +1,4 @@ CONFIG_GPIO=y CONFIG_INPUT=y +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y