diff options
author | Sue Chen <sue.chen@quanta.corp-partner.google.com> | 2019-05-08 13:21:13 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-21 14:20:37 -0700 |
commit | 9a21e92fbc0af22ddc86a29b51d8ecf0ab5e2f76 (patch) | |
tree | 8fdd7c47cea954f5f9a0e76f904b1742ce1e7df0 /board | |
parent | b3b26123ef9f84fa0eaaaa3226d717e73860f915 (diff) | |
download | chrome-ec-9a21e92fbc0af22ddc86a29b51d8ecf0ab5e2f76.tar.gz |
octopus: Support keypad function on Bobba
1. Using CONFIG_KEYBOARD_KEYPAD to choose actual_key_mask w or w/o keypad.
2. Enable keypad function on Bobba.
3. Disable scan KSO13 & 14 and modify actual_key_mask for SKU w/o keypad on
Bobba.
4. taking care define of TEST_BUILD to prevent broke build since
keyboard_cols from keyboard_scan.c is not in test-list-y yet.
BUG=b:131095327
BRANCH=octopus
TEST=`make buildall` and `make BOARD=bobba tests` both PASS
Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Change-Id: I0e98a8f60bf5022503b4a86ee8a5b2bbba3b3825
Reviewed-on: https://chromium-review.googlesource.com/1610390
Commit-Ready: Marco Chen <marcochen@chromium.org>
Commit-Ready: David Huang <David.Huang@quantatw.com>
Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Marco Chen <marcochen@chromium.org>
Reviewed-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/bobba/board.c | 24 | ||||
-rw-r--r-- | board/bobba/board.h | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/board/bobba/board.c b/board/bobba/board.c index eca68e19ca..15cf0c3003 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -26,6 +26,8 @@ #include "gpio.h" #include "hooks.h" #include "i2c.h" +#include "keyboard_config.h" +#include "keyboard_raw.h" #include "keyboard_scan.h" #include "lid_switch.h" #include "motion_sense.h" @@ -278,6 +280,27 @@ static void board_update_sensor_config_from_sku(void) } } +static int board_has_keypad(void) +{ + return sku_id == 41 || sku_id == 42 || sku_id == 43 || sku_id == 44; +} + +static void board_update_no_keypad_config_from_sku(void) +{ + if (!board_has_keypad()) { +#ifndef TEST_BUILD + /* Disable scanning KSO13 & 14 if keypad isn't present. */ + keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); + keyscan_config.actual_key_mask[11] = 0xfa; + keyscan_config.actual_key_mask[12] = 0xca; + + /* Search key is moved back to col=1,row=0 */ + keyscan_config.actual_key_mask[0] = 0x14; + keyscan_config.actual_key_mask[1] = 0xff; +#endif + } +} + /* Read CBI from i2c eeprom and initialize variables for board variants */ static void cbi_init(void) { @@ -289,6 +312,7 @@ static void cbi_init(void) CPRINTSUSB("SKU: %d", sku_id); board_update_sensor_config_from_sku(); + board_update_no_keypad_config_from_sku(); } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/board/bobba/board.h b/board/bobba/board.h index 9ab8fb0ab1..e893e29537 100644 --- a/board/bobba/board.h +++ b/board/bobba/board.h @@ -58,6 +58,9 @@ #define CONFIG_PWM #define CONFIG_PWM_KBLIGHT +/* keypad */ +#define CONFIG_KEYBOARD_KEYPAD + #ifndef __ASSEMBLER__ /* support factory keyboard test */ |