summaryrefslogtreecommitdiff
path: root/board/chronicler
diff options
context:
space:
mode:
authorYu-An Chen <yu-an.chen@quanta.corp-partner.google.com>2021-06-08 17:21:08 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-16 18:57:15 +0000
commitffa3298c8360adb169e4427b004d6c883bd57ad4 (patch)
tree469313591357a6f9032d2807f083d370e3d23f1c /board/chronicler
parentd80e79afe223cbcb0d9d7392c65f89c950a5d858 (diff)
downloadchrome-ec-ffa3298c8360adb169e4427b004d6c883bd57ad4.tar.gz
Chronicler: Support factory keyboard test
Support factory keyboard connector test BUG=b:191175285 BRANCH=volteer TEST=check ectool kbfactorytest pass Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I6b36afedf6ee5107ba50fefbf6b9cf90fca0e6ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965806 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
Diffstat (limited to 'board/chronicler')
-rw-r--r--board/chronicler/board.c21
-rw-r--r--board/chronicler/board.h8
2 files changed, 29 insertions, 0 deletions
diff --git a/board/chronicler/board.c b/board/chronicler/board.c
index 2369202c49..78209ce7be 100644
--- a/board/chronicler/board.c
+++ b/board/chronicler/board.c
@@ -202,3 +202,24 @@ const struct pwm_t pwm_channels[] = {
},
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
+/******************************************************************************/
+/* keyboard factory test */
+#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
diff --git a/board/chronicler/board.h b/board/chronicler/board.h
index ca691c437c..c8fc4b464d 100644
--- a/board/chronicler/board.h
+++ b/board/chronicler/board.h
@@ -102,6 +102,9 @@
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
+/* Keyboard feature */
+#define CONFIG_KEYBOARD_FACTORY_TEST
+
/*
* Macros for GPIO signals used in common code that don't match the
* schematic names. Signal names in gpio.inc match the schematic and are
@@ -185,6 +188,11 @@ enum sensor_id {
void board_reset_pd_mcu(void);
+#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 */