diff options
author | paris_yeh <pyeh@google.com> | 2018-05-23 06:25:37 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-30 12:50:39 -0700 |
commit | e8f009b64b0b7bedc563b55efae296e3d59a15b9 (patch) | |
tree | badb0e7da8dde8a5576f44eef930af773e563c17 /chip/npcx/keyboard_raw.c | |
parent | 9102494be2821ca3bce1662d8595e8c5e0addae5 (diff) | |
download | chrome-ec-e8f009b64b0b7bedc563b55efae296e3d59a15b9.tar.gz |
keyboard_scan: Add option to support keyboards with language ID
ID pins are considered additional KSOs while keycode scanning works
for the existing KSI0 ~ KSI7. While diriving ID pins, the state of
interconnection between ID pins and KSI pins could be used for
identifiers to tell keyboard itself. (e.g. US, Japan,and UK keyboard)
BRANCH=master
BUG=b:80168723
TEST="make -j buildall"
TEST=Verified 5 distinct keyboard samples w/ different Language ID values
on the same reworked Coral, which VOL_UP and VOL_DOWN were reworked
for ID pins. crrev.com/c/1053617 is my experimental patch on top of
this for further verification
Change-Id: I1d6e647df74c50d60bc1264c045b2587d0bf23d8
Signed-off-by: paris_yeh <pyeh@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1068951
Commit-Ready: Paris Yeh <pyeh@chromium.org>
Tested-by: Paris Yeh <pyeh@chromium.org>
Reviewed-by: Paris Yeh <pyeh@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'chip/npcx/keyboard_raw.c')
-rw-r--r-- | chip/npcx/keyboard_raw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/npcx/keyboard_raw.c b/chip/npcx/keyboard_raw.c index 96390a5720..8c2915b542 100644 --- a/chip/npcx/keyboard_raw.c +++ b/chip/npcx/keyboard_raw.c @@ -94,14 +94,14 @@ test_mockable void keyboard_raw_drive_column(int col) /* Drive all lines to high */ if (col == KEYBOARD_COLUMN_NONE) { - mask = KB_COL_MASK; + mask = ~0; #ifdef CONFIG_KEYBOARD_COL2_INVERTED gpio_set_level(GPIO_KBD_KSO2, 0); #endif } /* Set KBSOUT to zero to detect key-press */ else if (col == KEYBOARD_COLUMN_ALL) { - mask = 0; + mask = ~((1 << KEYBOARD_COLS) - 1); #ifdef CONFIG_KEYBOARD_COL2_INVERTED gpio_set_level(GPIO_KBD_KSO2, 1); #endif @@ -114,7 +114,7 @@ test_mockable void keyboard_raw_drive_column(int col) else gpio_set_level(GPIO_KBD_KSO2, 0); #endif - mask = ((~(1 << col_out)) & KB_COL_MASK); + mask = ~(1 << col_out); } /* Set KBSOUT */ |