summaryrefslogtreecommitdiff
path: root/include/keyboard_8042.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-26 13:18:39 -0700
committerChromeBot <chrome-bot@google.com>2013-03-27 11:35:20 -0700
commitc2b94fd184e6f5df5e5d8fe4018055a29a96a064 (patch)
tree7ccb95f13ca0cf5ff21b67687b4bb8fe30ad06d3 /include/keyboard_8042.h
parent0a2603e8ea234a9263a0a2e6be5daed362c12d72 (diff)
downloadchrome-ec-c2b94fd184e6f5df5e5d8fe4018055a29a96a064.tar.gz
Move files in preparation for merging keyboard_scan modules
This is part one of a series to merge the keyboard scan interface to be common across all platforms. This change just moves and renames files and APIs and removes some read code, and sets up protocol-specific CONFIG options. It makes the next CL which actually merges keyboard scanning easier to parse. BUG=chrome-os-partner:18360 BRANCH=none TEST=compile all boards; test keyboard on spring and link Change-Id: I815a40aae4e5d5f333b8501aff9656080533d913 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46549 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/keyboard_8042.h')
-rw-r--r--include/keyboard_8042.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/keyboard_8042.h b/include/keyboard_8042.h
new file mode 100644
index 0000000000..2dcd0367ee
--- /dev/null
+++ b/include/keyboard_8042.h
@@ -0,0 +1,47 @@
+/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * The functions implemented by keyboard component of EC core.
+ */
+
+#ifndef __CROS_EC_KEYBOARD_8042_H
+#define __CROS_EC_KEYBOARD_8042_H
+
+#include "common.h"
+
+#define MAX_SCAN_CODE_LEN 4
+
+/**
+ * Handle the port 0x60 writes from host.
+ *
+ * This functions returns the number of bytes stored in *output buffer.
+ */
+int handle_keyboard_data(uint8_t data, uint8_t *output);
+
+/**
+ * Handle the port 0x64 writes from host.
+ *
+ * This functions returns the number of bytes stored in *output buffer.
+ * BUT theose bytes will appear at port 0x60.
+ */
+int handle_keyboard_command(uint8_t command, uint8_t *output);
+
+/**
+ * Called by keyboard scan code once any key state change (after de-bounce),
+ *
+ * This function will look up matrix table and convert scancode host.
+ */
+void keyboard_state_changed(int row, int col, int is_pressed);
+
+/**
+ * Send make/break code of power button to host.
+ */
+void keyboard_set_power_button(int pressed);
+
+/**
+ * Log the keyboard-related information
+ */
+void kblog_put(char type, uint8_t byte);
+
+#endif /* __CROS_EC_KEYBOARD_8042_H */