]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/input/keyboard.c
Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq
[karo-tx-uboot.git] / drivers / input / keyboard.c
index 9975202d7a226b81a20b685fc46133b3a4ad8664..be0f3330dbc637f76bf239e0f51ac3e4835f0316 100644 (file)
@@ -3,7 +3,6 @@
  * (C) Copyright 2004
  * DENX Software Engineering
  * Wolfgang Denk, wd@denx.de
- * All rights reserved.
  *
  * Keyboard driver
  *
@@ -11,9 +10,7 @@
 
 #include <common.h>
 
-#ifdef CONFIG_PS2KBD
-
-#include <devices.h>
+#include <stdio_dev.h>
 #include <keyboard.h>
 
 #undef KBG_DEBUG
@@ -73,7 +70,7 @@ static void kbd_put_queue(char data)
 }
 
 /* test if a character is in the queue */
-static int kbd_testc(void)
+static int kbd_testc(struct stdio_dev *dev)
 {
 #if defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
        /* no ISR is used, so received chars must be polled */
@@ -86,7 +83,7 @@ static int kbd_testc(void)
 }
 
 /* gets the character from the queue */
-static int kbd_getc(void)
+static int kbd_getc(struct stdio_dev *dev)
 {
        char c;
        while(in_pointer==out_pointer) {
@@ -260,30 +257,28 @@ void handle_scancode(unsigned char scancode)
  * Init
  ******************************************************************/
 
-#ifdef CFG_CONSOLE_OVERWRITE_ROUTINE
+#ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
 extern int overwrite_console (void);
 #define OVERWRITE_CONSOLE overwrite_console ()
 #else
 #define OVERWRITE_CONSOLE 0
-#endif /* CFG_CONSOLE_OVERWRITE_ROUTINE */
+#endif /* CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE */
 
 int kbd_init (void)
 {
        int error;
-       device_t kbddev ;
+       struct stdio_dev kbddev ;
        char *stdinname  = getenv ("stdin");
 
        if(kbd_init_hw()==-1)
                return -1;
-       memset (&kbddev, 0, sizeof(kbddev));
-       strcpy(kbddev.name, DEVNAME);
-       kbddev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-       kbddev.putc = NULL ;
-       kbddev.puts = NULL ;
+       memset (&kbddev, 0, sizeof(kbddev));
+       strcpy(kbddev.name, DEVNAME);
+       kbddev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
-       error = device_register (&kbddev);
+       error = stdio_register (&kbddev);
        if(error==0) {
                /* check if this is the standard input device */
                if(strcmp(stdinname,DEVNAME)==0) {
@@ -301,5 +296,3 @@ int kbd_init (void)
        }
        return error;
 }
-
-#endif /* CONFIG_PS2KBD */