summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-10-07 14:26:33 +0800
committerCommit Bot <commit-bot@chromium.org>2021-10-11 19:11:21 +0000
commitea0cc2a17e63a07f0a4c97760292778916b2e41d (patch)
treebe5fd33c6747490e66e91bf2b05dfb3d57cc70b1
parentb5df2379298e5899be6e0f902116ee5657b01680 (diff)
downloadchrome-ec-ea0cc2a17e63a07f0a4c97760292778916b2e41d.tar.gz
anahera: Initialize the vivaldi keyboard
Anahera has 4 type keyboard layouts. 1. privacy screen + non-keyboard-backlight keyboard layout. 2. privacy screen + keyboard-backlight keyboard layout. 3. no-privacy screen + non-keyboard-backlight keyboard layout. 4. no-privacy screen + keyboard-backlight keyboard layout. BUG=b:199081586 BRANCH=none TEST=evtest, make sure the keycode is correct for each type. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I89c25f51bb3f4de0c87e4100494e879179c300ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211167 Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
-rw-r--r--board/anahera/keyboard.c59
1 files changed, 53 insertions, 6 deletions
diff --git a/board/anahera/keyboard.c b/board/anahera/keyboard.c
index 90506163d9..6d65e7b78d 100644
--- a/board/anahera/keyboard.c
+++ b/board/anahera/keyboard.c
@@ -25,7 +25,7 @@ __override struct keyboard_scan_config keyscan_config = {
},
};
-static const struct ec_response_keybd_config keybd1 = {
+static const struct ec_response_keybd_config keybd_wo_privacy_w_kblight = {
.num_top_row_keys = 13,
.action_keys = {
TK_BACK, /* T1 */
@@ -45,7 +45,27 @@ static const struct ec_response_keybd_config keybd1 = {
.capabilities = KEYBD_CAP_SCRNLOCK_KEY,
};
-static const struct ec_response_keybd_config keybd2 = {
+static const struct ec_response_keybd_config keybd_wo_privacy_wo_kblight = {
+ .num_top_row_keys = 13,
+ .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_PREV_TRACK, /* T8 */
+ TK_PLAY_PAUSE, /* T9 */
+ TK_MICMUTE, /* T10 */
+ TK_VOL_MUTE, /* T11 */
+ TK_VOL_DOWN, /* T12 */
+ TK_VOL_UP, /* T13 */
+ },
+ .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
+};
+
+static const struct ec_response_keybd_config keybd_w_privacy_w_kblight = {
.num_top_row_keys = 13,
.action_keys = {
TK_BACK, /* T1 */
@@ -65,11 +85,38 @@ static const struct ec_response_keybd_config keybd2 = {
.capabilities = KEYBD_CAP_SCRNLOCK_KEY,
};
+static const struct ec_response_keybd_config keybd_w_privacy_wo_kblight = {
+ .num_top_row_keys = 13,
+ .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_PRIVACY_SCRN_TOGGLE, /* T8 */
+ TK_PLAY_PAUSE, /* T9 */
+ TK_MICMUTE, /* T10 */
+ TK_VOL_MUTE, /* T11 */
+ TK_VOL_DOWN, /* T12 */
+ TK_VOL_UP, /* T13 */
+ },
+ .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
+};
+
__override const struct ec_response_keybd_config *
board_vivaldi_keybd_config(void)
{
- if (ec_cfg_has_eps() == 0)
- return &keybd1;
- else
- return &keybd2;
+ if (ec_cfg_has_eps()) {
+ if (ec_cfg_has_kblight())
+ return &keybd_w_privacy_w_kblight;
+ else
+ return &keybd_w_privacy_wo_kblight;
+ } else {
+ if (ec_cfg_has_kblight())
+ return &keybd_wo_privacy_w_kblight;
+ else
+ return &keybd_wo_privacy_wo_kblight;
+ }
}