diff options
author | Devin Lu <devin.lu@quantatw.com> | 2018-12-12 13:28:31 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-12-14 16:37:59 +0000 |
commit | 1b390d77b81374c8197032e4c55f4d0a0205f99e (patch) | |
tree | 750771d787596cef00482c1c183965de0882a0bb /chip | |
parent | c70f197b15ea4086be2ba9b1f1c67a696f42add5 (diff) | |
download | chrome-ec-1b390d77b81374c8197032e4c55f4d0a0205f99e.tar.gz |
keyboard: restore KBD_KSO2 after keyboard factory scan testing
This patch fix the keyboard malfucntion with KBD_KSO2 line after
executed "ectool kbfactorytest".
BUG=none
BRANCH=octopus
TEST=make sure keyboard works after executed "ectool kbfactorytest"
on meep.
Change-Id: I33c22e59a01884ff6c961161e189583a6c3673a3
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/c/1377338
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
Tested-by: Jett Rink <jettrink@chromium.org>
Trybot-Ready: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mchp/keyboard_raw.c | 5 | ||||
-rw-r--r-- | chip/mec1322/keyboard_raw.c | 5 | ||||
-rw-r--r-- | chip/npcx/keyboard_raw.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/chip/mchp/keyboard_raw.c b/chip/mchp/keyboard_raw.c index e1a9aa60cc..4d146e85f8 100644 --- a/chip/mchp/keyboard_raw.c +++ b/chip/mchp/keyboard_raw.c @@ -103,13 +103,15 @@ DECLARE_IRQ(MCHP_IRQ_KSC_INT, keyboard_raw_interrupt, 1); /* Run keyboard factory testing, scan out KSO/KSI if any shorted. */ int keyboard_factory_test_scan(void) { - int i, j; + int i, j, flags; uint16_t shorted = 0; uint32_t port, id, val; /* Disable keyboard scan while testing */ keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_CLOSED); + flags = gpio_get_default_flags(GPIO_KBD_KSO2); + /* Set all of KSO/KSI pins to internal pull-up and input */ for (i = 0; i < keyboard_factory_scan_pins_used; i++) { @@ -160,6 +162,7 @@ int keyboard_factory_test_scan(void) } done: gpio_config_module(MODULE_KEYBOARD_SCAN, 1); + gpio_set_flags(GPIO_KBD_KSO2, flags); keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_CLOSED); return shorted; diff --git a/chip/mec1322/keyboard_raw.c b/chip/mec1322/keyboard_raw.c index 729ab9bda0..2befb00fe6 100644 --- a/chip/mec1322/keyboard_raw.c +++ b/chip/mec1322/keyboard_raw.c @@ -87,13 +87,15 @@ DECLARE_IRQ(MEC1322_IRQ_KSC_INT, keyboard_raw_interrupt, 1); /* Run keyboard factory testing, scan out KSO/KSI if any shorted. */ int keyboard_factory_test_scan(void) { - int i, j; + int i, j, flags; uint16_t shorted = 0; uint32_t port, id, val; /* Disable keyboard scan while testing */ keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_CLOSED); + flags = gpio_get_default_flags(GPIO_KBD_KSO2); + /* Set all of KSO/KSI pins to internal pull-up and input */ for (i = 0; i < keyboard_factory_scan_pins_used; i++) { @@ -144,6 +146,7 @@ int keyboard_factory_test_scan(void) } done: gpio_config_module(MODULE_KEYBOARD_SCAN, 1); + gpio_set_flags(GPIO_KBD_KSO2, flags); keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_CLOSED); return shorted; diff --git a/chip/npcx/keyboard_raw.c b/chip/npcx/keyboard_raw.c index 1713d2c931..9ab1b1cddf 100644 --- a/chip/npcx/keyboard_raw.c +++ b/chip/npcx/keyboard_raw.c @@ -161,13 +161,15 @@ DECLARE_IRQ(NPCX_IRQ_KSI_WKINTC_1, keyboard_raw_interrupt, 5); /* Run keyboard factory testing, scan out KSO/KSI if any shorted. */ int keyboard_factory_test_scan(void) { - int i, j; + int i, j, flags; uint16_t shorted = 0; uint32_t port, id; /* Disable keyboard scan while testing */ keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_CLOSED); + flags = gpio_get_default_flags(GPIO_KBD_KSO2); + /* Set all of KSO/KSI pins to internal pull-up and input */ for (i = 0; i < keyboard_factory_scan_pins_used; i++) { @@ -212,6 +214,7 @@ int keyboard_factory_test_scan(void) } done: gpio_config_module(MODULE_KEYBOARD_SCAN, 1); + gpio_set_flags(GPIO_KBD_KSO2, flags); keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_CLOSED); return shorted; |