diff options
author | ChromeOS Developer <dparker@chromium.org> | 2013-08-23 10:49:57 -0700 |
---|---|---|
committer | Dave Parker <dparker@chromium.org> | 2013-08-29 00:49:50 +0000 |
commit | 5ae493522661f961f2d7f80b1e28b99487a30c3a (patch) | |
tree | e6f39ae4b57518591ecdc9225624f625e3f9783a | |
parent | fdd33356a31c616457d546d2a1435282e9744355 (diff) | |
download | chrome-ec-5ae493522661f961f2d7f80b1e28b99487a30c3a.tar.gz |
Peppy: Enable PP5000 while checking initial keyboard state
BRANCH ONLY! Not for ToT.
Active ESD components on the keyboard scan matrix require 5V
power. These components must be powered to read the keyboard
state correctly. Check the keyboard 5mSec after powering
the 5V rail to wait for the keyboard state to settle down.
BUG=chrome-os-partner:22127
BRANCH=peppy
TEST=Manual.
Boot normally.
Boot normally with Esc + F3 + Power + another key.
Boot into recovery with Esc + F3 + Power.
Change-Id: I064cf6eb98b47c897079f145e945b4ab3ae4ef23
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/66835
-rw-r--r-- | common/keyboard_scan.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index 76db0b58f9..7632458cb7 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -20,6 +20,12 @@ #include "timer.h" #include "util.h" +#ifdef BOARD_peppy +/* HORRIBLE HACK: SEE crosbug.com/p/22127 DO NOT RE-USE */ +#include "gpio.h" +#define PEPPY_BOOTKEY_DELAY_USEC (5 * MSEC) +#endif /* BOARD_peppy */ + /* Console output macros */ #define CPUTS(outstr) cputs(CC_KEYSCAN, outstr) #define CPRINTF(format, args...) cprintf(CC_KEYSCAN, format, ## args) @@ -462,6 +468,11 @@ const uint8_t *keyboard_scan_get_state(void) void keyboard_scan_init(void) { +#ifdef BOARD_peppy + /* HORRIBLE HACK: SEE crosbug.com/p/22127 DO NOT RE-USE */ + int gpio_pp5000_prev_state; +#endif /* BOARD_peppy */ + /* Configure GPIO */ keyboard_raw_init(); @@ -470,6 +481,18 @@ void keyboard_scan_init(void) /* Initialize raw state */ read_matrix(debounced_state); + +#ifdef BOARD_peppy + /* HORRIBLE HACK: SEE crosbug.com/p/22127 DO NOT RE-USE */ + if (check_boot_key(debounced_state) != BOOT_KEY_NONE) { + gpio_pp5000_prev_state = gpio_get_level(GPIO_PP5000_EN); + gpio_set_level(GPIO_PP5000_EN, 1); + usleep(PEPPY_BOOTKEY_DELAY_USEC); + read_matrix(debounced_state); + gpio_set_level(GPIO_PP5000_EN, gpio_pp5000_prev_state); + } +#endif /* BOARD_peppy */ + memcpy(prev_state, debounced_state, sizeof(prev_state)); /* Check for keys held down at boot */ |