Skip to content

Commit 4b2c8e2

Browse files
Leo-TsaiCommit Bot
authored andcommitted
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>
1 parent f31b270 commit 4b2c8e2

4 files changed

Lines changed: 82 additions & 43 deletions

File tree

board/banshee/board.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
/* KEYBOARD */
3434
#define CONFIG_KEYBOARD_CUSTOMIZATION
35+
#define CONFIG_KEYBOARD_VIVALDI
3536

3637
/* LED */
3738
#define CONFIG_LED_PWM_COUNT 2

board/banshee/keyboard.c

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
#include "common.h"
7-
7+
#include "ec_commands.h"
88
#include "keyboard_scan.h"
99
#include "timer.h"
1010

@@ -24,3 +24,55 @@ __override struct keyboard_scan_config keyscan_config = {
2424
0xff, 0xef /* full set */
2525
},
2626
};
27+
28+
static const struct ec_response_keybd_config banshee_kb = {
29+
.num_top_row_keys = 12,
30+
.action_keys = {
31+
TK_BACK, /* T1 */
32+
TK_FORWARD, /* T2 */
33+
TK_REFRESH, /* T3 */
34+
TK_FULLSCREEN, /* T4 */
35+
TK_OVERVIEW, /* T5 */
36+
TK_SNAPSHOT, /* T6 */
37+
TK_BRIGHTNESS_DOWN, /* T7 */
38+
TK_BRIGHTNESS_UP, /* T8 */
39+
TK_PLAY_PAUSE, /* T9 */
40+
TK_VOL_MUTE, /* T10 */
41+
TK_VOL_DOWN, /* T11 */
42+
TK_VOL_UP, /* T12 */
43+
},
44+
.capabilities = KEYBD_CAP_SCRNLOCK_KEY,
45+
};
46+
47+
__override const struct ec_response_keybd_config
48+
*board_vivaldi_keybd_config(void)
49+
{
50+
return &banshee_kb;
51+
}
52+
53+
/*
54+
* Row Column info for Top row keys T1 - T15.
55+
* on banshee keyboard Row Column is customization
56+
* need define row col to mapping matrix layout.
57+
*/
58+
__override const struct key {
59+
uint8_t row;
60+
uint8_t col;
61+
} vivaldi_keys[] = {
62+
{.row = 3, .col = 5}, /* T1 */
63+
{.row = 2, .col = 5}, /* T2 */
64+
{.row = 6, .col = 4}, /* T3 */
65+
{.row = 3, .col = 4}, /* T4 */
66+
{.row = 4, .col = 10}, /* T5 */
67+
{.row = 3, .col = 10}, /* T6 */
68+
{.row = 2, .col = 10}, /* T7 */
69+
{.row = 1, .col = 15}, /* T8 */
70+
{.row = 3, .col = 11}, /* T9 */
71+
{.row = 4, .col = 8}, /* T10 */
72+
{.row = 6, .col = 8}, /* T11 */
73+
{.row = 3, .col = 13}, /* T12 */
74+
{.row = 3, .col = 5}, /* T13 */
75+
{.row = 0, .col = 9}, /* T14 */
76+
{.row = 0, .col = 11}, /* T15 */
77+
};
78+
BUILD_ASSERT(ARRAY_SIZE(vivaldi_keys) == MAX_TOP_ROW_KEYS);

