summaryrefslogtreecommitdiff
path: root/zephyr/shim/chip
diff options
context:
space:
mode:
authorRuibin Chang <Ruibin.Chang@ite.com.tw>2021-03-23 15:20:18 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-18 15:11:54 +0000
commit70bd26d153cc179aa4f0badef36d04d6e53febb2 (patch)
tree51fc4b7c4e3277930c759a96ab5590bc32bfc035 /zephyr/shim/chip
parent9d6b2fb5d861750b5de933327fe555af29f95ea2 (diff)
downloadchrome-ec-70bd26d153cc179aa4f0badef36d04d6e53febb2.tar.gz
zephyr: add support for it8xxx2 cros_kb_row driver
Add support for it8xxx2 cros_kb_row driver. BUG=b:187192587 BRANCH=none TEST=on hayato, console cmd "ksstate" then press key: [115.097839 KB state: -- -- -- 02 -- -- 02 -- -- -- -- -- --] [116.462371 KB state: -- -- -- -- -- -- 02 -- -- -- -- -- --] [116.499633 KB state: -- -- -- -- -- -- -- -- -- -- -- -- --] Cq-Depend: chromium:2902165 Change-Id: I067b95bf2dfe4978e5370ce27382c67db100467b Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784322 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/chip')
-rw-r--r--zephyr/shim/chip/it8xxx2/CMakeLists.txt3
-rw-r--r--zephyr/shim/chip/it8xxx2/keyboard_raw.c26
2 files changed, 29 insertions, 0 deletions
diff --git a/zephyr/shim/chip/it8xxx2/CMakeLists.txt b/zephyr/shim/chip/it8xxx2/CMakeLists.txt
index 9641bce573..f611a38958 100644
--- a/zephyr/shim/chip/it8xxx2/CMakeLists.txt
+++ b/zephyr/shim/chip/it8xxx2/CMakeLists.txt
@@ -2,5 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+zephyr_library_include_directories(include)
+
zephyr_library_sources_ifdef(CONFIG_CROS_EC system.c)
zephyr_library_sources_ifdef(CONFIG_CROS_EC pinmux.c)
+zephyr_library_sources_ifdef(CONFIG_CROS_KB_RAW_ITE keyboard_raw.c)
diff --git a/zephyr/shim/chip/it8xxx2/keyboard_raw.c b/zephyr/shim/chip/it8xxx2/keyboard_raw.c
new file mode 100644
index 0000000000..0096798915
--- /dev/null
+++ b/zephyr/shim/chip/it8xxx2/keyboard_raw.c
@@ -0,0 +1,26 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Functions needed by keyboard scanner module for Chrome EC */
+
+#include <device.h>
+#include <logging/log.h>
+#include <soc.h>
+#include <zephyr.h>
+
+#include "drivers/cros_kb_raw.h"
+#include "keyboard_raw.h"
+
+/**
+ * Return true if the current value of the given input GPIO port is zero
+ */
+int keyboard_raw_is_input_low(int port, int id)
+{
+ /*
+ * TODO: implement for factory testing KSI and KSO pin as GPIO
+ * function.
+ */
+ return 0;
+}