summaryrefslogtreecommitdiff
path: root/drivers/keyboard.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-12-12 22:06:17 +0000
committerwdenk <wdenk>2004-12-12 22:06:17 +0000
commit7e6bf358d84b413b7a402079b130a9a2a1222d74 (patch)
treee721df75fe9c3d22042f628bfc98d878884fd3b8 /drivers/keyboard.c
parent25d6712a81b31fc5e4c4bddd81e9aaddb84e23be (diff)
downloadu-boot-imx-7e6bf358d84b413b7a402079b130a9a2a1222d74.zip
u-boot-imx-7e6bf358d84b413b7a402079b130a9a2a1222d74.tar.gz
u-boot-imx-7e6bf358d84b413b7a402079b130a9a2a1222d74.tar.bz2
Patch by Martin Krause, 27 Oct 2004:
- add support for "STK52xx" board (including PS/2 multiplexer) - add hardware detection for TQM5200
Diffstat (limited to 'drivers/keyboard.c')
-rw-r--r--drivers/keyboard.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/keyboard.c b/drivers/keyboard.c
index a42468f..f12de83 100644
--- a/drivers/keyboard.c
+++ b/drivers/keyboard.c
@@ -33,6 +33,10 @@
#define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */
+#ifdef CONFIG_MPC5xxx
+int ps2ser_check(void);
+#endif
+
static volatile char kbd_buffer[KBD_BUFFER_LEN];
static volatile int in_pointer = 0;
static volatile int out_pointer = 0;
@@ -71,6 +75,10 @@ static void kbd_put_queue(char data)
/* test if a character is in the queue */
static int kbd_testc(void)
{
+#ifdef CONFIG_MPC5xxx
+ /* no ISR is used, so received chars must be polled */
+ ps2ser_check();
+#endif
if(in_pointer==out_pointer)
return(0); /* no data */
else
@@ -81,7 +89,12 @@ static int kbd_testc(void)
static int kbd_getc(void)
{
char c;
- while(in_pointer==out_pointer);
+ while(in_pointer==out_pointer) {
+#ifdef CONFIG_MPC5xxx
+ /* no ISR is used, so received chars must be polled */
+ ps2ser_check();
+#endif
+ ;}
if((out_pointer+1)==KBD_BUFFER_LEN)
out_pointer=0;
else