Commit 66562390 authored by Vojtech Pavlik's avatar Vojtech Pavlik

This is the last and most important step in the input core conversion.

It removes pc_keyb and keybdev, connecting keyboard.c straight into
the input core. No arch specific keyboard.c code anymore - every
keyboard driver is now expected to be an input driver.
parent ea675330
......@@ -7,7 +7,6 @@
#include <linux/slab.h>
#include <asm/io.h>
#include <linux/pm.h>
#include <asm/keyboard.h>
#include <asm/system.h>
#include <linux/bootmem.h>
......@@ -393,21 +392,13 @@ static __init int init_ints_after_s1(struct dmi_blacklist *d)
}
/*
* Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it
* was disabled before the suspend. Linux gets terribly confused by that.
* Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
* disabled before the suspend. Linux used to get terribly confused by that.
*/
typedef void (pm_kbd_func) (void);
static __init int broken_ps2_resume(struct dmi_blacklist *d)
{
#ifdef CONFIG_VT
if (pm_kbd_request_override == NULL)
{
pm_kbd_request_override = pckbd_pm_resume;
printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround enabled.\n", d->ident);
}
#endif
printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident);
return 0;
}
......
......@@ -633,25 +633,6 @@ CONFIG_BUSMOUSE
The module will be called busmouse.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
CONFIG_PSMOUSE
The PS/2 mouse connects to a special mouse port that looks much like
the keyboard port (small circular connector with 6 pins). This way,
the mouse does not use any serial ports. This port can also be used
for other input devices like light pens, tablets, keypads. Compaq,
AST and IBM all use this as their mouse port on currently shipping
machines. The trackballs of some laptops are PS/2 mice also. In
particular, the C&T 82C710 mouse on TI Travelmates is a PS/2 mouse.
Although PS/2 mice are not technically bus mice, they are explained
in detail in the Busmouse-HOWTO, available from
<http://www.linuxdoc.org/docs.html#howto>.
When using a PS/2 mouse, you can get problems if you want to use the
mouse both on the Linux console and under X. Using the "-R" option
of the Linux mouse managing program gpm (available from
<ftp://gnu.systemy.it/pub/gpm/>) solves this problem, or you can get
the "mconv2" utility from <ftp://ibiblio.org/pub/Linux/system/mouse/>.
CONFIG_QIC02_TAPE
If you have a non-SCSI tape drive like that, say Y. Or, if you want
to compile this driver as a module ( = code which can be inserted in
......
......@@ -58,8 +58,6 @@ if [ "$CONFIG_IT8712" = "y" ]; then
if [ "$CONFIG_QTRONIX_KEYBOARD" = "y" ]; then
define_bool CONFIG_IT8172_CIR y
else
bool ' Enable PS2 Keyboard Support' CONFIG_PC_KEYB
fi
bool 'Enable Smart Card Reader 0 Support ' CONFIG_IT8172_SCR0
bool 'Enable Smart Card Reader 1 Support ' CONFIG_IT8172_SCR1
fi
......@@ -89,7 +87,6 @@ source drivers/i2c/Config.in
mainmenu_option next_comment
comment 'Mice'
tristate 'Bus Mouse Support' CONFIG_BUSMOUSE
bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
endmenu
tristate 'QIC-02 tape support' CONFIG_QIC02_TAPE
......
......@@ -17,115 +17,27 @@ export-objs := busmouse.o console.o keyboard.o sysrq.o \
sonypi.o tty_io.o tty_ioctl.o generic_serial.o rtc.o \
ip2main.o
KEYMAP =defkeymap.o
KEYBD =pc_keyb.o
CONSOLE =console.o
ifeq ($(ARCH),s390)
KEYMAP =
KEYBD =
CONSOLE =
endif
ifeq ($(ARCH),mips)
ifneq ($(CONFIG_PC_KEYB),y)
KEYBD =
ifneq ($(ARCH),s390)
ifneq ($(ARCH),s390x)
ifneq ($(ARCH),um)
KEYMAP =defkeymap.o
CONSOLE =console.o
endif
endif
ifeq ($(ARCH),s390x)
KEYMAP =
KEYBD =
CONSOLE =
endif
ifeq ($(ARCH),m68k)
ifdef CONFIG_AMIGA
KEYBD = amikeyb.o
else
KEYBD =
endif
endif
ifdef CONFIG_Q40
KEYBD += q40_keyb.o
SERIAL = serial.o
endif
ifdef CONFIG_APOLLO
KEYBD += dn_keyb.o
endif
ifeq ($(ARCH),arm)
ifneq ($(CONFIG_PC_KEYMAP),y)
KEYMAP =
endif
ifneq ($(CONFIG_PC_KEYB),y)
KEYBD =
endif
endif
ifeq ($(ARCH),um)
KEYMAP =
KEYBD =
CONSOLE =
endif
ifeq ($(ARCH),sh)
KEYMAP =
KEYBD =
CONSOLE =
ifeq ($(CONFIG_SH_HP600),y)
KEYMAP = defkeymap.o
KEYBD = scan_keyb.o hp600_keyb.o
CONSOLE = console.o
endif
ifeq ($(CONFIG_SH_DMIDA),y)
# DMIDA does not connect the HD64465 PS/2 keyboard port
# but we allow for USB keyboards to be plugged in.
KEYMAP = defkeymap.o
KEYBD = # hd64465_keyb.o pc_keyb.o
CONSOLE = console.o
endif
ifeq ($(CONFIG_SH_EC3104),y)
KEYMAP = defkeymap.o
KEYBD = ec3104_keyb.o
CONSOLE = console.o
endif
ifeq ($(CONFIG_SH_DREAMCAST),y)
KEYMAP = defkeymap.o
KEYBD =
CONSOLE = console.o
endif
endif
ifeq ($(CONFIG_DECSTATION),y)
KEYMAP =
KEYBD =
SERIAL = decserial.o
endif
ifeq ($(CONFIG_BAGET_MIPS),y)
KEYBD =
endif
ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
KEYBD = qtronix.o
KEYMAP = qtronixmap.o
endif
ifeq ($(CONFIG_SPARC32),y)
KEYBD =
endif
ifeq ($(CONFIG_SPARC64),y)
KEYBD =
endif
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
#obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP)
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,16 +15,6 @@ CONFIG_INPUT
The module will be called input.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_KEYBDEV
Say Y here if you want your keyboard to be able to serve as a system
keyboard. This is needed in most cases. The only exceptions are
headless and embedded systems.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called keybdev.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_MOUSEDEV
Say Y here if you want your mouse to be accessible as char devices
13:32+ - /dev/input/mouseX and 13:63 - /dev/input/mice as an
......
......@@ -8,7 +8,6 @@ comment 'Input device support'
tristate 'Input core support' CONFIG_INPUT
comment 'Userland interfaces'
dep_tristate ' Keyboard interface' CONFIG_INPUT_KEYBDEV $CONFIG_INPUT
dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
dep_mbool ' Provide legacy /dev/psaux device' CONFIG_INPUT_MOUSEDEV_PSAUX $CONFIG_INPUT
if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then
......
......@@ -9,7 +9,6 @@ export-objs := input.o
# Each configuration option enables a list of files.
obj-$(CONFIG_INPUT) += input.o
obj-$(CONFIG_INPUT_KEYBDEV) += keybdev.o
obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o
obj-$(CONFIG_INPUT_JOYDEV) += joydev.o
obj-$(CONFIG_INPUT_EVDEV) += evdev.o
......
/*
* $Id: keybdev.c,v 1.19 2002/03/13 10:09:20 vojtech Exp $
*
* Copyright (c) 1999-2001 Vojtech Pavlik
*
* Input core to console keyboard binding.
*/
/*
* 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
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/
#include <linux/config.h>
#include <linux/kbd_ll.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/kbd_kern.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Input core to console keyboard binding");
MODULE_LICENSE("GPL");
char keybdev_name[] = "keyboard";
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(__alpha__) || \
defined(__mips__) || defined(CONFIG_SPARC64) || defined(CONFIG_SUPERH) || \
defined(CONFIG_PPC) || defined(__mc68000__) || defined(__hppa__) || \
defined(__arm__) || defined(__x86_64__)
static int x86_sysrq_alt = 0;
#ifdef CONFIG_SPARC64
static int sparc_l1_a_state = 0;
#endif
static unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 43, 85, 86, 87, 88,115,119,120,121,375,123, 90,
284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
367,294,293,286,350, 92,334,512,116,377,109,111,373,347,348,349,
360, 93, 94, 95, 98,376,100,101,357,316,354,304,289,102,351,355,
103,104,105,275,281,272,306,106,274,107,288,364,358,363,362,361,
291,108,381,290,287,292,279,305,280, 99,112,257,258,113,270,114,
118,117,125,374,379,115,112,125,121,123,264,265,266,267,268,269,
271,273,276,277,278,282,283,295,296,297,299,300,301,302,303,307,
308,310,313,314,315,317,318,319,320,321,322,323,324,325,326,330,
332,340,341,342,343,344,345,346,356,359,365,368,369,370,371,372 };
#ifdef CONFIG_MAC_EMUMOUSEBTN
extern int mac_hid_mouse_emulate_buttons(int, int, int);
#endif /* CONFIG_MAC_EMUMOUSEBTN */
static int emulate_raw(unsigned int keycode, int down)
{
#ifdef CONFIG_MAC_EMUMOUSEBTN
if (mac_hid_mouse_emulate_buttons(1, keycode, down))
return 0;
#endif /* CONFIG_MAC_EMUMOUSEBTN */
if (keycode > 255 || !x86_keycodes[keycode])
return -1;
if (keycode == KEY_PAUSE) {
handle_scancode(0xe1, 1);
handle_scancode(0x1d, down);
handle_scancode(0x45, down);
return 0;
}
if (keycode == KEY_SYSRQ && x86_sysrq_alt) {
handle_scancode(0x54, down);
return 0;
}
#ifdef CONFIG_SPARC64
if (keycode == KEY_A && sparc_l1_a_state) {
sparc_l1_a_state = 0;
sun_do_break();
}
#endif
if (x86_keycodes[keycode] & 0x100)
handle_scancode(0xe0, 1);
handle_scancode(x86_keycodes[keycode] & 0x7f, down);
if (keycode == KEY_SYSRQ) {
handle_scancode(0xe0, 1);
handle_scancode(0x37, down);
}
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
x86_sysrq_alt = down;
#ifdef CONFIG_SPARC64
if (keycode == KEY_STOP)
sparc_l1_a_state = down;
#endif
return 0;
}
#endif /* CONFIG_X86 || CONFIG_IA64 || __alpha__ || __mips__ || CONFIG_PPC */
static struct input_handler keybdev_handler;
void keybdev_ledfunc(unsigned int led)
{
struct input_handle *handle;
for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(led & 0x01));
input_event(handle->dev, EV_LED, LED_NUML, !!(led & 0x02));
input_event(handle->dev, EV_LED, LED_CAPSL, !!(led & 0x04));
input_sync(handle->dev);
}
}
/* Tell the user who may be running in X and not see the console that we have
panic'ed. This is to distingush panics from "real" lockups.
Could in theory send the panic message as morse, but that is left as an
exercise for the reader. */
void panic_blink(void)
{
static unsigned long last_jiffie;
static char led;
/* Roughly 1/2s frequency. KDB uses about 1s. Make sure it is different. */
if (time_after(jiffies, last_jiffie + HZ/2)) {
led ^= 0x01 | 0x04;
keybdev_ledfunc(led);
last_jiffie = jiffies;
}
}
void keybdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int down)
{
if (type != EV_KEY) return;
emulate_raw(code, down);
tasklet_schedule(&keyboard_tasklet);
}
static struct input_handle *keybdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id)
{
struct input_handle *handle;
int i;
for (i = KEY_ESC; i < BTN_MISC; i++)
if (test_bit(i, dev->keybit))
break;
if (i == BTN_MISC)
return NULL;
if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
return NULL;
memset(handle, 0, sizeof(struct input_handle));
handle->dev = dev;
handle->name = keybdev_name;
handle->handler = handler;
input_open_device(handle);
return handle;
}
static void keybdev_disconnect(struct input_handle *handle)
{
input_close_device(handle);
kfree(handle);
}
static struct input_device_id keybdev_ids[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT(EV_KEY) },
},
{ }, /* Terminating entry */
};
MODULE_DEVICE_TABLE(input, keybdev_ids);
static struct input_handler keybdev_handler = {
.event = keybdev_event,
.connect = keybdev_connect,
.disconnect = keybdev_disconnect,
.name = "keybdev",
.id_table = keybdev_ids,
};
static int __init keybdev_init(void)
{
input_register_handler(&keybdev_handler);
kbd_ledfunc = keybdev_ledfunc;
return 0;
}
static void __exit keybdev_exit(void)
{
kbd_ledfunc = NULL;
input_unregister_handler(&keybdev_handler);
}
module_init(keybdev_init);
module_exit(keybdev_exit);
/*
* linux/include/asm-alpha/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
*/
/*
* This file contains the alpha architecture specific keyboard definitions
*/
#ifndef _ALPHA_KEYBOARD_H
#define _ALPHA_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern void pckbd_init_hw(void);
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define INIT_KBD
#define SYSRQ_KEY 0x54
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
/* Jensen puts this at 9, everyone else at the standard 12. */
#define AUX_IRQ (RTC_PORT(0) == 0x170 ? 9 : 12)
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* __ASMalpha_KEYBOARD_H */
/*
* linux/include/asm-arm/keyboard.h
*
* Copyright (C) 1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Keyboard driver definitions for ARM
*/
#ifndef __ASM_ARM_KEYBOARD_H
#define __ASM_ARM_KEYBOARD_H
#include <linux/kd.h>
#include <linux/pm.h>
/*
* We provide a unified keyboard interface when in VC_MEDIUMRAW
* mode. This means that all keycodes must be common between
* all supported keyboards. This unfortunately puts us at odds
* with the PC keyboard interface chip... but we can't do anything
* about that now.
*/
#ifdef __KERNEL__
extern int (*k_setkeycode)(unsigned int, unsigned int);
extern int (*k_getkeycode)(unsigned int);
extern int (*k_translate)(unsigned char, unsigned char *, char);
extern char (*k_unexpected_up)(unsigned char);
extern void (*k_leds)(unsigned char);
static inline int kbd_setkeycode(unsigned int sc, unsigned int kc)
{
int ret = -EINVAL;
if (k_setkeycode)
ret = k_setkeycode(sc, kc);
return ret;
}
static inline int kbd_getkeycode(unsigned int sc)
{
int ret = -EINVAL;
if (k_getkeycode)
ret = k_getkeycode(sc);
return ret;
}
static inline void kbd_leds(unsigned char leds)
{
if (k_leds)
k_leds(leds);
}
extern int k_sysrq_key;
extern unsigned char *k_sysrq_xlate;
#define SYSRQ_KEY k_sysrq_key
#define kbd_sysrq_xlate k_sysrq_xlate
#define kbd_translate k_translate
#define kbd_unexpected_up k_unexpected_up
#include <asm/arch/keyboard.h>
#endif /* __KERNEL__ */
#endif /* __ASM_ARM_KEYBOARD_H */
/*
* linux/include/asm-i386/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
*/
/*
* This file contains the i386 architecture specific keyboard definitions
*/
#ifndef _I386_KEYBOARD_H
#define _I386_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <linux/pm.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern void pckbd_init_hw(void);
extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
extern pm_callback pm_kbd_request_override;
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define SYSRQ_KEY 0x54
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#define AUX_IRQ 12
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* _I386_KEYBOARD_H */
#ifndef _ASM_IA64_KEYBOARD_H
#define _ASM_IA64_KEYBOARD_H
/*
* This file contains the ia64 architecture specific keyboard definitions.
*
* Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
* Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
*/
# ifdef __KERNEL__
#include <linux/irq.h>
#include <linux/kd.h>
#define KEYBOARD_IRQ isa_irq_to_vector(1)
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern unsigned char acpi_kbd_controller_present;
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_pretranslate(unsigned char scancode, char raw_mode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern void pckbd_init_hw(void);
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_controller_present() acpi_kbd_controller_present
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_pretranslate pckbd_pretranslate
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define INIT_KBD
#define SYSRQ_KEY 0x54
#define E1_PAUSE 119 /* PAUSE key */
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, "keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#define AUX_IRQ isa_irq_to_vector(12)
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
# endif /* __KERNEL__ */
#endif /* _ASM_IA64_KEYBOARD_H */
/*
* linux/include/asm-m68k/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
*/
/*
* This file contains the m68k architecture specific keyboard definitions
*/
#ifndef __M68K_KEYBOARD_H
#define __M68K_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/kd.h>
#include <asm/machdep.h>
#ifdef CONFIG_Q40
#include <asm/q40_keyboard.h>
#endif
static __inline__ int kbd_setkeycode(unsigned int scancode,
unsigned int keycode)
{
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
return q40kbd_setkeycode(scancode,keycode);
#endif
return -EOPNOTSUPP;
}
static __inline__ int kbd_getkeycode(unsigned int scancode)
{
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
return q40kbd_getkeycode(scancode);
#endif
return scancode > 127 ? -EINVAL : scancode;
}
static __inline__ char kbd_unexpected_up(unsigned char keycode)
{
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
return q40kbd_unexpected_up(keycode);
#endif
return 0200;
}
static __inline__ void kbd_leds(unsigned char leds)
{
if (mach_kbd_leds)
mach_kbd_leds(leds);
}
#define kbd_init_hw mach_keyb_init
#define kbd_translate mach_kbd_translate
#define kbd_rate mach_kbdrate
#define kbd_sysrq_xlate mach_sysrq_xlate
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler)
extern unsigned int SYSRQ_KEY;
#endif /* __KERNEL__ */
#endif /* __M68K_KEYBOARD_H */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994 - 1999, 2001 Ralf Baechle
* Copyright (C) 2001 MIPS Technologies, Inc.
*/
#ifndef _ASM_KEYBOARD_H
#define _ASM_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/bootinfo.h>
#define DISABLE_KBD_DURING_INTERRUPTS 0
#ifdef CONFIG_PC_KEYB
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern int pckbd_rate(struct kbd_repeat *rep);
extern void pckbd_init_hw(void);
extern unsigned char pckbd_sysrq_xlate[128];
extern void kbd_forward_char (int ch);
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_rate pckbd_rate
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#else
extern int kbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int kbd_getkeycode(unsigned int scancode);
extern int kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char kbd_unexpected_up(unsigned char keycode);
extern void kbd_leds(unsigned char leds);
extern void kbd_init_hw(void);
extern unsigned char *kbd_sysrq_xlate;
#endif
#define SYSRQ_KEY 0x54
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
struct kbd_ops {
/* Keyboard driver resource allocation */
void (*kbd_request_region)(void);
int (*kbd_request_irq)(void (*handler)(int, void *, struct pt_regs *));
/* PSaux driver resource management */
int (*aux_request_irq)(void (*handler)(int, void *, struct pt_regs *));
void (*aux_free_irq)(void);
/* Methods to access the keyboard processor's I/O registers */
unsigned char (*kbd_read_input)(void);
void (*kbd_write_output)(unsigned char val);
void (*kbd_write_command)(unsigned char val);
unsigned char (*kbd_read_status)(void);
};
extern struct kbd_ops *kbd_ops;
/* Do the actual calls via kbd_ops vector */
#define kbd_request_region() kbd_ops->kbd_request_region()
#define kbd_request_irq(handler) kbd_ops->kbd_request_irq(handler)
#define aux_request_irq(hand, dev_id) kbd_ops->aux_request_irq(hand)
#define aux_free_irq(dev_id) kbd_ops->aux_free_irq()
#define kbd_read_input() kbd_ops->kbd_read_input()
#define kbd_write_output(val) kbd_ops->kbd_write_output(val)
#define kbd_write_command(val) kbd_ops->kbd_write_command(val)
#define kbd_read_status() kbd_ops->kbd_read_status()
#endif /* __KERNEL */
#endif /* _ASM_KEYBOARD_H */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994 - 1999, 2001 Ralf Baechle
* Copyright (C) 2001 MIPS Technologies, Inc.
*/
#ifndef _ASM_KEYBOARD_H
#define _ASM_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/bootinfo.h>
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern int pckbd_rate(struct kbd_repeat *rep);
extern void pckbd_init_hw(void);
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_rate pckbd_rate
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define SYSRQ_KEY 0x54
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
struct kbd_ops {
/* Keyboard driver resource allocation */
void (*kbd_request_region)(void);
int (*kbd_request_irq)(void (*handler)(int, void *, struct pt_regs *));
/* PSaux driver resource management */
int (*aux_request_irq)(void (*handler)(int, void *, struct pt_regs *));
void (*aux_free_irq)(void);
/* Methods to access the keyboard processor's I/O registers */
unsigned char (*kbd_read_input)(void);
void (*kbd_write_output)(unsigned char val);
void (*kbd_write_command)(unsigned char val);
unsigned char (*kbd_read_status)(void);
};
extern struct kbd_ops *kbd_ops;
/* Do the actual calls via kbd_ops vector */
#define kbd_request_region() kbd_ops->kbd_request_region()
#define kbd_request_irq(handler) kbd_ops->kbd_request_irq(handler)
#define aux_request_irq(hand, dev_id) kbd_ops->aux_request_irq(hand)
#define aux_free_irq(dev_id) kbd_ops->aux_free_irq()
#define kbd_read_input() kbd_ops->kbd_read_input()
#define kbd_write_output(val) kbd_ops->kbd_write_output(val)
#define kbd_write_command(val) kbd_ops->kbd_write_command(val)
#define kbd_read_status() kbd_ops->kbd_read_status()
#endif /* __KERNEL */
#endif /* _ASM_KEYBOARD_H */
/*
* linux/include/asm-parisc/keyboard.h
*
* Original by Geert Uytterhoeven
* updates by Alex deVries <adevries@thepuffingroup.com>
* portions copyright (1999) The Puffin Group
* mostly rewritten by Philipp Rumpf <prumpf@tux.org>,
* Copyright 2000 Philipp Rumpf
*/
/*
* We try to keep the amount of generic code as low as possible -
* we want to support all HIL, PS/2, and untranslated USB keyboards
*/
#ifndef _PARISC_KEYBOARD_H
#define _PARISC_KEYBOARD_H
#include <linux/config.h>
#ifdef __KERNEL__
#ifdef CONFIG_VT
/* These are basically the generic functions / variables. The only
* unexpected detail is the initialization sequence for the keyboard
* driver is something like this:
*
* detect keyboard port
* detect keyboard
* call register_kbd_ops
* wait for init_hw
*
* only after init_hw has been called you're allowed to call
* handle_scancode. This means you either have to be extremely
* careful or use a global flag or something - I strongly suggest
* the latter. prumpf */
extern struct kbd_ops {
int (*setkeycode)(unsigned int, unsigned int);
int (*getkeycode)(unsigned int);
int (*translate)(unsigned char, unsigned char *, char);
char (*unexpected_up)(unsigned char);
void (*leds)(unsigned char);
void (*init_hw)(void);
unsigned char sysrq_key;
unsigned char *sysrq_xlate;
} *kbd_ops;
#define kbd_setkeycode (*kbd_ops->setkeycode)
#define kbd_getkeycode (*kbd_ops->getkeycode)
#define kbd_translate (*kbd_ops->translate)
#define kbd_unexpected_up (*kbd_ops->unexpected_up)
#define kbd_leds (*kbd_ops->leds)
#define kbd_init_hw (*kbd_ops->init_hw)
#define SYSRQ_KEY (kbd_ops->sysrq_key)
#define kbd_sysrq_xlate (kbd_ops->sysrq_xlate)
extern unsigned char hp_ps2kbd_sysrq_xlate[128]; /* from drivers/char/hp_keyb.c */
extern void register_kbd_ops(struct kbd_ops *ops);
#endif /* CONFIG_VT */
#endif /* __KERNEL__ */
#endif /* __ASMPARISC_KEYBOARD_H */
/*
* BK Id: %F% %I% %G% %U% %#%
*/
/*
* linux/include/asm-ppc/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
* Modified for Power Macintosh by Paul Mackerras
*/
/*
* This file contains the ppc architecture specific keyboard definitions -
* like the intel pc for prep systems, different for power macs.
*/
#ifndef __ASM_KEYBOARD_H__
#define __ASM_KEYBOARD_H__
#ifdef __KERNEL__
#include <linux/adb.h>
#include <asm/machdep.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/io.h>
#ifndef KEYBOARD_IRQ
#define KEYBOARD_IRQ 1
#endif
#define DISABLE_KBD_DURING_INTERRUPTS 0
#define INIT_KBD
extern int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char mac_hid_kbd_unexpected_up(unsigned char keycode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern unsigned char pckbd_sysrq_xlate[128];
static inline int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
{
return 0;
}
static inline int kbd_getkeycode(unsigned int scancode)
{
return 0;
}
static inline int kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode)
{
if ( ppc_md.kbd_translate )
return ppc_md.kbd_translate(keycode, keycodep, raw_mode);
else
return pckbd_translate(keycode, keycodep, raw_mode);
}
static inline int kbd_unexpected_up(unsigned char keycode)
{
if ( ppc_md.kbd_unexpected_up )
return ppc_md.kbd_unexpected_up(keycode);
else
return pckbd_unexpected_up(keycode);
}
static inline void kbd_leds(unsigned char leds)
{
}
static inline void kbd_init_hw(void)
{
}
#define kbd_sysrq_xlate pckbd_sysrq_xlate
extern unsigned long SYSRQ_KEY;
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#ifndef kbd_read_input
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
#endif
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#ifndef AUX_IRQ
#define AUX_IRQ 12
#endif
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* __ASM_KEYBOARD_H__ */
/*
* linux/include/asm-ppc/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
* Modified for Power Macintosh by Paul Mackerras
*
* 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 file contains the ppc architecture specific keyboard definitions -
* like the intel pc for prep systems, different for power macs.
*/
#ifndef __ASMPPC64_KEYBOARD_H
#define __ASMPPC64_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/adb.h>
#include <asm/machdep.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0
#define INIT_KBD
static inline int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
{
if ( ppc_md.kbd_setkeycode )
return ppc_md.kbd_setkeycode(scancode, keycode);
else
return 0;
}
static inline int kbd_getkeycode(unsigned int scancode)
{
if ( ppc_md.kbd_getkeycode )
return ppc_md.kbd_getkeycode(scancode);
else
return 0;
}
static inline int kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode)
{
if ( ppc_md.kbd_translate )
return ppc_md.kbd_translate(keycode, keycodep, raw_mode);
else
return 0;
}
static inline int kbd_unexpected_up(unsigned char keycode)
{
if ( ppc_md.kbd_unexpected_up )
return ppc_md.kbd_unexpected_up(keycode);
else
return 0;
}
static inline void kbd_leds(unsigned char leds)
{
if ( ppc_md.kbd_leds )
ppc_md.kbd_leds(leds);
}
static inline void kbd_init_hw(void)
{
if ( ppc_md.kbd_init_hw )
ppc_md.kbd_init_hw();
}
#define kbd_sysrq_xlate (ppc_md.ppc_kbd_sysrq_xlate)
extern unsigned long SYSRQ_KEY;
#define E1_PAUSE 119 /* PAUSE key */
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
static inline int kbd_read_status(void) {
int ret = inb(0x64);
return (ret == 0xff) ? 0 : ret; /* translate float to bad status. */
}
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#define AUX_IRQ 12
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* __ASMPPC64_KEYBOARD_H */
#ifndef __ASM_SH_KEYBOARD_H
#define __ASM_SH_KEYBOARD_H
/*
* $Id: keyboard.h,v 1.12 2001/09/06 04:01:41 gniibe Exp $
*/
#include <linux/kd.h>
#include <linux/config.h>
#include <asm/machvec.h>
#ifdef CONFIG_SH_EC3104
#include <asm/keyboard-ec3104.h>
#else
static __inline__ int kbd_setkeycode(unsigned int scancode,
unsigned int keycode)
{
return -EOPNOTSUPP;
}
static __inline__ int kbd_getkeycode(unsigned int scancode)
{
return scancode > 127 ? -EINVAL : scancode;
}
#ifdef CONFIG_SH_DREAMCAST
extern int kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
#else
static __inline__ int kbd_translate(unsigned char scancode,
unsigned char *keycode, char raw_mode)
{
*keycode = scancode;
return 1;
}
#endif
static __inline__ char kbd_unexpected_up(unsigned char keycode)
{
return 0200;
}
static __inline__ void kbd_leds(unsigned char leds)
{
}
extern void hp600_kbd_init_hw(void);
extern void dreamcast_kbd_init_hw(void);
static __inline__ void kbd_init_hw(void)
{
if (MACH_HP600) {
hp600_kbd_init_hw();
}
}
#endif
#endif
/* $Id: keyboard.h,v 1.8 2002/01/08 16:00:20 davem Exp $
* linux/include/asm-sparc/keyboard.h
*
* sparc64 Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be)
*/
/*
* This file contains the Ultra/PCI architecture specific keyboard definitions
*/
#ifndef _SPARC_KEYBOARD_H
#define _SPARC_KEYBOARD_H 1
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 13
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pcikbd_getkeycode(unsigned int scancode);
extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pcikbd_unexpected_up(unsigned char keycode);
extern void pcikbd_leds(unsigned char leds);
extern void pcikbd_init_hw(void);
extern unsigned char pcikbd_sysrq_xlate[128];
#define kbd_setkeycode pcikbd_setkeycode
#define kbd_getkeycode pcikbd_getkeycode
#define kbd_translate pcikbd_translate
#define kbd_unexpected_up pcikbd_unexpected_up
#define kbd_leds pcikbd_leds
#define kbd_init_hw pcikbd_init_hw
#define kbd_sysrq_xlate pcikbd_sysrq_xlate
#define kbd_init pcikbd_init
#define compute_shiftstate pci_compute_shiftstate
#define getkeycode pci_getkeycode
#define setkeycode pci_setkeycode
#define getledstate pci_getledstate
#define setledstate pci_setledstate
#define register_leds pci_register_leds
/* #define SYSRQ_KEY 0x54 */ /* sparc64 */
#define SYSRQ_KEY 0x63 /* sparc */
/* resource allocation */
#define kbd_request_region() request_region(0x60, 16, "keyboard")
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#define AUX_IRQ 12
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* !(_SPARC_KEYBOARD_H) */
/* $Id: keyboard.h,v 1.6 2002/01/08 16:00:20 davem Exp $
* linux/include/asm-sparc64/keyboard.h
*
* Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be)
*/
/*
* This file contains the Ultra/PCI architecture specific keyboard definitions
*/
#ifndef _SPARC64_KEYBOARD_H
#define _SPARC64_KEYBOARD_H 1
#ifdef __KERNEL__
/* We use the generic input layer for keyboard handling, thus
* some of this stuff should never be invoked.
*/
#define kbd_setkeycode(scancode, keycode) (BUG(), 0)
#define kbd_getkeycode(scancode) (BUG(), 0)
#define kbd_translate(keycode, keycodep, raw_mode) \
({ *(keycodep) = scancode; 1; })
#define kbd_unexpected_up(keycode) (0200)
#define kbd_leds(leds) do { } while (0)
#define kbd_init_hw() do { } while (0)
#define SYSRQ_KEY 0x54
extern unsigned char kbd_sysrq_xlate[128];
#endif /* __KERNEL__ */
#endif /* !(_SPARC64_KEYBOARD_H) */
/*
* linux/include/asm-x8664/keyboard.h
*
* Created 3 Nov 1996 by Geert Uytterhoeven
*/
/*
* This file contains the x8664 architecture specific keyboard definitions
*/
#ifndef _X8664_KEYBOARD_H
#define _X8664_KEYBOARD_H
#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
#include <linux/pm.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pckbd_getkeycode(unsigned int scancode);
extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern void pckbd_init_hw(void);
extern int pckbd_pm_resume(struct pm_dev *dev, pm_request_t rqst, void *data);
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_setkeycode pckbd_setkeycode
#define kbd_getkeycode pckbd_getkeycode
#define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds
#define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define SYSRQ_KEY 0x54
/* resource allocation */
#define kbd_request_region()
#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
"keyboard", NULL)
/* How to access the keyboard macros on this platform. */
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
/* Some stoneage hardware needs delays after some operations. */
#define kbd_pause() do { } while(0)
/*
* Machine specific bits for the PS/2 driver
*/
#define AUX_IRQ 12
#define aux_request_irq(hand, dev_id) \
request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
#endif /* __KERNEL__ */
#endif /* _X8664_KEYBOARD_H */
/*
* Interface between the low-level keyboard driver and the keymapper
*/
#ifndef _KBD_LL_H
#define _KBD_LL_H
extern struct pt_regs *kbd_pt_regs;
void handle_scancode(unsigned char scancode, int down);
#endif /* _KBD_LL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment