summaryrefslogtreecommitdiff
path: root/chip/mec1322/keyboard_raw.c
diff options
context:
space:
mode:
authorDevin Lu <devin.lu@quantatw.com>2018-12-12 13:28:31 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-17 20:47:01 -0800
commit2577c1cddd38b7c0c04cb57f6941b10c205b99e7 (patch)
treef8a1a51a2ad520eb3f9b87235ff72bb1a483743f /chip/mec1322/keyboard_raw.c
parentc1b19edff6875060b8679c7579f76fd4b2cd2421 (diff)
downloadchrome-ec-2577c1cddd38b7c0c04cb57f6941b10c205b99e7.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/1373389 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/mec1322/keyboard_raw.c')
-rw-r--r--chip/mec1322/keyboard_raw.c5
1 files changed, 4 insertions, 1 deletions
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;