From 6957684d304825cc6fd926c8ee7a2ccb1edb6839 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Mon, 24 Jun 2013 10:40:48 -0700 Subject: keyboard: Preserve keystroke enable state. 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 Change-Id: I603a73ee0f8435c91d430a64803add345c92f025 Reviewed-on: https://gerrit.chromium.org/gerrit/59798 Reviewed-by: Duncan Laurie --- common/keyboard_8042.c | 7 +++++-- 1 file 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); -- cgit v1.2.1