diff options
author | Josh Tsai <josh_tsai@compal.corp-partner.google.com> | 2022-05-27 10:15:50 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-14 14:13:37 +0000 |
commit | fbb6ee32d3266630e2c594298409edec3cd38bd7 (patch) | |
tree | 84a6cceb66f2c5c5446734014f264f3dd9e4f45a /board | |
parent | aaf1d59b94659edc33445b05e030afea64e85bcc (diff) | |
download | chrome-ec-fbb6ee32d3266630e2c594298409edec3cd38bd7.tar.gz |
Banshee: Support different vivaldi keyboard
We need to support different vivaldi keyboard, so used board id to
distinguish
BRANCH=none
BUG=b:231265647
TEST=evtest check the T8 function is KEY_KBDILLUMTOGGLE
Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
Change-Id: Icb42a413b84e40a8a1fbf096928fe5410c39c378
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3670779
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Commit-Queue: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/banshee/board.c | 14 | ||||
-rw-r--r-- | board/banshee/gpio.inc | 4 | ||||
-rw-r--r-- | board/banshee/keyboard.c | 26 | ||||
-rw-r--r-- | board/banshee/keyboard_customization.c | 8 |
4 files changed, 44 insertions, 8 deletions
diff --git a/board/banshee/board.c b/board/banshee/board.c index 4f2b06b448..8f1d8bb811 100644 --- a/board/banshee/board.c +++ b/board/banshee/board.c @@ -85,12 +85,20 @@ void board_init(void) if (board_id == 0) { /* keyboard_col2_inverted on board id 0 */ gpio_set_flags(GPIO_EC_KSO_04_INV, GPIO_ODR_HIGH); - gpio_set_alternate_function(GPIO_PORT_1, BIT(5), + gpio_set_flags(GPIO_EC_KSO_05_INV, GPIO_ODR_HIGH); + gpio_set_alternate_function(GPIO_PORT_1, (BIT(4) | BIT(5)), + GPIO_ALT_FUNC_DEFAULT); + } else if (board_id == 1) { + /* keyboard_col4_inverted on board id 1 */ + gpio_set_flags(GPIO_EC_KSO_02_INV, GPIO_ODR_HIGH); + gpio_set_flags(GPIO_EC_KSO_05_INV, GPIO_ODR_HIGH); + gpio_set_alternate_function(GPIO_PORT_1, (BIT(4) | BIT(7)), GPIO_ALT_FUNC_DEFAULT); } else { - /* keyboard_col4_inverted on board id 1 and later */ + /* keyboard_col5_inverted on board id 2 and later */ gpio_set_flags(GPIO_EC_KSO_02_INV, GPIO_ODR_HIGH); - gpio_set_alternate_function(GPIO_PORT_1, BIT(7), + gpio_set_flags(GPIO_EC_KSO_04_INV, GPIO_ODR_HIGH); + gpio_set_alternate_function(GPIO_PORT_1, (BIT(5) | BIT(7)), GPIO_ALT_FUNC_DEFAULT); } diff --git a/board/banshee/gpio.inc b/board/banshee/gpio.inc index 53c71f77e9..2a0e90e675 100644 --- a/board/banshee/gpio.inc +++ b/board/banshee/gpio.inc @@ -113,7 +113,7 @@ ALTERNATE(PIN_MASK(4, 0x34), 0, MODULE_ADC, 0) /* GPIO42/ADC3/RI_L /* KB alternate functions */ ALTERNATE(PIN_MASK(0, 0xf0), 0, MODULE_KB, GPIO_ODR_HIGH) /* KSO10&P80_CLK/GPIO07, KSO11&P80_DAT/GPIO06, KSO12/GPIO05, KSO13/GPIO04 */ -ALTERNATE(PIN_MASK(1, 0x5F), 0, MODULE_KB, GPIO_ODR_HIGH) /* KSO06/GPO13/GP_SEL_L, KSO07/GPO12/JEN_L, KSO03/GPIO16/JTAG_TDO0_SWO, KSO04/GPIO15/XNOR, KSO05/GPIO14, KSO08/GPIO11/CR_SOUT1, KSO09/GPIO10/CR_SIN1 */ +ALTERNATE(PIN_MASK(1, 0x4F), 0, MODULE_KB, GPIO_ODR_HIGH) /* KSO06/GPO13/GP_SEL_L, KSO07/GPO12/JEN_L, KSO03/GPIO16/JTAG_TDO0_SWO, KSO04/GPIO15/XNOR, KSO05/GPIO14, KSO08/GPIO11/CR_SOUT1, KSO09/GPIO10/CR_SIN1 */ ALTERNATE(PIN_MASK(2, 0xfc), 0, MODULE_KB, GPIO_INPUT | GPIO_PULL_UP) /* KSI2/GPIO27/TRACEDATA1, KSI3/GPIO26/TRACEDATA0, KSI4/GPIO25/TRACECLK/GP_SCLK, KSI5/GPIO24/GP_MISO, KSI6/GPIO23/S_SBUB, KSI7/GPIO22/S_SBUA */ ALTERNATE(PIN_MASK(2, 0x03), 0, MODULE_KB, GPIO_ODR_HIGH) /* KSO00/GPIO21/JTAG_TCK_SWCLK, KSO01/GPIO20/JTAG_TMS_SWIO */ ALTERNATE(PIN_MASK(3, 0x03), 0, MODULE_KB, GPIO_INPUT | GPIO_PULL_UP) /* KSI0/GPIO31/TRACEDATA3/GP_MOSI, KSI1/GPIO30/TRACEDATA2/GP_CS_L */ @@ -150,9 +150,11 @@ UNUSED(PIN(5, 7)) /* GPIO57/SER_IRQ/ESPI_ALERT_L */ * keyboard scan pins, so we do not list them in *gpio.inc. However, when * KEYBOARD_COL2_INVERTED is defined, this name is required. * + * GPIO14 needs to be inverted on BOARD ID 2 and later * GPIO15 needs to be inverted on BOARD ID 1 * GPIO17 needs to be inverted on BOARD ID 0 */ +GPIO(EC_KSO_05_INV, PIN(1, 4), GPIO_OUT_LOW) GPIO(EC_KSO_04_INV, PIN(1, 5), GPIO_OUT_LOW) GPIO(EC_KSO_02_INV, PIN(1, 7), GPIO_OUT_LOW) diff --git a/board/banshee/keyboard.c b/board/banshee/keyboard.c index 3bea4aeb40..3891955b46 100644 --- a/board/banshee/keyboard.c +++ b/board/banshee/keyboard.c @@ -25,7 +25,7 @@ __override struct keyboard_scan_config keyscan_config = { }, }; -static const struct ec_response_keybd_config banshee_kb = { +static const struct ec_response_keybd_config banshee_kb_id1 = { .num_top_row_keys = 12, .action_keys = { TK_BACK, /* T1 */ @@ -44,10 +44,32 @@ static const struct ec_response_keybd_config banshee_kb = { .capabilities = KEYBD_CAP_SCRNLOCK_KEY, }; +static const struct ec_response_keybd_config banshee_kb_id2 = { + .num_top_row_keys = 12, + .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_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; + if (get_board_id() <= 1) + return &banshee_kb_id1; + else + return &banshee_kb_id2; } /* diff --git a/board/banshee/keyboard_customization.c b/board/banshee/keyboard_customization.c index 0fdf8f8a9b..cf6904cb37 100644 --- a/board/banshee/keyboard_customization.c +++ b/board/banshee/keyboard_customization.c @@ -53,10 +53,14 @@ void board_id_keyboard_col_inverted(int board_id) /* keyboard_col2_inverted on board id 0 */ signal = GPIO_EC_KSO_02_INV; colinv = 2; - } else { - /* keyboard_col4_inverted on board id 1 and later */ + } else if (board_id == 1) { + /* keyboard_col4_inverted on board id 1 */ signal = GPIO_EC_KSO_04_INV; colinv = 4; + } else { + /* keyboard_col5_inverted on board id 2 and later */ + signal = GPIO_EC_KSO_05_INV; + colinv = 5; } } |