summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2013-06-24 10:40:48 -0700
committerChromeBot <chrome-bot@google.com>2013-06-24 15:44:24 -0700
commit6957684d304825cc6fd926c8ee7a2ccb1edb6839 (patch)
tree9ed2e6822de40fed24407fe2b90e993d46cc545a
parentf4ed65f3af709d0b59a582648d5ba5f97f29a1d0 (diff)
downloadchrome-ec-6957684d304825cc6fd926c8ee7a2ccb1edb6839.tar.gz
keyboard: Preserve keystroke enable state.stabilize-daisy-4319.96.Brelease-R29-4319.B
Preserve the state of keystroke_enabled to prevent keystrokes from being initially disabled on RO --> RW transition. This will allow us to use the keyboard on EC cold boot. BUG=chrome-os-partner:20430. TEST=Manual. Verify keyboard works on EC cold boot on Peppy. BRANCH=None. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I603a73ee0f8435c91d430a64803add345c92f025 Reviewed-on: https://gerrit.chromium.org/gerrit/59798 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r--common/keyboard_8042.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index 8e2646cb4a..f45c178908 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -133,12 +133,13 @@ static uint8_t typematic_scan_code[MAX_SCAN_CODE_LEN];
static timestamp_t typematic_deadline;
#define KB_SYSJUMP_TAG 0x4b42 /* "KB" */
-#define KB_HOOK_VERSION 1
+#define KB_HOOK_VERSION 2
/* the previous keyboard state before reboot_ec. */
struct kb_state {
uint8_t codeset;
uint8_t ctlram;
- uint8_t pad[2]; /* Pad to 4 bytes for system_add_jump_tag(). */
+ uint8_t keystroke_enabled;
+ uint8_t pad; /* Pad to 4 bytes for system_add_jump_tag(). */
};
/* The standard Chrome OS keyboard matrix table. */
@@ -1047,6 +1048,7 @@ static void keyboard_preserve_state(void)
state.codeset = scancode_set;
state.ctlram = controller_ram[0];
+ state.keystroke_enabled = keystroke_enabled;
system_add_jump_tag(KB_SYSJUMP_TAG, KB_HOOK_VERSION,
sizeof(state), &state);
@@ -1067,6 +1069,7 @@ static void keyboard_restore_state(void)
/* Coming back from a sysjump, so restore settings. */
scancode_set = prev->codeset;
update_ctl_ram(0, prev->ctlram);
+ keystroke_enabled = prev->keystroke_enabled;
}
}
DECLARE_HOOK(HOOK_INIT, keyboard_restore_state, HOOK_PRIO_DEFAULT);