diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2022-01-25 10:51:50 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-28 04:27:36 +0000 |
commit | 7b59f640a2ea56fb5e7c22a52c887402dc0e5c18 (patch) | |
tree | 8b1c47327a0f3bc060e288fdd0af209f58874a57 | |
parent | fcfd48563010b4ff173f0f5ef980d8f1f9186f48 (diff) | |
download | chrome-ec-7b59f640a2ea56fb5e7c22a52c887402dc0e5c18.tar.gz |
vell: Enable keyboard factory scanning
This patch adds the factory keyboard connector test.
BUG=b:216351386
BRANCH=none
TEST=Short keyboard pins and make sure "ectool kbfactorytest" works.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: Ib402d143c934e63b5226eacc1cf021df9f6aa692
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413606
Reviewed-by: Boris Mittelberg <bmbm@google.com>
-rw-r--r-- | board/vell/board.h | 6 | ||||
-rw-r--r-- | board/vell/keyboard.c | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/board/vell/board.h b/board/vell/board.h index ed90eaf141..5d9be9adfa 100644 --- a/board/vell/board.h +++ b/board/vell/board.h @@ -169,6 +169,7 @@ #define CONFIG_CHARGER_SENSE_RESISTOR_AC 20 /* Keyboard features */ +#define CONFIG_KEYBOARD_FACTORY_TEST #define CONFIG_KEYBOARD_REFRESH_ROW3 /* @@ -237,6 +238,11 @@ enum mft_channel { MFT_CH_COUNT }; +#ifdef CONFIG_KEYBOARD_FACTORY_TEST +extern const int keyboard_factory_scan_pins[][2]; +extern const int keyboard_factory_scan_pins_used; +#endif + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/vell/keyboard.c b/board/vell/keyboard.c index f3b537b447..7a51f8dd39 100644 --- a/board/vell/keyboard.c +++ b/board/vell/keyboard.c @@ -50,3 +50,21 @@ board_vivaldi_keybd_config(void) return &keybd1; } + +#ifdef CONFIG_KEYBOARD_FACTORY_TEST +/* + * Map keyboard connector pins to EC GPIO pins for factory test. + * Pins mapped to {-1, -1} are skipped. + * The connector has 24 pins total, and there is no pin 0. + */ +const int keyboard_factory_scan_pins[][2] = { + {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6}, + {0, 7}, {1, 4}, {1, 3}, {1, 6}, {1, 7}, + {3, 1}, {2, 0}, {1, 5}, {2, 6}, {2, 7}, + {2, 1}, {2, 4}, {2, 5}, {1, 2}, {2, 3}, + {2, 2}, {3, 0}, {-1, -1}, {-1, -1}, {-1, -1}, +}; + +const int keyboard_factory_scan_pins_used = + ARRAY_SIZE(keyboard_factory_scan_pins); +#endif |