From 2be43328c1e23c0004263c95e1678e14b8a4d67e Mon Sep 17 00:00:00 2001 From: Zick Wei Date: Thu, 17 Feb 2022 15:46:42 +0800 Subject: nipperkin: update keyboard setting by board version BUG=b:215038215 BRANCH=none TEST=verify keyboard function work on different board version. Signed-off-by: Zick Wei Change-Id: I61e92a57e1709dedcffa7530cb87ab4a33ea4cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3470640 Reviewed-by: Diana Z Reviewed-by: Rob Barnes --- board/nipperkin/board.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/board/nipperkin/board.c b/board/nipperkin/board.c index a80d57cb5e..46e7749eab 100644 --- a/board/nipperkin/board.c +++ b/board/nipperkin/board.c @@ -360,7 +360,8 @@ 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 = { +static const struct ec_response_keybd_config + keybd_w_privacy_w_kblight = { .num_top_row_keys = 13, .action_keys = { TK_BACK, /* T1 */ @@ -383,7 +384,8 @@ static const struct ec_response_keybd_config keybd_w_privacy_w_kblight = { /* * Without privacy screen, with keyboard backlight */ -static const struct ec_response_keybd_config keybd_wo_privacy_w_kblight = { +static const struct ec_response_keybd_config + keybd_wo_privacy_w_kblight = { .num_top_row_keys = 13, .action_keys = { TK_BACK, /* T1 */ @@ -406,7 +408,8 @@ static const struct ec_response_keybd_config keybd_wo_privacy_w_kblight = { /* * With privacy screen, without keyboard backlight */ -static const struct ec_response_keybd_config keybd_w_privacy_wo_kblight = { +static const struct ec_response_keybd_config + keybd_w_privacy_wo_kblight = { .num_top_row_keys = 13, .action_keys = { TK_BACK, /* T1 */ @@ -429,7 +432,8 @@ static const struct ec_response_keybd_config keybd_w_privacy_wo_kblight = { /* * Without privacy screen, without keyboard backlight */ -static const struct ec_response_keybd_config keybd_wo_privacy_wo_kblight = { +static const struct ec_response_keybd_config + keybd_wo_privacy_wo_kblight_V0 = { .num_top_row_keys = 13, .action_keys = { TK_BACK, /* T1 */ @@ -449,6 +453,27 @@ static const struct ec_response_keybd_config keybd_wo_privacy_wo_kblight = { .capabilities = KEYBD_CAP_SCRNLOCK_KEY, }; +static const struct ec_response_keybd_config + keybd_wo_privacy_wo_kblight_V1 = { + .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_PLAY_PAUSE, /* T8 */ + TK_MICMUTE, /* T9 */ + TK_VOL_MUTE, /* T10 */ + TK_VOL_DOWN, /* T11 */ + TK_VOL_UP, /* T12 */ + TK_MENU, /* T13 */ + }, + .capabilities = KEYBD_CAP_SCRNLOCK_KEY, +}; + __override const struct ec_response_keybd_config * board_vivaldi_keybd_config(void) { @@ -458,8 +483,12 @@ board_vivaldi_keybd_config(void) 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; + else { + if (get_board_version() <= 3) + return &keybd_wo_privacy_wo_kblight_V0; + else + return &keybd_wo_privacy_wo_kblight_V1; + } } const struct pi3hdx1204_tuning pi3hdx1204_tuning = { -- cgit v1.2.1