summaryrefslogtreecommitdiff
path: root/include/i8042.h
diff options
context:
space:
mode:
authorTerry Lambert <tlambert@chromium.org>2012-01-13 20:58:18 -0800
committerStefan Reinauer <reinauer@chromium.org>2012-01-17 17:02:40 -0800
commit3f68143724b1f6d94b4605faf514a5a0798b7d46 (patch)
tree5f72a0bcfe63b92b554d9456e3c048994592c0d5 /include/i8042.h
parent5ed4587d170920d7f1836baed6b8553735ebd5cf (diff)
Add generation of ANSI 3.64 escape sequences.
This adds support for generation of ANSI 3.64 escape sequences to the PS/2 keyboard driver. This change significantly refactors the code: o It adds an FSA to support 0xE0 and 0xE1 multibyte PS/2 scan code sequences. o It converts the PS/2 scan codes to USB scan code values to facilitate sharing upper level code in future changes. Reasons to use USB scan codes: o Standard o Simple conversion to ASCII / ANSI 3.64 o Ability to share complex processing / state code o Shared international keymaps in higher level code o It adds an ANSI 3.64 escape sequence generator for USB special keys; the intent of doing this is to allow the transparent use of PS/2, USB, and network or serial devices using the same upper level u-boot clients. o It adds an input FIFO which is an almost verbatim copy of the Tegra matrix keyboard driver; future changes are expected to share the FIFOcode among all keyboard drivers. International keyboard support is expected to be handled at a higher layer in the future, using a much smaller NRCS (National Replacement Character Set) table instead of a duplicat table. Combined, the changes reduce the overall source file size by about 5K, and removes about 4K from the data segment as well. Note: Use of typedef for FSA states allows compiler to prohibit switch statement without default case from omitting states. BUG=chrome-os-partner:6580 TEST=Removed backslash from generated 3.64 sequences, stopped boot at command line, verified character sequence generation. Signed-off-by: tlambert@chromium.org Change-Id: I00200c5ccefd44679335fb643b21794e5d77663a modified: drivers/input/i8042.c modified: include/i8042.h Change-Id: I22c692f7bd65da5848908fc71c6cd7d04753f135 Reviewed-on: https://gerrit.chromium.org/gerrit/14218 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Gabe Black (Do Not Use) <gabeblack@google.com> Tested-by: Terry Lambert <tlambert@chromium.org> Commit-Ready: Terry Lambert <tlambert@chromium.org>
Diffstat (limited to 'include/i8042.h')
-rw-r--r--include/i8042.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/i8042.h b/include/i8042.h
index 13952899bae..6f8e05af2c1 100644
--- a/include/i8042.h
+++ b/include/i8042.h
@@ -39,6 +39,35 @@
#define I8042_STATUS_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard status read */
#define I8042_COMMAND_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard ctrl write */
+/* Status register bits */
+#define I8042_STR_PARITY 0x80
+#define I8042_STR_TIMEOUT 0x40
+#define I8042_STR_AUXDATA 0x20
+#define I8042_STR_KEYLOCK 0x10
+#define I8042_STR_CMDDAT 0x08
+#define I8042_STR_MUXERR 0x04
+#define I8042_STR_IBF 0x02
+#define I8042_STR_OBF 0x01
+
+/* Command port commands (to i8042 controller) */
+#define I8042_CMD_SET_CMD_BYTE 0x60
+#define I8042_CMD_ENABLE_KBD 0xae
+
+/* Data port commands (to PS/2 device) */
+#define I8042_DATA_LED_WRITE 0xed
+#define I8042_DATA_KBD_RESET 0xff
+
+/* LED bits */
+#define I8042_LED_SCROLL_LOCK 0x01
+#define I8042_LED_NUM_LOCK 0x02
+#define I8042_LED_CAPS_LOCK 0x04
+#define I8042_LED_MASK (I8042_LED_SCROLL_LOCK | \
+ I8042_LED_NUM_LOCK | \
+ I8042_LED_CAPS_LOCK)
+
+
+
+
#define KBD_US 0 /* default US layout */
#define KBD_GER 1 /* german layout */