X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fi8042.h;h=963061920cbb3b94a28f54b0b20699842bf78b0b;hb=14bc66bd9a1d8073a12c6e785ab379909f620356;hp=61c9da2ea152dcc44b87d70dfa276448c2a5f0b2;hpb=1df49e27bca2b0d36a506b0da90f6e92771c0982;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/i8042.h b/include/i8042.h index 61c9da2..9630619 100644 --- a/include/i8042.h +++ b/include/i8042.h @@ -2,23 +2,7 @@ * (C) Copyright 2002 ELTEC Elektronik AG * Frank Gottschling * - * 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+ */ /* i8042.h - Intel 8042 keyboard driver header */ @@ -26,11 +10,24 @@ #ifndef _I8042_H_ #define _I8042_H_ +#ifdef __I386__ +#include +#include +#define in8(p) inb(p) +#define out8(p,v) outb(v,p) +#endif + /* defines */ -#define I8042_DATA_REG (CFG_ISA_IO + 0x0060) /* keyboard i/o buffer */ -#define I8042_STATUS_REG (CFG_ISA_IO + 0x0064) /* keyboard status read */ -#define I8042_COMMAND_REG (CFG_ISA_IO + 0x0064) /* keyboard ctrl write */ +#define I8042_DATA_REG (CONFIG_SYS_ISA_IO + 0x0060) /* keyboard i/o buffer */ +#define I8042_STATUS_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard status read */ +#define I8042_COMMAND_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard ctrl write */ + +enum { + /* Output register (I8042_DATA_REG) has data for system */ + I8042_STATUS_OUT_DATA = 1 << 0, + I8042_STATUS_IN_DATA = 1 << 1, +}; #define KBD_US 0 /* default US layout */ #define KBD_GER 1 /* german layout */ @@ -62,6 +59,19 @@ /* exports */ +/** + * Flush all buffer from keyboard controller to host. + */ +void i8042_flush(void); + +/** + * Disables the keyboard so that key strokes no longer generate scancodes to + * the host. + * + * @return 0 if ok, -1 if keyboard input was found while disabling + */ +int i8042_disable(void); + int i8042_kbd_init(void); int i8042_tstc(void); int i8042_getc(void);