summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2020-02-27 15:08:32 -0700
committerCommit Bot <commit-bot@chromium.org>2020-03-02 06:55:23 +0000
commit5c04c6c6a45da6ee226249ef8ec6859931d9b26b (patch)
treebdfbbfdbdf2d8bccb9bbf56e3e93ac10eaac27ba
parent1066c43cb64399e75d810cd0b6d126c0d153407d (diff)
downloadchrome-ec-5c04c6c6a45da6ee226249ef8ec6859931d9b26b.tar.gz
include/lpc.h: Expose lpc_aux_put_char
* Expose lpc_aux_put_char so we can call it from common/keyboard_8042. * Renamed lpc_mouse_put_char to lpc_aux_put_char so it's more generic. * Added the send_irq parameter for parity with lpc_keyboard_put_char. BUG=b:145575366 BRANCH=none TEST=Verified it builds Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: I61854ed7c9b9ad1c50e55735747cfb25ca15762b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2079694 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--chip/npcx/lpc.c11
-rw-r--r--include/lpc.h8
2 files changed, 16 insertions, 3 deletions
diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c
index 1bcb5571b1..4e297654b8 100644
--- a/chip/npcx/lpc.c
+++ b/chip/npcx/lpc.c
@@ -314,12 +314,17 @@ void lpc_keyboard_put_char(uint8_t chr, int send_irq)
}
}
-/* Put a char to host buffer by HIMDO */
-void lpc_mouse_put_char(uint8_t chr)
+/* Put an aux char to host buffer by HIMDO and assert status bit 5. */
+void lpc_aux_put_char(uint8_t chr, int send_irq)
{
+ if (send_irq)
+ SET_BIT(NPCX_HICTRL, NPCX_HICTRL_OBFMIE);
+ else
+ CLEAR_BIT(NPCX_HICTRL, NPCX_HICTRL_OBFMIE);
+
NPCX_HIKMST |= I8042_AUX_DATA;
NPCX_HIMDO = chr;
- CPRINTS("Mouse put %02x", chr);
+ CPRINTS("AUX put %02x", chr);
/* Enable OBE interrupt to detect host read data out */
SET_BIT(NPCX_HICTRL, NPCX_HICTRL_OBECIE);
diff --git a/include/lpc.h b/include/lpc.h
index 8cbd29292c..2a69cbced8 100644
--- a/include/lpc.h
+++ b/include/lpc.h
@@ -36,6 +36,14 @@ int lpc_keyboard_input_pending(void);
void lpc_keyboard_put_char(uint8_t chr, int send_irq);
/**
+ * Send an aux byte to host via keyboard port 0x60.
+ *
+ * @param chr Byte to send
+ * @param send_irq If non-zero, asserts IRQ
+ */
+void lpc_aux_put_char(uint8_t chr, int send_irq);
+
+/**
* Clear the keyboard buffer.
*/
void lpc_keyboard_clear_buffer(void);