board/banshee/keyboard_customization.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = {
1616
{0x002f, 0xe070, 0x007D, 0xe01f, 0x006c, 0xe06c, 0xe07d, 0x0077},
1717
{0x0015, 0x0070, 0x00ff, 0x000D, 0x000E, 0x0016, 0x0067, 0x001c},
1818
{0xe011, 0x0011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
19-
{0xe05a, 0x0029, 0x0024, 0xe01d, 0x0058, 0x0026, 0xe020, 0xe07a},
19+
{0xe05a, 0x0029, 0x0024, 0xe01d, 0xe01f, 0x0026, 0xe020, 0xe07a},
2020
{0x0022, 0x001a, 0xe030, 0xe038, 0x001b, 0x001e, 0x001d, 0x0076},
2121
{0x002A, 0x0032, 0x0034, 0x002c, 0x002e, 0x0025, 0x002d, 0x002b},
2222
{0x003a, 0x0031, 0x0033, 0x0035, 0x0036, 0x003d, 0x003c, 0x003b},

board/banshee/keyboard_customization.h

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,49 @@ extern uint8_t keyboard_cols;
2525
#define KEYBOARD_ROW_TO_MASK(r) (1 << (r))
2626

2727
/* Columns and masks for keys we particularly care about */
28-
#define KEYBOARD_COL_DOWN 11
29-
#define KEYBOARD_ROW_DOWN 6
28+
#define KEYBOARD_COL_DOWN 8
29+
#define KEYBOARD_ROW_DOWN 1
3030
#define KEYBOARD_MASK_DOWN KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_DOWN)
31-
#define KEYBOARD_COL_ESC 1
32-
#define KEYBOARD_ROW_ESC 1
31+
#define KEYBOARD_COL_ESC 5
32+
#define KEYBOARD_ROW_ESC 7
3333
#define KEYBOARD_MASK_ESC KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_ESC)
34-
#define KEYBOARD_COL_KEY_H 6
35-
#define KEYBOARD_ROW_KEY_H 1
34+
#define KEYBOARD_COL_KEY_H 7
35+
#define KEYBOARD_ROW_KEY_H 2
3636
#define KEYBOARD_MASK_KEY_H KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_H)
37-
#define KEYBOARD_COL_KEY_R 3
38-
#define KEYBOARD_ROW_KEY_R 7
37+
#define KEYBOARD_COL_KEY_R 6
38+
#define KEYBOARD_ROW_KEY_R 6
3939
#define KEYBOARD_MASK_KEY_R KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_R)
40-
#define KEYBOARD_COL_LEFT_ALT 10
41-
#define KEYBOARD_ROW_LEFT_ALT 6
40+
#define KEYBOARD_COL_LEFT_ALT 3
41+
#define KEYBOARD_ROW_LEFT_ALT 1
4242
#define KEYBOARD_MASK_LEFT_ALT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_ALT)
4343
#define KEYBOARD_COL_REFRESH 4
4444
#define KEYBOARD_ROW_REFRESH 6
4545
#define KEYBOARD_MASK_REFRESH KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_REFRESH)
46-
#define KEYBOARD_COL_RIGHT_ALT 10
46+
#define KEYBOARD_COL_RIGHT_ALT 3
4747
#define KEYBOARD_ROW_RIGHT_ALT 0
4848
#define KEYBOARD_MASK_RIGHT_ALT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_RIGHT_ALT)
49-
#define KEYBOARD_DEFAULT_COL_VOL_UP 4
50-
#define KEYBOARD_DEFAULT_ROW_VOL_UP 0
51-
#define KEYBOARD_COL_LEFT_CTRL 0
52-
#define KEYBOARD_ROW_LEFT_CTRL 2
49+
#define KEYBOARD_DEFAULT_COL_VOL_UP 13
50+
#define KEYBOARD_DEFAULT_ROW_VOL_UP 3
51+
#define KEYBOARD_COL_LEFT_CTRL 12
52+
#define KEYBOARD_ROW_LEFT_CTRL 1
5353
#define KEYBOARD_MASK_LEFT_CTRL KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_CTRL)
54-
#define KEYBOARD_COL_RIGHT_CTRL 0
55-
#define KEYBOARD_ROW_RIGHT_CTRL 4
54+
#define KEYBOARD_COL_RIGHT_CTRL 12
55+
#define KEYBOARD_ROW_RIGHT_CTRL 0
5656
#define KEYBOARD_MASK_RIGHT_CTRL KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_RIGHT_CTRL)
57-
#define KEYBOARD_COL_SEARCH 1
58-
#define KEYBOARD_ROW_SEARCH 0
57+
#define KEYBOARD_COL_SEARCH 4
58+
#define KEYBOARD_ROW_SEARCH 4
5959
#define KEYBOARD_MASK_SEARCH KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_SEARCH)
60-
#define KEYBOARD_COL_KEY_0 8
61-
#define KEYBOARD_ROW_KEY_0 6
60+
#define KEYBOARD_COL_KEY_0 13
61+
#define KEYBOARD_ROW_KEY_0 4
6262
#define KEYBOARD_MASK_KEY_0 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_0)
63-
#define KEYBOARD_COL_KEY_1 1
64-
#define KEYBOARD_ROW_KEY_1 6
63+
#define KEYBOARD_COL_KEY_1 2
64+
#define KEYBOARD_ROW_KEY_1 5
6565
#define KEYBOARD_MASK_KEY_1 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_1)
66-
#define KEYBOARD_COL_KEY_2 4
67-
#define KEYBOARD_ROW_KEY_2 6
66+
#define KEYBOARD_COL_KEY_2 5
67+
#define KEYBOARD_ROW_KEY_2 5
6868
#define KEYBOARD_MASK_KEY_2 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_2)
69-
#define KEYBOARD_COL_LEFT_SHIFT 7
70-
#define KEYBOARD_ROW_LEFT_SHIFT 5
69+
#define KEYBOARD_COL_LEFT_SHIFT 9
70+
#define KEYBOARD_ROW_LEFT_SHIFT 1
7171
#define KEYBOARD_MASK_LEFT_SHIFT KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_LEFT_SHIFT)
7272

73-
#ifdef CONFIG_KEYBOARD_BACKLIGHT
74-
int hx20_kblight_enable(int enable);
75-
#endif
76-
77-
#ifdef CONFIG_FACTORY_SUPPORT
78-
void factory_setting(uint8_t enable);
79-
void factory_power_button(int level);
80-
int factory_status(void);
81-
#endif
82-
83-
#ifdef CONFIG_CAPSLED_SUPPORT
84-
void hx20_8042_led_control(int data);
85-
#endif
86-
8773
#endif /* __KEYBOARD_CUSTOMIZATION_H */

0 commit comments

Comments
 (0)