summaryrefslogtreecommitdiff
path: root/app/drivers/zephyr
diff options
context:
space:
mode:
Diffstat (limited to 'app/drivers/zephyr')
-rw-r--r--app/drivers/zephyr/CMakeLists.txt3
-rw-r--r--app/drivers/zephyr/Kconfig8
-rw-r--r--app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml (renamed from app/drivers/zephyr/dts/bindings/gpio-kscan.yaml)2
-rw-r--r--app/drivers/zephyr/kscan_gpio_matrix.c (renamed from app/drivers/zephyr/kscan_gpio.c)6
4 files changed, 16 insertions, 3 deletions
diff --git a/app/drivers/zephyr/CMakeLists.txt b/app/drivers/zephyr/CMakeLists.txt
index 03a97c6..b40498f 100644
--- a/app/drivers/zephyr/CMakeLists.txt
+++ b/app/drivers/zephyr/CMakeLists.txt
@@ -4,6 +4,7 @@ if(CONFIG_ZMK_KSCAN_GPIO_DRIVER)
zephyr_library()
zephyr_library_sources(
- kscan_gpio.c
+ kscan_gpio_matrix.c
+ kscan_gpio_direct.c
)
endif()
diff --git a/app/drivers/zephyr/Kconfig b/app/drivers/zephyr/Kconfig
index 2dcb3a8..cd526e8 100644
--- a/app/drivers/zephyr/Kconfig
+++ b/app/drivers/zephyr/Kconfig
@@ -3,6 +3,14 @@ config ZMK_KSCAN_GPIO_DRIVER
default y
select GPIO
+if ZMK_KSCAN_GPIO_DRIVER
+
+config ZMK_KSCAN_GPIO_POLLING
+ bool "Poll for key event triggers instead of using interrupts"
+ default n
+
+endif
+
config ZMK_KSCAN_INIT_PRIORITY
int "Keyboard scan driver init priority"
default 40
diff --git a/app/drivers/zephyr/dts/bindings/gpio-kscan.yaml b/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml
index 748d3fa..5ebcbdd 100644
--- a/app/drivers/zephyr/dts/bindings/gpio-kscan.yaml
+++ b/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml
@@ -3,7 +3,7 @@
description: GPIO keyboard matrix controller
-compatible: "gpio-kscan"
+compatible: "zmk,kscan-gpio-matrix"
include: kscan.yaml
diff --git a/app/drivers/zephyr/kscan_gpio.c b/app/drivers/zephyr/kscan_gpio_matrix.c
index 76606d8..22217ef 100644
--- a/app/drivers/zephyr/kscan_gpio.c
+++ b/app/drivers/zephyr/kscan_gpio_matrix.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: MIT
*/
-#define DT_DRV_COMPAT gpio_kscan
+#define DT_DRV_COMPAT zmk_kscan_gpio_matrix
#include <device.h>
#include <drivers/kscan.h>
@@ -13,6 +13,8 @@
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
+#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
+
struct kscan_gpio_item_config
{
char *label;
@@ -254,3 +256,5 @@ static int kscan_gpio_config_interrupts(struct device **devices,
&gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
+
+#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */