diff options
author | Hsu Henry <Henry.Hsu@quantatw.com> | 2014-11-20 10:31:29 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-20 08:27:24 +0000 |
commit | 4719560bc9edc7dd732689cc537c4c39f1542d00 (patch) | |
tree | 01104ddbdf60f8a12b96e3b182a68d8c62b3f955 | |
parent | 3a33bd91199b400089fe0696af7b779e3fb409d4 (diff) | |
download | chrome-ec-4719560bc9edc7dd732689cc537c4c39f1542d00.tar.gz |
Paine: keyboard fix to support old and new reset IC.
Paine use newer keyboard reset ic.
Some workaround is needed for old machine with old reset ic.
BUG=chrome-os-partner:33806
BRANCH=paine
TEST=flash the ec, the keys "3, e, d, c , ..." work in CrOS
with old machine.
Change-Id: I9167a3b0977013123e776b1cb71004e69d7dbb5a
Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/230981
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r-- | chip/lm4/keyboard_raw.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chip/lm4/keyboard_raw.c b/chip/lm4/keyboard_raw.c index 66d66de1fa..a063f53486 100644 --- a/chip/lm4/keyboard_raw.c +++ b/chip/lm4/keyboard_raw.c @@ -9,6 +9,7 @@ #include "keyboard_raw.h" #include "keyboard_scan.h" #include "registers.h" +#include "system.h" #include "task.h" void keyboard_raw_init(void) @@ -34,8 +35,13 @@ void keyboard_raw_init(void) * When column 2 is inverted, the Silego has a pulldown instead of a * pullup. So drive it push-pull instead of open-drain. */ +#ifdef BOARD_PAINE + if (0x04 != system_get_board_version()) + LM4_GPIO_ODR(LM4_GPIO_P) &= ~(1 << 2); +#else LM4_GPIO_ODR(LM4_GPIO_P) &= ~(1 << 2); #endif +#endif /* Set row inputs with pull-up */ LM4_GPIO_AFSEL(KB_SCAN_ROW_GPIO) &= 0xff; @@ -71,9 +77,15 @@ test_mockable void keyboard_raw_drive_column(int col) mask = 0x1fff ^ (1 << col); /* Assert a single output */ #ifdef CONFIG_KEYBOARD_COL2_INVERTED +#ifdef BOARD_PAINE + if (0x04 != system_get_board_version()) + /* Invert column 2 output */ + mask ^= (1 << 2); +#else /* Invert column 2 output */ mask ^= (1 << 2); #endif +#endif LM4_GPIO_DATA(LM4_GPIO_P, 0xff) = mask & 0xff; LM4_GPIO_DATA(LM4_GPIO_Q, 0x1f) = (mask >> 8) & 0x1f; |