diff options
author | Ben Chen <ben.chen2@quanta.corp-partner.google.com> | 2021-06-04 13:51:24 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-10 10:15:10 +0000 |
commit | 3286ace9ad8ce336e0dfd6f4d87b54e5a49cd33e (patch) | |
tree | 8866b1e7fd9104ee2be7e9bef34aad4b294c2558 /board | |
parent | 91c208d9a37bfd39e987a706c704c1fa0a01a5a9 (diff) | |
download | chrome-ec-3286ace9ad8ce336e0dfd6f4d87b54e5a49cd33e.tar.gz |
magister: add KEYBOARD_VIVALDI
This CL implements vivald function row config for magister
keyboard by board version. Magister board version define >= 5,
and other was reserved.
Switch keyboard_mask_refresh values ROW value by keyboard ID pin.
BUG=b:184615827
BRANCH=dedede
TEST=verify keycode is correct in `evtest
Change-Id: Id680947b641a8a571d2ab9dd9981b33426eced9f
Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940330
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/magolor/board.c | 36 | ||||
-rw-r--r-- | board/magolor/gpio.inc | 1 |
2 files changed, 35 insertions, 2 deletions
diff --git a/board/magolor/board.c b/board/magolor/board.c index ed1d3e88db..8b2899f64f 100644 --- a/board/magolor/board.c +++ b/board/magolor/board.c @@ -111,6 +111,25 @@ static const struct ec_response_keybd_config magolor_keybd = { .capabilities = KEYBD_CAP_SCRNLOCK_KEY, }; +static const struct ec_response_keybd_config magister_keybd = { + /* Default Chromeos keyboard config */ + .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 */ + }, + /* No function keys, no numeric keypad, has screenlock key */ + .capabilities = KEYBD_CAP_SCRNLOCK_KEY, +}; + static const struct ec_response_keybd_config magpie_keybd = { .num_top_row_keys = 10, .action_keys = { @@ -128,13 +147,26 @@ static const struct ec_response_keybd_config magpie_keybd = { .capabilities = KEYBD_CAP_SCRNLOCK_KEY | KEYBD_CAP_NUMERIC_KEYPAD, }; +__override +uint8_t board_keyboard_row_refresh(void) +{ + if (gpio_get_level(GPIO_EC_VIVALDIKEYBOARD_ID)) + return 3; + else + return 2; +} + __override const struct ec_response_keybd_config *board_vivaldi_keybd_config(void) { if (get_cbi_fw_config_numeric_pad()) return &magpie_keybd; - else - return &magolor_keybd; + else { + if (system_get_board_version() >= 5) + return &magister_keybd; + else + return &magolor_keybd; + } } #endif diff --git a/board/magolor/gpio.inc b/board/magolor/gpio.inc index 4e47ae38b0..2dd2f70b34 100644 --- a/board/magolor/gpio.inc +++ b/board/magolor/gpio.inc @@ -64,6 +64,7 @@ GPIO(EN_SLP_Z, PIN(8, 3), GPIO_OUT_LOW) GPIO(EN_KB_BL, PIN(6, 0), GPIO_OUT_LOW) GPIO(EN_BL_OD, PIN(D, 3), GPIO_ODR_LOW) GPIO(ECH1_PACKET_MODE, PIN(7, 5), GPIO_OUT_LOW) +GPIO(EC_VIVALDIKEYBOARD_ID, PIN(4, 0), GPIO_INPUT + GPIO_PULL_DOWN) /* keyboard ID */ /* LED */ GPIO(LED_B_ODL, PIN(C, 2), GPIO_OUT_HIGH) /* PWM_CH_LED2_BLUE */ |