diff options
author | Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> | 2022-05-25 10:01:14 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-31 08:03:45 +0000 |
commit | 5dd57b42b0fb30e116e651a4a0733425956e87c0 (patch) | |
tree | 7aa03038d50600c8376a31faf0a632d3f9a4fb30 | |
parent | bc61f6d5fb8cb9c6facb664ecb10f9bcc18ef28e (diff) | |
download | chrome-ec-5dd57b42b0fb30e116e651a4a0733425956e87c0.tar.gz |
osiris: Initialize the vivaldi keyboard
Initialize the vivaldi keyboard.
BUG=b:220800586
BRANCH=none
TEST=check all top row keys working
Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com>
Change-Id: I29c6a517aff72affc4c902e6c66c2a0f66a841e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3663673
Reviewed-by: Kenny Pan <kennypan@google.com>
Commit-Queue: Kenny Pan <kennypan@google.com>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
-rw-r--r-- | board/osiris/board.h | 5 | ||||
-rw-r--r-- | board/osiris/keyboard.c | 47 |
2 files changed, 46 insertions, 6 deletions
diff --git a/board/osiris/board.h b/board/osiris/board.h index f98d8beba4..abddb9104c 100644 --- a/board/osiris/board.h +++ b/board/osiris/board.h @@ -10,11 +10,6 @@ #include "compile_time_macros.h" -/* - * Early osiris boards are not set up for vivaldi - */ -#undef CONFIG_KEYBOARD_VIVALDI - /* Baseboard features */ #include "baseboard.h" diff --git a/board/osiris/keyboard.c b/board/osiris/keyboard.c index d693b24148..cf74661173 100644 --- a/board/osiris/keyboard.c +++ b/board/osiris/keyboard.c @@ -5,6 +5,7 @@ #include "common.h" #include "console.h" +#include "ec_commands.h" #include "hooks.h" #include "keyboard_8042_sharedlib.h" #include "keyboard_scan.h" @@ -15,6 +16,50 @@ #define CPRINTF(format, args...) cprintf(CC_KEYBOARD, format, ## args) #define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ## args) +const struct key { + uint8_t row; + uint8_t col; +} vivaldi_keys[] = { + {.row = 4, .col = 2}, /* T1 */ + {.row = 3, .col = 2}, /* T2 */ + {.row = 2, .col = 2}, /* T3 */ + {.row = 1, .col = 2}, /* T4 */ + {.row = 4, .col = 4}, /* T5 */ + {.row = 3, .col = 4}, /* T6 */ + {.row = 2, .col = 4}, /* T7 */ + {.row = 2, .col = 9}, /* T8 */ + {.row = 1, .col = 9}, /* T9 */ + {.row = 1, .col = 4}, /* T10 */ + {.row = 0, .col = 4}, /* T11 */ + {.row = 1, .col = 5}, /* T12 */ + {.row = 3, .col = 5}, /* T13 */ + {.row = 2, .col = 1}, /* T14 */ + {.row = 0, .col = 1}, /* T15 */ +}; +BUILD_ASSERT(ARRAY_SIZE(vivaldi_keys) == MAX_TOP_ROW_KEYS); + +static const struct ec_response_keybd_config osiris_vivaldi_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 &osiris_vivaldi_kb; +} extern struct rgbkbd_drv is31fl3733b_drv; @@ -216,4 +261,4 @@ static void keyboard_matrix_init(void) register_scancode_set2((uint16_t *) &scancode_set2_rgb, sizeof(scancode_set2_rgb)); } -DECLARE_HOOK(HOOK_INIT, keyboard_matrix_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, keyboard_matrix_init, HOOK_PRIO_PRE_DEFAULT); |