diff options
author | Devin Lu <devin.lu@quantatw.com> | 2019-11-05 16:43:14 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-06 12:58:03 +0000 |
commit | 57da6c3f8b9861cb37e5a62c539fe563bcc9b07e (patch) | |
tree | 07419049bea766e9cd77eed09c7ed8f54399d7fe /board/dratini | |
parent | 7c7f736b851243194997c75c240b8de9fd26c136 (diff) | |
download | chrome-ec-57da6c3f8b9861cb37e5a62c539fe563bcc9b07e.tar.gz |
dratini: enable keyboard factory scanning
Clone from CL:1309572
This patch add for factory keyboard connector test.
BUG=none
BRANCH=none
TEST=Short keyboard pins and make sure "ectool kbfactorytest" works.
Change-Id: I06deb1539845bc3490c69943579aa4b6bbc1d4ab
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1898258
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/dratini')
-rw-r--r-- | board/dratini/board.c | 18 | ||||
-rw-r--r-- | board/dratini/board.h | 6 |
2 files changed, 24 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c index 54eae7cabc..310fbfaf18 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -429,3 +429,21 @@ uint32_t board_override_feature_flags1(uint32_t flags1) { return flags1; } + +#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/dratini/board.h b/board/dratini/board.h index 22decdbfd7..aae65bee40 100644 --- a/board/dratini/board.h +++ b/board/dratini/board.h @@ -26,6 +26,7 @@ /* Keyboard features */ #define CONFIG_PWM_KBLIGHT +#define CONFIG_KEYBOARD_FACTORY_TEST /* Sensors */ /* BMI160 Base accel/gyro */ @@ -165,6 +166,11 @@ enum battery_type { BATTERY_TYPE_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 */ |