summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-10-13 15:17:04 +0800
committerCommit Bot <commit-bot@chromium.org>2021-10-13 23:18:43 +0000
commit24a637300ae19c08ff656c0973edff21217617d1 (patch)
treee7abe90f135dfea2550993dac15afe4360052abd
parentac7538a8f03d3b1bac14e54627ec92db05abcaeb (diff)
downloadchrome-ec-24a637300ae19c08ff656c0973edff21217617d1.tar.gz
redrix: Enable keyboard factory scanning
This patch adds the factory keyboard connector test. BUG=b:202914217 BRANCH=none TEST=Short keyboard pins and make sure "ectool kbfactorytest" works. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I941767c928d71cd04087ff40fa53427f49ae4802 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3220038 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
-rw-r--r--board/redrix/board.h6
-rw-r--r--board/redrix/keyboard.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/board/redrix/board.h b/board/redrix/board.h
index 8f1cc17f70..3c8eb8ae0a 100644
--- a/board/redrix/board.h
+++ b/board/redrix/board.h
@@ -185,6 +185,7 @@
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
/* Keyboard features */
+#define CONFIG_KEYBOARD_FACTORY_TEST
#define CONFIG_KEYBOARD_VIVALDI
#define CONFIG_KEYBOARD_REFRESH_ROW3
@@ -249,6 +250,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/redrix/keyboard.c b/board/redrix/keyboard.c
index 90506163d9..e1a5381a6c 100644
--- a/board/redrix/keyboard.c
+++ b/board/redrix/keyboard.c
@@ -73,3 +73,22 @@ board_vivaldi_keybd_config(void)
else
return &keybd2;
}
+
+
+#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