summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/src/keyscan.c')
-rw-r--r--zephyr/shim/src/keyscan.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/zephyr/shim/src/keyscan.c b/zephyr/shim/src/keyscan.c
index 514885379b..46bb5fcc7f 100644
--- a/zephyr/shim/src/keyscan.c
+++ b/zephyr/shim/src/keyscan.c
@@ -3,15 +3,18 @@
* found in the LICENSE file.
*/
-#define DT_DRV_COMPAT cros_keyscan
+#define DT_DRV_COMPAT cros_ec_keyscan
+
+#include "keyboard_scan.h"
#include <assert.h>
+
#include <zephyr/kernel.h>
-#include <soc.h>
-#include "keyboard_scan.h"
+#include <soc.h>
-#if DT_NODE_EXISTS(DT_INST(0, cros_keyscan))
+BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1,
+ "Exactly one instance of cros-ec,keyscan should be defined.");
/* The keyboard matrix should have at least enough columns for the
* standard keyboard with no keypad.
@@ -31,4 +34,3 @@ __override struct keyboard_scan_config keyscan_config = {
.poll_timeout_us = DT_INST_PROP(0, poll_timeout),
.actual_key_mask = DT_INST_PROP(0, actual_key_mask),
};
-#endif