diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-10-16 15:16:29 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-19 23:21:56 -0700 |
commit | 9a890ad22965daa7e9365a0b2cb8c734ae41a842 (patch) | |
tree | 27e3f1f0845031e685fc46ffdad44d8cb87adfeb /chip/npcx | |
parent | 4d4d8f06e91090336c2eb29ee00ca86fea2bb796 (diff) | |
download | chrome-ec-9a890ad22965daa7e9365a0b2cb8c734ae41a842.tar.gz |
Keyboard: Allow keyboard size to be set at run time
Currently, the keyboard size (i.e. number of columns) is static.
This patch allows it to be configured at run time. It's required to
support a keyboard with/without keypad in a single image.
KEYBOARD_COLS_MAX has the build time col size. It's used to allocate
exact spaces for arrays. Actual keyboard scanning is done using
keyboard_cols, which holds a runtime col size.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:117126568
BRANCH=none
TEST=Verify keyboard functionality on Sona and Veyron.
Change-Id: I4b3552be0b4b315c3fe5a6884cf25e10aba8be7c
Reviewed-on: https://chromium-review.googlesource.com/1285292
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/npcx')
-rw-r--r-- | chip/npcx/keyboard_raw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/npcx/keyboard_raw.c b/chip/npcx/keyboard_raw.c index 8c2915b542..1713d2c931 100644 --- a/chip/npcx/keyboard_raw.c +++ b/chip/npcx/keyboard_raw.c @@ -101,7 +101,7 @@ test_mockable void keyboard_raw_drive_column(int col) } /* Set KBSOUT to zero to detect key-press */ else if (col == KEYBOARD_COLUMN_ALL) { - mask = ~((1 << KEYBOARD_COLS) - 1); + mask = ~((1 << keyboard_cols) - 1); #ifdef CONFIG_KEYBOARD_COL2_INVERTED gpio_set_level(GPIO_KBD_KSO2, 1); #endif |