summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2012-02-02 05:11:25 -0800
committerGerrit Code Review <gerrit@gerrit-int.golo.chromium.org>2012-02-02 05:11:25 -0800
commit038b86ca8ea0a08245399ca6bc07335d81b01662 (patch)
tree6187ab3a3c921872b56ed514f4f9499c2ae5b682 /include
parentb7f2a188592a55badae0636df0a2648c9bfa60f9 (diff)
parent7e8d739b3885a9180e0cf3fd01eae13779440832 (diff)
downloadchrome-ec-038b86ca8ea0a08245399ca6bc07335d81b01662.tar.gz
Merge "Fix the missing IRQ problem."
Diffstat (limited to 'include')
-rw-r--r--include/i8042.h13
-rw-r--r--include/lpc.h13
2 files changed, 26 insertions, 0 deletions
diff --git a/include/i8042.h b/include/i8042.h
index 440b19ad70..c3d858bee1 100644
--- a/include/i8042.h
+++ b/include/i8042.h
@@ -63,6 +63,9 @@
#define I8042_ENA_KB 0xae
#define I8042_ECHO_MOUSE 0xd3 /* expect a byte on port 0x60 */
#define I8042_SEND_TO_MOUSE 0xd4 /* expect a byte on port 0x60 */
+#define I8042_PULSE_START 0xf0
+#define I8042_PULSE_END 0xfd
+#define I8042_SYSTEM_RESET 0xfe
/* port 0x60 return value */
#define I8042_RET_BAT 0xaa
@@ -79,9 +82,12 @@
#define I8042_RET_ERR 0xff
/* port 64 - command byte bits */
+#define I8042_XLATE (1 << 6)
#define I8042_AUX_DIS (1 << 5)
+#define I8042_KBD_DIS (1 << 4)
#define I8042_SYS_FLAG (1 << 2)
#define I8042_ENIRQ12 (1 << 1)
+#define I8042_ENIRQ1 (1 << 0)
void i8042_init(void);
@@ -98,6 +104,13 @@ void i8042_receives_data(int data);
void i8042_receives_command(int cmd);
+/* Called by common/keyboard.c when the host doesn't want to receive
+ * keyboard IRQ.
+ */
+void i8042_enable_keyboard_irq(void);
+void i8042_disable_keyboard_irq(void);
+
+
/* Send the scan code to the host. The EC lib will push the scan code bytes
* to host via port 0x60 and assert the IBF flag to trigger an interrupt.
* The EC lib must queue them if the host cannot read the previous byte away
diff --git a/include/lpc.h b/include/lpc.h
index 8cf87668f6..94b92b41bb 100644
--- a/include/lpc.h
+++ b/include/lpc.h
@@ -10,6 +10,13 @@
#include "common.h"
+
+/* Manually generates an IRQ to host.
+ * Note that the irq_num == 0 would set the AH bit (Active High).
+ */
+void lpc_manual_irq(int irq_num);
+
+
/* Initializes the LPC module. */
int lpc_init(void);
@@ -25,6 +32,12 @@ uint8_t *lpc_get_host_range(int slot);
* commands, 1 for usermode-originated commands. */
void lpc_send_host_response(int slot, int status);
+/* Return true if the TOH is still set */
+int lpc_keyboard_has_char(void);
+
+/* Send a byte to host via port 0x60 and asserts IRQ if specified. */
+void lpc_keyboard_put_char(uint8_t chr, int send_irq);
+
/* Returns non-zero if the COMx interface has received a character. */
int lpc_comx_has_char(void);