diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-10-17 13:31:09 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-24 16:45:04 -0700 |
commit | 67cd02cffdb80c137745f35abb03562402fd6c66 (patch) | |
tree | d85f1d28c157f6a8977bed07eead039b797fcf6b /board | |
parent | bcd764143b1a00016251908908120cb8d7261890 (diff) | |
download | chrome-ec-67cd02cffdb80c137745f35abb03562402fd6c66.tar.gz |
Nami: Add keypad support
With this patch, the EC will scan KSO13 and KSO14 to read keypad
buttons. If SKU_ID doesn't have SKU_ID_MASK_KEYPAD bit, the column
size will be set to the current value (=13).
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:117126568
BRANCH=none
TEST=Tested by shortening KSO13 and KSO14 to KSI5. Run buildall.
Run emerge-nami chromeos-ec.
Change-Id: I2e41f832d82b36dedea187ff6a794d7c82a8463f
Reviewed-on: https://chromium-review.googlesource.com/1287149
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/nami/board.c | 10 | ||||
-rw-r--r-- | board/nami/board.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index ff8d804496..c26619af5f 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -34,6 +34,8 @@ #include "i2c.h" #include "isl923x.h" #include "keyboard_backlight.h" +#include "keyboard_config.h" +#include "keyboard_raw.h" #include "keyboard_scan.h" #include "lid_switch.h" #include "math_util.h" @@ -941,6 +943,12 @@ static void board_init(void) /* Enable Accel/Gyro interrupt for convertibles. */ if (sku & SKU_ID_MASK_CONVERTIBLE) gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L); + +#ifndef TEST_BUILD + /* Disable scanning KSO13 & 14 if keypad isn't present. */ + if (!(sku & SKU_ID_MASK_KEYPAD)) + keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); +#endif } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); @@ -960,7 +968,7 @@ struct keyboard_scan_config keyscan_config = { .poll_timeout_us = 100 * MSEC, .actual_key_mask = { 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, - 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */ + 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca, 0xff, 0xff, /* full set */ }, }; diff --git a/board/nami/board.h b/board/nami/board.h index 939a42900d..4af9b5e787 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -32,6 +32,7 @@ #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_KEYBOARD_KEYPAD #define CONFIG_LED_COMMON #define CONFIG_LID_SWITCH #define CONFIG_LOW_POWER_IDLE @@ -286,6 +287,7 @@ enum oem_id { }; #define SKU_ID_MASK_CONVERTIBLE (1 << 9) +#define SKU_ID_MASK_KEYPAD (1 << 15) /* TODO(crosbug.com/p/61098): Verify the numbers below. */ /* |