summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/keyscan.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-16 11:33:01 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-16 18:22:23 +0000
commit86853653efb5acf2bb84ca220d9e309a4745d3a0 (patch)
tree480561d0138f18d80a9ec0c3905a7666249ec9d0 /zephyr/shim/src/keyscan.c
parent4115c899e6705fb589c4b2e1c78e18eb9b50c11e (diff)
downloadchrome-ec-86853653efb5acf2bb84ca220d9e309a4745d3a0.tar.gz
zephyr: keyboard: split dt based keymap to its own config
Add a separate config for instantiating keyscan_config based on the devicetree, decoupling it from the main PLATFORM_EC_KEYBOARD option. The new one is selected automatically based on devicetree and the driver does not need a #if guard anymore. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8e6654c7ebca8553b1f930b87c320af50895048f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4030886 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src/keyscan.c')
-rw-r--r--zephyr/shim/src/keyscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zephyr/shim/src/keyscan.c b/zephyr/shim/src/keyscan.c
index 9bf2a5ec1f..46bb5fcc7f 100644
--- a/zephyr/shim/src/keyscan.c
+++ b/zephyr/shim/src/keyscan.c
@@ -13,7 +13,8 @@
#include <soc.h>
-#if DT_NODE_EXISTS(DT_INST(0, cros_ec_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.
@@ -33,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