summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2022-05-09 14:02:48 +1000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-09 05:04:09 +0000
commit0658d707632082e3888a5aee2e3d523af35c3c5a (patch)
treeb3a72949b7afdc388be776a894a574e014b03ae2
parent60c5d955940500bd5c9ea29ed8814c2977adc266 (diff)
downloadchrome-ec-0658d707632082e3888a5aee2e3d523af35c3c5a.tar.gz
nissa/nereid: adjust keyboard top row
Nereid board v0 and v1 have been built with keyboards that don't match the top row layout assumed by the "common" Nissa code. Split the keyboard configuration into per-variant files and update the settings for Nereid to reflect the actual hardware. BUG=b:231655516 TEST=`evtest` now reports keys matching the legends printed on the Nereid keyboard. BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Icd935f7da81eabc12bd4040119c1284d744651ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631852 Reviewed-by: Andrew McRae <amcrae@google.com>
-rw-r--r--zephyr/projects/nissa/CMakeLists.txt8
-rw-r--r--zephyr/projects/nissa/src/common.c24
-rw-r--r--zephyr/projects/nissa/src/nereid/keyboard.c29
-rw-r--r--zephyr/projects/nissa/src/nivviks/keyboard.c29
4 files changed, 65 insertions, 25 deletions
diff --git a/zephyr/projects/nissa/CMakeLists.txt b/zephyr/projects/nissa/CMakeLists.txt
index 1ce861d33c..da5d4deb73 100644
--- a/zephyr/projects/nissa/CMakeLists.txt
+++ b/zephyr/projects/nissa/CMakeLists.txt
@@ -14,13 +14,19 @@ zephyr_library_sources_ifdef(CONFIG_AP_PWRSEQ "src/board_power.c")
if(DEFINED CONFIG_BOARD_NIVVIKS)
project(nivviks)
+ zephyr_library_sources(
+ "src/nivviks/form_factor.c"
+ "src/nivviks/keyboard.c"
+ )
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN "src/nivviks/fan.c")
- zephyr_library_sources("src/nivviks/form_factor.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC "src/nivviks/usbc.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER "src/nivviks/charger.c")
endif()
if(DEFINED CONFIG_BOARD_NEREID)
project(nereid)
+ zephyr_library_sources(
+ "src/nereid/keyboard.c"
+ )
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC "src/nereid/usbc.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER "src/nereid/charger.c")
endif()
diff --git a/zephyr/projects/nissa/src/common.c b/zephyr/projects/nissa/src/common.c
index f0208efaeb..741702a7b2 100644
--- a/zephyr/projects/nissa/src/common.c
+++ b/zephyr/projects/nissa/src/common.c
@@ -12,7 +12,6 @@
#include "chipset.h"
#include "cros_cbi.h"
#include "hooks.h"
-#include "keyboard_scan.h"
#include "usb_mux.h"
#include "system.h"
@@ -157,26 +156,3 @@ enum nissa_sub_board_type nissa_get_sb_type(void)
}
return sb;
}
-
-static const struct ec_response_keybd_config nissa_kb = {
- .num_top_row_keys = 10,
- .action_keys = {
- TK_BACK, /* T1 */
- TK_REFRESH, /* T2 */
- TK_FULLSCREEN, /* T3 */
- TK_OVERVIEW, /* T4 */
- TK_SNAPSHOT, /* T5 */
- TK_BRIGHTNESS_DOWN, /* T6 */
- TK_BRIGHTNESS_UP, /* T7 */
- TK_VOL_MUTE, /* T8 */
- TK_VOL_DOWN, /* T9 */
- TK_VOL_UP, /* T10 */
- },
- .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
-};
-
-__override const struct ec_response_keybd_config
-*board_vivaldi_keybd_config(void)
-{
- return &nissa_kb;
-}
diff --git a/zephyr/projects/nissa/src/nereid/keyboard.c b/zephyr/projects/nissa/src/nereid/keyboard.c
new file mode 100644
index 0000000000..d0d1406307
--- /dev/null
+++ b/zephyr/projects/nissa/src/nereid/keyboard.c
@@ -0,0 +1,29 @@
+/* Copyright 2022 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.
+ */
+
+#include "ec_commands.h"
+
+static const struct ec_response_keybd_config nereid_kb_legacy = {
+ .num_top_row_keys = 10,
+ .action_keys = {
+ TK_BACK, /* T1 */
+ TK_FORWARD, /* T2 */
+ TK_REFRESH, /* T3 */
+ TK_FULLSCREEN, /* T4 */
+ TK_OVERVIEW, /* T5 */
+ TK_BRIGHTNESS_DOWN, /* T6 */
+ TK_BRIGHTNESS_UP, /* T7 */
+ TK_VOL_MUTE, /* T8 */
+ TK_VOL_DOWN, /* T9 */
+ TK_VOL_UP, /* T10 */
+ },
+ .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
+};
+
+__override const struct ec_response_keybd_config
+*board_vivaldi_keybd_config(void)
+{
+ return &nereid_kb_legacy;
+}
diff --git a/zephyr/projects/nissa/src/nivviks/keyboard.c b/zephyr/projects/nissa/src/nivviks/keyboard.c
new file mode 100644
index 0000000000..dc5c42e33a
--- /dev/null
+++ b/zephyr/projects/nissa/src/nivviks/keyboard.c
@@ -0,0 +1,29 @@
+/* Copyright 2022 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.
+ */
+
+#include "ec_commands.h"
+
+static const struct ec_response_keybd_config nivviks_kb = {
+ .num_top_row_keys = 10,
+ .action_keys = {
+ TK_BACK, /* T1 */
+ TK_REFRESH, /* T2 */
+ TK_FULLSCREEN, /* T3 */
+ TK_OVERVIEW, /* T4 */
+ TK_SNAPSHOT, /* T5 */
+ TK_BRIGHTNESS_DOWN, /* T6 */
+ TK_BRIGHTNESS_UP, /* T7 */
+ TK_VOL_MUTE, /* T8 */
+ TK_VOL_DOWN, /* T9 */
+ TK_VOL_UP, /* T10 */
+ },
+ .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
+};
+
+__override const struct ec_response_keybd_config
+*board_vivaldi_keybd_config(void)
+{
+ return &nivviks_kb;
+}