]> git.sur5r.net Git - u-boot/blobdiff - board/mpl/common/kbd.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[u-boot] / board / mpl / common / kbd.c
index 931ed43083a6d9430ff171114b8c41779ac5d370..1b5487b144c838c22040fe09bc668e239dbed897 100644 (file)
@@ -2,33 +2,14 @@
  * (C) Copyright 2001
  * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * Source partly derived from:
  * linux/drivers/char/pc_keyb.c
- *
- *
  */
 #include <common.h>
 #include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "isa.h"
 #include "kbd.h"
 
@@ -203,7 +184,7 @@ int isa_kbd_init(void)
        }
 }
 
-#ifdef CFG_CONSOLE_OVERWRITE_ROUTINE
+#ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
 extern int overwrite_console (void);
 #else
 int overwrite_console (void)
@@ -215,7 +196,7 @@ int overwrite_console (void)
 int drv_isa_kbd_init (void)
 {
        int error;
-       device_t kbddev ;
+       struct stdio_dev kbddev ;
        char *stdinname  = getenv ("stdin");
 
        if(isa_kbd_init()==-1)
@@ -228,7 +209,7 @@ int drv_isa_kbd_init (void)
        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) {
@@ -452,22 +433,22 @@ unsigned char handle_kbd_event(void)
  */
 unsigned char kbd_read_status(void)
 {
-       return(in8(CFG_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT));
+       return(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT));
 }
 
 unsigned char kbd_read_input(void)
 {
-       return(in8(CFG_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT));
+       return(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT));
 }
 
 void kbd_write_command(unsigned char cmd)
 {
-       out8(CFG_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT,cmd);
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT,cmd);
 }
 
 void kbd_write_output(unsigned char data)
 {
-       out8(CFG_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT, data);
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT, data);
 }
 
 int kbd_read_data(void)
@@ -475,7 +456,7 @@ int kbd_read_data(void)
        int val;
        unsigned char status;
 
-       val=-1;
+       val = -1;
        status = kbd_read_status();
        if (status & KBD_STAT_OBF) {
                val = kbd_read_input();