diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-02-02 11:06:08 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-04 22:47:50 +0000 |
commit | 5019a83fef6d5d8c03dd93964dd7403f7339f450 (patch) | |
tree | 34813fdd309c2c8d3e51d3894abdf705abb0293a /board/elemi | |
parent | eb602fa5a673ffe7b333347af1cebf85f74c4990 (diff) | |
download | chrome-ec-5019a83fef6d5d8c03dd93964dd7403f7339f450.tar.gz |
elemi: Enable keyboard factory scanning
This patch add for factory keyboard connector test.
BUG=none
BRANCH=firmware-volteer-13672.B-main
TEST=Short keyboard pins and make sure "ectool kbfactorytest" works.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I2acd2df29e477a564dbb6a13039d14749f81f935
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666555
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/elemi')
-rw-r--r-- | board/elemi/board.c | 18 | ||||
-rw-r--r-- | board/elemi/board.h | 8 |
2 files changed, 26 insertions, 0 deletions
diff --git a/board/elemi/board.c b/board/elemi/board.c index e8983019d6..8000c27332 100644 --- a/board/elemi/board.c +++ b/board/elemi/board.c @@ -424,3 +424,21 @@ int ppc_get_alert_status(int port) else return gpio_get_level(GPIO_USB_C1_PPC_INT_ODL) == 0; } + +#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/elemi/board.h b/board/elemi/board.h index c9be63a60d..4f30b2aac4 100644 --- a/board/elemi/board.h +++ b/board/elemi/board.h @@ -80,6 +80,9 @@ #undef CONFIG_USBC_RETIMER_INTEL_BB #undef CONFIG_USBC_RETIMER_INTEL_BB_RUNTIME_CONFIG +/* 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 @@ -147,6 +150,11 @@ enum usbc_port { 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 */ |