diff options
author | Zick Wei <zick.wei@quanta.corp-partner.google.com> | 2021-09-24 17:35:39 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-05 05:14:43 +0000 |
commit | 0b991c85aeabc67ba4c22a72db2fa452fdba674a (patch) | |
tree | c67d0074637985080fe27b6ab58a22e24aa39800 /board/nipperkin/board.c | |
parent | 771b5ff866e0ef006924952d19b6065496c43ab0 (diff) | |
download | chrome-ec-0b991c85aeabc67ba4c22a72db2fa452fdba674a.tar.gz |
nipperkin: support vivaldi keyboard
BUG=b:197494540, b:201544471, b:196475862
BRANCH=none
TEST=verify keyboard top row key work as intended.
Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Change-Id: I7a0b1573b323f09f8e2ec8b0188dee5cb498af81
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181440
Reviewed-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
Commit-Queue: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'board/nipperkin/board.c')
-rw-r--r-- | board/nipperkin/board.c | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/board/nipperkin/board.c b/board/nipperkin/board.c index 42df3c312b..2458ab0a2c 100644 --- a/board/nipperkin/board.c +++ b/board/nipperkin/board.c @@ -337,3 +337,108 @@ static void board_chipset_suspend(void) ioex_set_level(IOEX_HDMI_DATA_EN, 0); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); + +/* + * With privacy screen, with keyboard backlight + */ +static const struct ec_response_keybd_config keybd_w_privacy_w_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_KBD_BKLIGHT_TOGGLE, /* T9 */ + TK_MICMUTE, /* T10 */ + TK_VOL_MUTE, /* T11 */ + TK_VOL_DOWN, /* T12 */ + TK_VOL_UP, /* T13 */ + }, + .capabilities = KEYBD_CAP_SCRNLOCK_KEY, +}; + +/* + * Without privacy screen, with keyboard backlight + */ +static const struct ec_response_keybd_config keybd_wo_privacy_w_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_KBD_BKLIGHT_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, +}; + +/* + * With privacy screen, without keyboard backlight + */ +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, +}; + +/* + * Without privacy screen, without keyboard backlight + */ +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, +}; + +__override const struct ec_response_keybd_config * +board_vivaldi_keybd_config(void) +{ + if (board_has_privacy_panel() && board_has_kblight()) + return &keybd_w_privacy_w_kblight; + else if (!board_has_privacy_panel() && board_has_kblight()) + return &keybd_wo_privacy_w_kblight; + else if (board_has_privacy_panel() && !board_has_kblight()) + return &keybd_w_privacy_wo_kblight; + else + return &keybd_wo_privacy_wo_kblight; +} |