summaryrefslogtreecommitdiff
path: root/common/keyboard_8042.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-10-16 12:37:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-19 12:19:32 -0700
commit9fda2eea0861911537922ce3e45b118297f5030d (patch)
treec3d6822f5088ee561a2b0414300e3efb755e33d6 /common/keyboard_8042.c
parent59dc8df73fa71f3064fd225cf89fed65bf1b25a9 (diff)
downloadchrome-ec-9fda2eea0861911537922ce3e45b118297f5030d.tar.gz
Keyboard: switch column and row of scancode table
This patch switches column and row of scancode_set2. That is, scancode_set2[ROWS][COLS] = {0x00, 0x01, 0x02, ..., 0x10, 0x11, ..., 0x20, ..., becomes scancode_set2[COLS][ROWS] = {0x00, 0x10, 0x20, ..., 0x01, 0x11, ..., 0x02, ..., This will allow us to extend the table for a keypad without losing too much readability. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:117126568 BRANCH=none TEST=Verify keyboard functionality on Sona. Change-Id: I49a7c0796d5c91989f1d3686c80743fb4bcd5ba7 Reviewed-on: https://chromium-review.googlesource.com/1285291 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/keyboard_8042.c')
-rw-r--r--common/keyboard_8042.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index e561762843..124ac8adee 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -309,7 +309,7 @@ static enum ec_error_list matrix_callback(int8_t row, int8_t col,
if (row >= KEYBOARD_ROWS || col >= KEYBOARD_COLS)
return EC_ERROR_INVAL;
- make_code = scancode_set2[row][col];
+ make_code = scancode_set2[col][row];
#ifdef CONFIG_KEYBOARD_SCANCODE_CALLBACK
{
@@ -385,7 +385,7 @@ void keyboard_state_changed(int row, int col, int is_pressed)
enum ec_error_list ret;
#ifdef CONFIG_KEYBOARD_DEBUG
- char mylabel = keycap_label[row][col];
+ char mylabel = keycap_label[col][row];
if (mylabel & KEYCAP_LONG_LABEL_BIT)
CPRINTS("KB (%d,%d)=%d %s", row, col, is_pressed,