diff options
author | Rajat Jain <rajatja@google.com> | 2020-04-01 18:01:58 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-23 04:10:57 +0000 |
commit | f99e7c124fc064416cdb202463287ea767457244 (patch) | |
tree | c02e609865ff03165a5b987621c391bdcfbd4bf3 /board/jinlon | |
parent | 00589b7ec50c2faa4aaa3e0d3310777b10c1ffa2 (diff) | |
download | chrome-ec-f99e7c124fc064416cdb202463287ea767457244.tar.gz |
Jinlon: Initialize keyboard
Initialize the Jinlon keyboard configuration.
BUG=b:146501925
TEST=TEst the top row on Jinlon
BRANCH=firmware-hatch-12672.B
Signed-off-by: Rajat Jain <rajatja@google.com>
Change-Id: Ib8ffdbd783126aa097c097dfc968c9d226ac042b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135567
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/jinlon')
-rw-r--r-- | board/jinlon/board.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/board/jinlon/board.c b/board/jinlon/board.c index 56082fde2c..d1b1fc93bc 100644 --- a/board/jinlon/board.c +++ b/board/jinlon/board.c @@ -25,6 +25,7 @@ #include "gpio.h" #include "hooks.h" #include "host_command.h" +#include "keyboard_8042.h" #include "lid_switch.h" #include "power.h" #include "power_button.h" @@ -391,6 +392,66 @@ static void board_update_sensor_config_from_sku(void) gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L); } +static const struct ec_response_keybd_config keybd1 = { + .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_KBD_BKLIGHT_DOWN, /* T8 */ + TK_KBD_BKLIGHT_UP, /* T9 */ + TK_PLAY_PAUSE, /* 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 keybd2 = { + .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_KBD_BKLIGHT_DOWN, /* T9 */ + TK_KBD_BKLIGHT_UP, /* 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) +{ + /* + * Future boards should use fw_config instead of SKU ID + * to make such decisions. + */ + switch (get_board_sku()) { + case 1: + case 21: + return &keybd1; + case 2: + case 22: + return &keybd2; + default: + cprints(CC_KEYBOARD, "Error! Unknown VIVLADI keyboard layout!"); + } + return NULL; +} + static void board_init(void) { /* Initialize Fans */ |