diff options
author | Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> | 2022-03-18 11:41:09 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-22 06:38:35 +0000 |
commit | 4b2c8e284fa85ee4db4f2580b2b44f9f7e78f339 (patch) | |
tree | c65774b599667dd3cd867e5025fb2eb7d8b8a3d3 /board/banshee | |
parent | f31b270f97e2814acb73873c7056057796c09fa0 (diff) | |
download | chrome-ec-4b2c8e284fa85ee4db4f2580b2b44f9f7e78f339.tar.gz |
Banshee:Initialize the vivaldi keyboard
Initialize vivaldi keyboard.
modify combination key row and col
BUG=b:220996030,b:225754859
BRANCH=none
TEST=build make -j BOARD=Banshee pass and verify with evtest 2
Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com>
Change-Id: I9e476a883016c3c24d07faf6b5926fb5c7807b2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535540
Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'board/banshee')
-rw-r--r-- | board/banshee/board.h | 1 | ||||
-rw-r--r-- | board/banshee/keyboard.c | 54 | ||||
-rw-r--r-- | board/banshee/keyboard_customization.c | 2 | ||||
-rw-r--r-- | board/banshee/keyboard_customization.h | 68 |
4 files changed, 82 insertions, 43 deletions
diff --git a/board/banshee/board.h b/board/banshee/board.h index c4861bf3b0..8c82eca583 100644 --- a/board/banshee/board.h +++ b/board/banshee/board.h @@ -32,6 +32,7 @@ /* KEYBOARD */ #define CONFIG_KEYBOARD_CUSTOMIZATION +#define CONFIG_KEYBOARD_VIVALDI /* LED */ #define CONFIG_LED_PWM_COUNT 2 diff --git a/board/banshee/keyboard.c b/board/banshee/keyboard.c index 0dd1b709c9..3bea4aeb40 100644 --- a/board/banshee/keyboard.c +++ b/board/banshee/keyboard.c @@ -4,7 +4,7 @@ */ #include "common.h" - +#include "ec_commands.h" #include "keyboard_scan.h" #include "timer.h" @@ -24,3 +24,55 @@ __override struct keyboard_scan_config keyscan_config = { 0xff, 0xef /* full set */ }, }; + +static const struct ec_response_keybd_config banshee_kb = { + .num_top_row_keys = 12, + .action_keys = { + TK_BACK, /* T1 */ + TK_FORWARD, /* T2 */ + TK_REFRESH, /* T3 */ + TK_FULLSCREEN, /* T4 */ + TK_OVERVIEW, /* T5 */ + TK_SNAPSHOT, /* T6 */ + TK_BRIGHTNESS_DOWN, /* T7 */ + TK_BRIGHTNESS_UP, /* T8 */ + TK_PLAY_PAUSE, /* T9 */ + TK_VOL_MUTE, /* T10 */ + TK_VOL_DOWN, /* T11 */ + TK_VOL_UP, /* T12 */ + }, + .capabilities = KEYBD_CAP_SCRNLOCK_KEY, +}; + +__override const struct ec_response_keybd_config +*board_vivaldi_keybd_config(void) +{ + return &banshee_kb; +} + +/* + * Row Column info for Top row keys T1 - T15. + * on banshee keyboard Row Column is customization + * need define row col to mapping matrix layout. + */ +__override const struct key { + uint8_t row; + uint8_t col; +} vivaldi_keys[] = { + {.row = 3, .col = 5}, /* T1 */ + {.row = 2, .col = 5}, /* T2 */ + {.row = 6, .col = 4}, /* T3 */ + {.row = 3, .col = 4}, /* T4 */ + {.row = 4, .col = 10}, /* T5 */ + {.row = 3, .col = 10}, /* T6 */ + {.row = 2, .col = 10}, /* T7 */ + {.row = 1, .col = 15}, /* T8 */ + {.row = 3, .col = 11}, /* T9 */ + {.row = 4, .col = 8}, /* T10 */ + {.row = 6, .col = 8}, /* T11 */ + {.row = 3, .col = 13}, /* T12 */ + {.row = 3, .col = 5}, /* T13 */ + {.row = 0, .col = 9}, /* T14 */ + {.row = 0, .col = 11}, /* T15 */ +}; +BUILD_ASSERT(ARRAY_SIZE(vivaldi_keys) == MAX_TOP_ROW_KEYS); diff --git a/board/banshee/keyboard_customization.c b/board/banshee/keyboard_customization.c index 3bec5bfa41..f80926e05f 100644 --- a/board/banshee/keyboard_customization.c +++ b/board/banshee/keyboard_customization.c @@ -16,7 +16,7 @@ static uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { {0x002f, 0xe070, 0x007D, 0xe01f, 0x006c, 0xe06c, 0xe07d, 0x0077}, {0x0015, 0x0070, 0x00ff, 0x000D, 0x000E, 0x0016, 0x0067, 0x001c}, {0xe011, 0x0011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, - {0xe05a, 0x0029, 0x0024, 0xe01d, 0x0058, 0x0026, 0xe020, 0xe07a}, + {0xe05a, 0x0029, 0x0024, 0xe01d, 0xe01f, 0x0026, 0xe020, 0xe07a}, {0x0022, 0x001a, 0xe030, 0xe038, 0x001b, 0x001e, 0x001d, 0x0076}, {0x002A, 0x0032, 0x0034, 0x002c, 0x002e, 0x0025, 0x002d, 0x002b}, {0x003a, 0x0031, 0x0033, 0x0035, 0x0036, 0x003d, 0x003c, 0x003b}, diff --git a/board/banshee/keyboard_customization.h b/board/banshee/keyboard_customization.h index 5600da51fe..49e0eaead8 100644 --- a/board/banshee/keyboard_customization.h +++ b/board/banshee/keyboard_customization.h @@ -25,63 +25,49 @@ extern uint8_t keyboard_cols; #define KEYBOARD_ROW_TO_MASK(r) (1 << (r)) /* Columns and masks for keys we particularly care about */ -#define KEYBOARD_COL_DOWN 11 -#define KEYBOARD_ROW_DOWN 6 +#define KEYBOARD_COL_DOWN 8 +#define KEYBOARD_ROW_DOWN 1 #define KEYBOARD_MASK_DOWN KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_DOWN) -#define KEYBOARD_COL_ESC 1 -#define KEYBOARD_ROW_ESC 1 +#define KEYBOARD_COL_ESC 5 +#define KEYBOARD_ROW_ESC 7 #define KEYBOARD_MASK_ESC KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_ESC) -#define KEYBOARD_COL_KEY_H 6 -#define KEYBOARD_ROW_KEY_H 1 +#define KEYBOARD_COL_KEY_H 7 +#define KEYBOARD_ROW_KEY_H 2 #define KEYBOARD_MASK_KEY_H KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_H) -#define KEYBOARD_COL_KEY_R 3 -#define KEYBOARD_ROW_KEY_R 7 +#define KEYBOARD_COL_KEY_R 6 +#define KEYBOARD_ROW_KEY_R 6 #define KEYBOARD_MASK_KEY_R KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_R) -#define KEYBOARD_COL_LEFT_ALT 10 -#define KEYBOARD_ROW_LEFT_ALT 6 +#define KEYBOARD_COL_LEFT_ALT 3 +#define KEYBOARD_ROW_LEFT_ALT 1 #define KEYBOARD_MASK_LEFT_ALT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_ALT) #define KEYBOARD_COL_REFRESH 4 #define KEYBOARD_ROW_REFRESH 6 #define KEYBOARD_MASK_REFRESH KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_REFRESH) -#define KEYBOARD_COL_RIGHT_ALT 10 +#define KEYBOARD_COL_RIGHT_ALT 3 #define KEYBOARD_ROW_RIGHT_ALT 0 #define KEYBOARD_MASK_RIGHT_ALT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_RIGHT_ALT) -#define KEYBOARD_DEFAULT_COL_VOL_UP 4 -#define KEYBOARD_DEFAULT_ROW_VOL_UP 0 -#define KEYBOARD_COL_LEFT_CTRL 0 -#define KEYBOARD_ROW_LEFT_CTRL 2 +#define KEYBOARD_DEFAULT_COL_VOL_UP 13 +#define KEYBOARD_DEFAULT_ROW_VOL_UP 3 +#define KEYBOARD_COL_LEFT_CTRL 12 +#define KEYBOARD_ROW_LEFT_CTRL 1 #define KEYBOARD_MASK_LEFT_CTRL KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_CTRL) -#define KEYBOARD_COL_RIGHT_CTRL 0 -#define KEYBOARD_ROW_RIGHT_CTRL 4 +#define KEYBOARD_COL_RIGHT_CTRL 12 +#define KEYBOARD_ROW_RIGHT_CTRL 0 #define KEYBOARD_MASK_RIGHT_CTRL KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_RIGHT_CTRL) -#define KEYBOARD_COL_SEARCH 1 -#define KEYBOARD_ROW_SEARCH 0 +#define KEYBOARD_COL_SEARCH 4 +#define KEYBOARD_ROW_SEARCH 4 #define KEYBOARD_MASK_SEARCH KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_SEARCH) -#define KEYBOARD_COL_KEY_0 8 -#define KEYBOARD_ROW_KEY_0 6 +#define KEYBOARD_COL_KEY_0 13 +#define KEYBOARD_ROW_KEY_0 4 #define KEYBOARD_MASK_KEY_0 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_0) -#define KEYBOARD_COL_KEY_1 1 -#define KEYBOARD_ROW_KEY_1 6 +#define KEYBOARD_COL_KEY_1 2 +#define KEYBOARD_ROW_KEY_1 5 #define KEYBOARD_MASK_KEY_1 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_1) -#define KEYBOARD_COL_KEY_2 4 -#define KEYBOARD_ROW_KEY_2 6 +#define KEYBOARD_COL_KEY_2 5 +#define KEYBOARD_ROW_KEY_2 5 #define KEYBOARD_MASK_KEY_2 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_2) -#define KEYBOARD_COL_LEFT_SHIFT 7 -#define KEYBOARD_ROW_LEFT_SHIFT 5 +#define KEYBOARD_COL_LEFT_SHIFT 9 +#define KEYBOARD_ROW_LEFT_SHIFT 1 #define KEYBOARD_MASK_LEFT_SHIFT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_SHIFT) -#ifdef CONFIG_KEYBOARD_BACKLIGHT -int hx20_kblight_enable(int enable); -#endif - -#ifdef CONFIG_FACTORY_SUPPORT -void factory_setting(uint8_t enable); -void factory_power_button(int level); -int factory_status(void); -#endif - -#ifdef CONFIG_CAPSLED_SUPPORT -void hx20_8042_led_control(int data); -#endif - #endif /* __KEYBOARD_CUSTOMIZATION_H */ |