summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerrit <chrome-bot@google.com>2012-03-20 09:26:18 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-03-20 09:26:18 -0700
commit61748b4f04cd8d66c094a03bef0095c8c6a427dd (patch)
treeb88e43a5983eedda8658342fccb82e45c119b4d4
parentdfa34083c58e216bfe595ff54d2adcc39efaa55f (diff)
parentf8f802cbb8ad553dee8ba3fb713c7a926f369095 (diff)
downloadchrome-ec-61748b4f04cd8d66c094a03bef0095c8c6a427dd.tar.gz
Merge "Keyboard wakeup."
-rw-r--r--common/keyboard.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/keyboard.c b/common/keyboard.c
index 54386ac2ec..78864755cb 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -10,6 +10,8 @@
#include "console.h"
#include "keyboard.h"
#include "i8042.h"
+#include "lpc.h"
+#include "lpc_commands.h"
#include "registers.h"
#include "timer.h"
#include "uart.h"
@@ -214,6 +216,19 @@ static void clean_underlying_buffer(void) {
}
+/* TODO: Move this implementation to platform-dependent files.
+ * We don't do it now because not every board implement x86_power.c
+ * bds: no CONFIG_LPC and no CONFIG_TASK_X86POWER
+ * daisy(variants): no CONFIG_LPC and no CONFIG_TASK_X86POWER
+ * crosbug.com/p/8523
+ */
+static void keyboard_wakeup(void) {
+#ifdef CONFIG_LPC
+ lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(EC_LPC_HOST_EVENT_KEY_PRESSED));
+#endif
+}
+
+
void keyboard_state_changed(int row, int col, int is_pressed) {
uint8_t scan_code[MAX_SCAN_CODE_LEN];
int32_t len;
@@ -234,6 +249,10 @@ void keyboard_state_changed(int row, int col, int is_pressed) {
* assertion in the debug stage. */
ASSERT(ret == EC_SUCCESS);
}
+
+ if (is_pressed) {
+ keyboard_wakeup();
+ }
}