diff options
author | Kirk Wang <kirk_wang@pegatron.corp-partner.google.com> | 2021-05-17 15:40:49 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-18 03:20:16 +0000 |
commit | fc70295830a2fb0938858ddd06fe455eb3172484 (patch) | |
tree | 46a8b8e56a67243227fa787e3326e39e7baafec1 | |
parent | 0602debe983036d8d7285c207b2b5cd0339eb2a8 (diff) | |
download | chrome-ec-fc70295830a2fb0938858ddd06fe455eb3172484.tar.gz |
pirika: Implement keyboard matrix function
1. Base on keyboard spec, modify the keyboard related setting.
BUG=b:187343638
BRANCH=none
TEST=make BOARD=pirika and pirette
1. Verify keyboard function behavior.
Signed-off-by: Kirk Wang <kirk_wang@pegatron.corp-partner.google.com>
Change-Id: I865b7e913c8901f5f02e974b3224d6d4c29891eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2900118
Reviewed-by: Alex1 Kao <alex1_kao@pegatron.corp-partner.google.com>
Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
-rw-r--r-- | board/pirika/board.c | 44 | ||||
-rw-r--r-- | board/pirika/board.h | 2 |
2 files changed, 45 insertions, 1 deletions
diff --git a/board/pirika/board.c b/board/pirika/board.c index bc3e92cc09..8bfcbbbf0d 100644 --- a/board/pirika/board.c +++ b/board/pirika/board.c @@ -48,6 +48,50 @@ static void check_c0_line(void); DECLARE_DEFERRED(check_c0_line); +/* Use default keyboard scan config, because board didn't supply one */ +struct keyboard_scan_config keyscan_config = { + /* + * CONFIG_KEYBOARD_COL2_INVERTED is defined for passing the column 2 + * to H1 which inverts the signal. The signal passing through H1 + * adds more delay. Need a larger delay value. Otherwise, pressing + * Refresh key will also trigger T key, which is in the next scanning + * column line. See http://b/156007029. + */ + .output_settle_us = 80, + .debounce_down_us = 9 * MSEC, + .debounce_up_us = 30 * MSEC, + .scan_period_us = 3 * MSEC, + .min_post_scan_delay_us = 1000, + .poll_timeout_us = 100 * MSEC, + .actual_key_mask = { + 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, + 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xca /* full set */ + }, +}; + +static const struct ec_response_keybd_config pirika_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 &pirika_kb; +} + static void notify_c0_chips(void) { schedule_deferred_pd_interrupt(0); diff --git a/board/pirika/board.h b/board/pirika/board.h index b4a0dbe0df..cf5185ca91 100644 --- a/board/pirika/board.h +++ b/board/pirika/board.h @@ -90,7 +90,7 @@ /* Keyboard */ #define CONFIG_KEYBOARD_VIVALDI #define CONFIG_KEYBOARD_REFRESH_ROW3 -#define CONFIG_KEYBOARD_KEYPAD +#define CONFIG_KEYBOARD_BOARD_CONFIG #ifndef __ASSEMBLER__ |