From f4ff90502735102f1fbb68071d430229cb02b5af Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Thu, 6 Sep 2012 15:02:18 -0700 Subject: [PATCH] Add Alt+VolUp+H key combo to hibernate system This is needed for testing wake-from-hibernate. BUG=chrome-os-partner:13680 BRANCH=link (if needed for factory, else none) TEST=manual 1. Boot system. 2. alt+volup+h. System hibernates (unless you've got hardware issue 13680) 3. Press power button. System wakes. Change-Id: I66e1299a948bffe22c10863a4ffbe5c507e2c5dd Signed-off-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/32442 Reviewed-by: Simon Glass --- chip/lm4/keyboard_scan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chip/lm4/keyboard_scan.c b/chip/lm4/keyboard_scan.c index 9a1f45e2e1..826b1f8d3e 100644 --- a/chip/lm4/keyboard_scan.c +++ b/chip/lm4/keyboard_scan.c @@ -68,6 +68,8 @@ static const uint8_t actual_key_masks[4][KB_COLS] = { #define MASK_VALUE_LEFT_ALT 0x40 #define MASK_INDEX_KEY_R 3 #define MASK_VALUE_KEY_R 0x80 +#define MASK_INDEX_KEY_H 6 +#define MASK_VALUE_KEY_H 0x02 static void wait_for_interrupt(void) { @@ -163,6 +165,10 @@ static void check_runtime_keys(void) /* R = reboot */ CPRINTF("[%T KB warm reboot]\n"); x86_power_reset(0); + } else if (raw_state[MASK_INDEX_KEY_H] == MASK_VALUE_KEY_H) { + /* H = hibernate */ + CPRINTF("[%T KB hibernate]\n"); + system_hibernate(0, 0); } }