Commit 55cc5753 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge - uinput moved into misc/

parents f4e1c439 87b2c140
......@@ -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;
}
......
......@@ -540,11 +540,6 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then
bool ' Support for mouse button 2+3 emulation' CONFIG_MAC_EMUMOUSEBTN
fi
fi
# This is for drivers/macintosh/mac_hid.o, which is needed if the input
# layer is used.
if [ "$CONFIG_INPUT" != "n" ]; then
define_bool CONFIG_MAC_HID y
fi
if [ "$CONFIG_ADB_CUDA" != "n" ]; then
bool 'Support for ANS LCD display' CONFIG_ANSLCD
fi
......
......@@ -68,7 +68,6 @@ void rtas_indicator_progress(char *, unsigned short);
void btext_progress(char *, unsigned short);
extern unsigned long pmac_find_end_of_memory(void);
extern void select_adb_keyboard(void);
extern int of_show_percpuinfo(struct seq_file *, int);
extern kdev_t boot_dev;
......@@ -437,22 +436,6 @@ chrp_init2(void)
if (ppc_md.progress)
ppc_md.progress(" Have fun! ", 0x7777);
#if defined(CONFIG_VT) && defined(CONFIG_INPUT)
/* see if there is a keyboard in the device tree
with a parent of type "adb" */
{
struct device_node *kbd;
for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next) {
if (kbd->parent && kbd->parent->type
&& strcmp(kbd->parent->type, "adb") == 0) {
select_adb_keyboard();
break;
}
}
}
#endif /* CONFIG_VT && CONFIG_INPUT */
}
void __init
......
......@@ -66,7 +66,6 @@
#include <asm/ohare.h>
#include <asm/mediabay.h>
#include <asm/machdep.h>
#include <asm/keyboard.h>
#include <asm/dma.h>
#include <asm/bootx.h>
#include <asm/cputable.h>
......@@ -617,15 +616,6 @@ pmac_find_end_of_memory(void)
return total;
}
void __init
select_adb_keyboard(void)
{
#ifdef CONFIG_VT
ppc_md.kbd_translate = mac_hid_kbd_translate;
ppc_md.kbd_unexpected_up = mac_hid_kbd_unexpected_up;
#endif /* CONFIG_VT */
}
void __init
pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
......@@ -666,8 +656,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.feature_call = pmac_do_feature_call;
select_adb_keyboard();
#ifdef CONFIG_BOOTX_TEXT
ppc_md.progress = pmac_progress;
#endif /* CONFIG_BOOTX_TEXT */
......
......@@ -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 =
endif
endif
ifeq ($(ARCH),s390x)
KEYMAP =
KEYBD =
CONSOLE =
endif
ifeq ($(ARCH),m68k)
ifdef CONFIG_AMIGA
KEYBD = amikeyb.o
else
KEYBD =
endif
ifneq ($(ARCH),s390)
ifneq ($(ARCH),s390x)
ifneq ($(ARCH),um)
KEYMAP =defkeymap.o
CONSOLE =console.o
endif
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.
......@@ -75,78 +75,6 @@ unsigned int video_scan_lines;
#define GPLAST 0x3df
#define GPNUM (GPLAST - GPFIRST + 1)
/*
* Generates sound of some frequency for some number of clock ticks
*
* If freq is 0, will turn off sound, else will turn it on for that time.
* If msec is 0, will return immediately, else will sleep for msec time, then
* turn sound off.
*
* We also return immediately, which is what was implied within the X
* comments - KDMKTONE doesn't put the process to sleep.
*/
#if defined(__i386__) || defined(__alpha__) || defined(__powerpc__) \
|| (defined(__mips__) && defined(CONFIG_ISA)) \
|| (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
|| defined(__x86_64__)
static void
kd_nosound(unsigned long ignored)
{
/* disable counter 2 */
outb(inb_p(0x61)&0xFC, 0x61);
return;
}
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
static struct timer_list sound_timer = { function: kd_nosound };
unsigned int count = 0;
unsigned long flags;
if (hz > 20 && hz < 32767)
count = 1193180 / hz;
local_irq_save(flags); // FIXME: is this safe?
del_timer(&sound_timer);
if (count) {
/* enable counter 2 */
outb_p(inb_p(0x61)|3, 0x61);
/* set command for counter 2, 2 byte write */
outb_p(0xB6, 0x43);
/* select desired HZ */
outb_p(count & 0xff, 0x42);
outb((count >> 8) & 0xff, 0x42);
if (ticks) {
sound_timer.expires = jiffies+ticks;
add_timer(&sound_timer);
}
} else
kd_nosound(0);
local_irq_restore(flags);
return;
}
#else
void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
#endif
int _kbd_rate(struct kbd_repeat *rep)
{
return -EINVAL;
}
void (*kd_mksound)(unsigned int hz, unsigned int ticks) = _kd_mksound;
int (*kbd_rate)(struct kbd_repeat *rep) = _kbd_rate;
#define i (tmp.kb_index)
#define s (tmp.kb_table)
#define v (tmp.kb_value)
......
......@@ -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
......@@ -98,12 +88,3 @@ CONFIG_INPUT_EVBUG
inserted in and removed from the running kernel whenever you want).
The module will be called joydev.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_UINPUT
Say Y here if you want to support user level drivers for input
subsystem accessible under char device 10:223 - /dev/input/uinput.
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 uinput.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
......@@ -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
......@@ -23,7 +22,7 @@ if [ "$CONFIG_INPUT_TSDEV" != "n" ]; then
fi
dep_tristate ' Event interface' CONFIG_INPUT_EVDEV $CONFIG_INPUT
dep_tristate ' Event debugging' CONFIG_INPUT_EVBUG $CONFIG_INPUT
dep_tristate ' User level driver support (EXPERIMENTAL)' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_EXPERIMENTAL
comment 'Input I/O drivers'
source drivers/input/gameport/Config.in
......@@ -35,6 +34,7 @@ if [ "$CONFIG_INPUT" != "n" ]; then
source drivers/input/mouse/Config.in
source drivers/input/joystick/Config.in
source drivers/input/touchscreen/Config.in
source drivers/input/misc/Config.in
fi
endmenu
......@@ -9,19 +9,18 @@ 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
obj-$(CONFIG_INPUT_TSDEV) += tsdev.o
obj-$(CONFIG_INPUT_POWER) += power.o
obj-$(CONFIG_INPUT_EVBUG) += evbug.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
obj-$(CONFIG_INPUT_KEYBOARD) += keyboard/
obj-$(CONFIG_INPUT_MOUSE) += mouse/
obj-$(CONFIG_INPUT_JOYSTICK) += joystick/
obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/
obj-$(CONFIG_INPUT_MISC) += misc/
# The global Rules.make.
......
......@@ -234,7 +234,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct evdev *evdev = list->evdev;
struct input_dev *dev = evdev->handle.dev;
struct input_absinfo abs;
int t, u;
int i, t, u;
if (!evdev->exist) return -ENODEV;
......@@ -258,26 +258,21 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case EVIOCGKEYCODE:
if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t < 0 || t > dev->keycodemax) return -EINVAL;
switch (dev->keycodesize) {
case 1: u = *(u8*)(dev->keycode + t); break;
case 2: u = *(u16*)(dev->keycode + t * 2); break;
case 4: u = *(u32*)(dev->keycode + t * 4); break;
default: return -EINVAL;
}
if (put_user(u, ((int *) arg) + 1)) return -EFAULT;
if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
if (put_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
return 0;
case EVIOCSKEYCODE:
if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t < 0 || t > dev->keycodemax) return -EINVAL;
if (get_user(u, ((int *) arg) + 1)) return -EFAULT;
switch (dev->keycodesize) {
case 1: *(u8*)(dev->keycode + t) = u; break;
case 2: *(u16*)(dev->keycode + t * 2) = u; break;
case 4: *(u32*)(dev->keycode + t * 4) = u; break;
default: return -EINVAL;
}
if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
u = INPUT_KEYCODE(dev, t);
if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
for (i = 0; i < dev->keycodemax; i++)
if(INPUT_KEYCODE(dev, t) == u) break;
if (i == dev->keycodemax) clear_bit(u, dev->keybit);
set_bit(INPUT_KEYCODE(dev, t), dev->keybit);
return 0;
case EVIOCSFF:
......
......@@ -105,7 +105,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
change_bit(code, dev->key);
if (test_bit(EV_REP, dev->evbit) && value) {
if (test_bit(EV_REP, dev->evbit) && dev->rep[REP_PERIOD] && value) {
dev->repeat_key = code;
mod_timer(&dev->timer, jiffies + dev->rep[REP_DELAY]);
}
......@@ -165,10 +165,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
case EV_SND:
if (code > SND_MAX || !test_bit(code, dev->sndbit) || !!test_bit(code, dev->snd) == value)
if (code > SND_MAX || !test_bit(code, dev->sndbit))
return;
change_bit(code, dev->snd);
if (dev->event) dev->event(dev, type, code, value);
break;
......
......@@ -203,13 +203,13 @@ CONFIG_JOYSTICK_TURBOGRAFX
The module will be called turbografx.o. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
CONFIG_JOYSTICK_AMIJOY
CONFIG_JOYSTICK_AMIGA
Say Y here if you have an Amiga with a digital joystick connected
to it.
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 joy-amiga.o. If you want to compile it as
The module will be called amijoy.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_JOYDUMP
......
......@@ -28,7 +28,7 @@ dep_tristate ' Multisystem, NES, SNES, N64, PSX joysticks and gamepads' CONFIG_
dep_tristate ' Multisystem joysticks via TurboGraFX device' CONFIG_JOYSTICK_TURBOGRAFX $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_PARPORT
if [ "$CONFIG_AMIGA" = "y" ]; then
dep_tristate ' Amiga joysticks' CONFIG_JOYSTICK_AMIJOY $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK
dep_tristate ' Amiga joysticks' CONFIG_JOYSTICK_AMIGA $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK
fi
dep_tristate ' Gameport data dumper' CONFIG_INPUT_JOYDUMP $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK
......@@ -37,6 +37,7 @@
#include <asm/system.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Driver for Amiga joysticks");
......@@ -78,13 +79,13 @@ static int amijoy_open(struct input_dev *dev)
if ((*used)++)
return 0;
if (request_irq(IRQ_AMIGA_VERTB, amijoy_interrupt, 0, "amijoy", NULL)) {
if (request_irq(IRQ_AMIGA_VERTB, amijoy_interrupt, 0, "amijoy", amijoy_interrupt)) {
(*used)--;
printk(KERN_ERR "amijoy.c: Can't allocate irq %d\n", amijoy_irq);
printk(KERN_ERR "amijoy.c: Can't allocate irq %d\n", IRQ_AMIGA_VERTB);
return -EBUSY;
}
return 0;
}
......@@ -99,8 +100,9 @@ static void amijoy_close(struct input_dev *dev)
static int __init amijoy_setup(char *str)
{
int i;
int ints[4]
str = get_options(str, ARRAY_SIZE(ints), ints);
int ints[4];
str = get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) amijoy[i] = ints[i+1];
return 1;
}
......@@ -110,9 +112,6 @@ static int __init amijoy_init(void)
{
int i, j;
init_timer(amijoy_timer);
port->timer.function = amijoy_timer;
for (i = 0; i < 2; i++)
if (amijoy[i]) {
if (!request_mem_region(CUSTOM_PHYSADDR+10+i*2, 2,
......@@ -134,12 +133,12 @@ static int __init amijoy_init(void)
amijoy_dev[i].absmax[ABS_X + j] = 1;
}
amijoy->dev[i].name = amijoy_name;
amijoy->dev[i].phys = amijoy_phys[i];
amijoy->dev[i].id.bustype = BUS_AMIGA;
amijoy->dev[i].id.vendor = 0x0001;
amijoy->dev[i].id.product = 0x0003;
amijoy->dev[i].id.version = 0x0100;
amijoy_dev[i].name = amijoy_name;
amijoy_dev[i].phys = amijoy_phys[i];
amijoy_dev[i].id.bustype = BUS_AMIGA;
amijoy_dev[i].id.vendor = 0x0001;
amijoy_dev[i].id.product = 0x0003;
amijoy_dev[i].id.version = 0x0100;
amijoy_dev[i].private = amijoy_used + i;
......@@ -149,7 +148,7 @@ static int __init amijoy_init(void)
return 0;
}
static void _exit amijoy_exit(void)
static void __exit amijoy_exit(void)
{
int i;
......
/*
* $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);
......@@ -34,6 +34,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/delay.h>
#include <asm/amigaints.h>
#include <asm/amigahw.h>
......@@ -51,9 +52,9 @@ static unsigned char amikbd_keycode[0x78] = {
57, 14, 15, 96, 28, 1,111, 0, 0, 0, 74, 0,103,108,106,105,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 98, 55, 78, 87,
42, 54, 58, 29, 56,100
}
};
static char *amikbd_messages[] = {
static const char *amikbd_messages[8] = {
KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
KERN_WARNING "amikbd: keyboard lost sync\n",
KERN_WARNING "amikbd: keyboard buffer overflow\n",
......@@ -79,19 +80,19 @@ static void amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp)
ciaa.cra &= ~0x40; /* switch CIA serial port to input mode */
down = scancode & 1; /* lowest bit is release bit */
scancode = scancode >> 1;
scancode >>= 1;
if (scancode < 0x78) { /* scancodes < 0x78 are keys */
scancode = amikbd_keycode[scancode];
if (scancode == KEY_CAPS) { /* CapsLock is a toggle switch key on Amiga */
if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
input_report_key(&amikbd_dev, scancode, 1);
input_report_key(&amikbd_dev, scancode, 0);
input_sync(&amikbd_dev);
return;
}
input_report_key(&amikbd_dev, scancode, down);
input_sync(&amikbd_dev);
......@@ -106,20 +107,22 @@ static int __init amikbd_init(void)
int i;
if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
return -EIO;
return -EIO;
if (!request_mem_region(CIAA_PHYSADDR-1+0xb00, 0x100, "amikeyb"))
if (!request_mem_region(CIAA_PHYSADDR-1+0xb00, 0x100, "amikeyb"))
return -EBUSY;
amikbd_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
amikbd_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
amikbd_dev.keycode = amikbd_keycode;
for (i = 0; i < 0x78; i++)
amikbd_dev.keycodesize = sizeof(unsigned char);
amikbd_dev.keycodemax = ARRAY_SIZE(amikbd_keycode);
for (i = 0; i < 0x78; i++)
if (amikbd_keycode[i])
set_bit(amikbd_keycode[i], amikbd_dev.keybit);
ciaa.cra &= ~0x41; /* serial data in, turn off TA */
request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd", NULL);
request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd", amikbd_interrupt);
amikbd_dev.name = amikbd_name;
amikbd_dev.phys = amikbd_phys;
......
......@@ -470,6 +470,8 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
atkbd->serio = serio;
atkbd->dev.keycode = atkbd->keycode;
atkbd->dev.keycodesize = sizeof(unsigned char);
atkbd->dev.keycodemax = ARRAY_SIZE(atkbd_set2_keycode);
atkbd->dev.event = atkbd_event;
atkbd->dev.private = atkbd;
......
......@@ -94,6 +94,8 @@ void nkbd_connect(struct serio *serio, struct serio_dev *dev)
nkbd->serio = serio;
nkbd->dev.keycode = nkbd->keycode;
nkbd->dev.keycodesize = sizeof(unsigned char);
nkbd->dev.keycodemax = ARRAY_SIZE(nkbd_keycode);
nkbd->dev.private = nkbd;
serio->private = nkbd;
......
......@@ -245,6 +245,9 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
sunkbd->tq.data = sunkbd;
sunkbd->dev.keycode = sunkbd->keycode;
sunkbd->dev.keycodesize = sizeof(unsigned char);
sunkbd->dev.keycodemax = ARRAY_SIZE(sunkbd_keycode);
sunkbd->dev.event = sunkbd_event;
sunkbd->dev.private = sunkbd;
......
......@@ -101,6 +101,8 @@ void xtkbd_connect(struct serio *serio, struct serio_dev *dev)
xtkbd->serio = serio;
xtkbd->dev.keycode = xtkbd->keycode;
xtkbd->dev.keycodesize = sizeof(unsigned char);
xtkbd->dev.keycodemax = ARRAY_SIZE(xtkbd_keycode);
xtkbd->dev.private = xtkbd;
serio->private = xtkbd;
......
CONFIG_INPUT_MISC
Say Y here, and a list of miscellaneous input drivers will be displayed.
Everything that didn't fit into the other categories is here. This option
doesn't affect the kernel.
If unsure, say Y.
CONFIG_INPUT_PCSPKR
Say Y here if you want the standard PC Speaker to be used for
bells and whistles.
If unsure, say Y.
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 pcspkr.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_UINPUT
Say Y here if you want to support user level drivers for input
subsystem accessible under char device 10:223 - /dev/input/uinput.
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 uinput.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
#
# Input misc drivers configuration
#
bool 'Misc' CONFIG_INPUT_MISC
dep_tristate ' PC Speaker support' CONFIG_INPUT_PCSPKR $CONFIG_INPUT $CONFIG_INPUT_MISC
dep_tristate ' User level driver support' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_INPUT_MISC
#
# Makefile for the input misc drivers.
#
# Each configuration option enables a list of files.
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
# The global Rules.make.
include $(TOPDIR)/Rules.make
/*
* PC Speaker beeper driver for Linux
*
* Copyright (c) 2002 Vojtech Pavlik
* Copyright (c) 1992 Orest Zborowski
*
*/
/*
* 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
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <asm/io.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("PC Speaker beeper driver");
MODULE_LICENSE("GPL");
static char *pcspkr_name = "PC Speaker";
static char *pcspkr_phys = "isa0061/input0";
static struct input_dev pcspkr_dev;
spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
unsigned int count = 0;
unsigned long flags;
if (type != EV_SND)
return -1;
switch (code) {
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
if (value > 20 && value < 32767)
count = 1193182 / value;
spin_lock_irqsave(&i8253_beep_lock, flags);
if (count) {
/* enable counter 2 */
outb_p(inb_p(0x61) | 3, 0x61);
/* set command for counter 2, 2 byte write */
outb_p(0xB6, 0x43);
/* select desired HZ */
outb_p(count & 0xff, 0x42);
outb((count >> 8) & 0xff, 0x42);
} else {
/* disable counter 2 */
outb(inb_p(0x61) & 0xFC, 0x61);
}
spin_unlock_irqrestore(&i8253_beep_lock, flags);
return 0;
}
static int __init pcspkr_init(void)
{
pcspkr_dev.evbit[0] = BIT(EV_SND);
pcspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
pcspkr_dev.event = pcspkr_event;
pcspkr_dev.name = pcspkr_name;
pcspkr_dev.phys = pcspkr_phys;
pcspkr_dev.id.bustype = BUS_ISA;
pcspkr_dev.id.vendor = 0x001f;
pcspkr_dev.id.product = 0x0001;
pcspkr_dev.id.version = 0x0100;
input_register_device(&pcspkr_dev);
printk(KERN_INFO "input: %s\n", pcspkr_name);
return 0;
}
static void __exit pcspkr_exit(void)
{
input_unregister_device(&pcspkr_dev);
}
module_init(pcspkr_init);
module_exit(pcspkr_exit);
......@@ -64,7 +64,7 @@ static void amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
input_report_rel(&amimouse_dev, REL_X, dx);
input_report_rel(&amimouse_dev, REL_Y, dy);
input_report_key(&amimouse_dev, BTN_LEFT, ciaa.pra & 0x40);
input_report_key(&amimouse_dev, BTN_MIDDLE, potgor & 0x0100);
input_report_key(&amimouse_dev, BTN_RIGHT, potgor & 0x0400);
......@@ -84,9 +84,9 @@ static int amimouse_open(struct input_dev *dev)
amimouse_lastx = joy0dat & 0xff;
amimouse_lasty = joy0dat >> 8;
if (request_irq(IRQ_AMIGA_VERTB, amimouse_interrupt, 0, "amimouse", NULL)) {
if (request_irq(IRQ_AMIGA_VERTB, amimouse_interrupt, 0, "amimouse", amimouse_interrupt)) {
amimouse_used--;
printk(KERN_ERR "amimouse.c: Can't allocate irq %d\n", amimouse_irq);
printk(KERN_ERR "amimouse.c: Can't allocate irq %d\n", IRQ_AMIGA_VERTB);
return -EBUSY;
}
......@@ -116,10 +116,11 @@ static int __init amimouse_init(void)
amimouse_dev.id.vendor = 0x0001;
amimouse_dev.id.product = 0x0002;
amimouse_dev.id.version = 0x0100;
input_register_device(&amimouse_dev);
printk(KERN_INFO "input: %s at joy0dat\n", amimouse_name);
return 0;
}
static void __exit amimouse_exit(void)
......
......@@ -54,6 +54,7 @@ static struct serio i8042_kbd_port;
static struct serio i8042_aux_port;
static unsigned char i8042_initial_ctr;
static unsigned char i8042_ctr;
static unsigned char i8042_last_e0;
struct timer_list i8042_timer;
#ifdef I8042_DEBUG_IO
......@@ -366,12 +367,15 @@ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (data > 0x7f) {
if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) {
serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
if (i8042_last_e0 && (data == 0xaa || data == 0xb6))
set_bit(data & 0x7f, i8042_unxlate_seen);
data = i8042_unxlate_table[data & 0x7f];
}
} else {
set_bit(data, i8042_unxlate_seen);
data = i8042_unxlate_table[data];
}
i8042_last_e0 = (data == 0xe0);
}
serio_interrupt(&i8042_kbd_port, data, dfl);
}
......
......@@ -20,7 +20,7 @@ obj-$(CONFIG_MAC_SERIAL) += macserial.o
ifneq ($(CONFIG_MAC),y)
obj-$(CONFIG_NVRAM) += nvram.o
endif
obj-$(CONFIG_MAC_HID) += mac_hid.o
obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
obj-$(CONFIG_PPC_RTC) += rtc.o
obj-$(CONFIG_ANSLCD) += ans-lcd.o
......
......@@ -37,7 +37,6 @@
#include <linux/init.h>
#include <linux/notifier.h>
#include <linux/input.h>
#include <linux/kbd_ll.h>
#include <linux/adb.h>
#include <linux/cuda.h>
......@@ -52,6 +51,8 @@ MODULE_AUTHOR("Franz Sirl <Franz.Sirl-kernel@lauterbach.com>");
#define KEYB_LEDREG 2 /* register # for leds on ADB keyboard */
#define MOUSE_DATAREG 0 /* reg# for movement/button codes from mouse */
extern struct pt_regs *kbd_pt_regs;
static int adb_message_handler(struct notifier_block *, unsigned long, void *);
static struct notifier_block adbhid_adb_notifier = {
notifier_call: adb_message_handler,
......
......@@ -5,7 +5,7 @@
*
* Copyright (C) 2000 Franz Sirl.
*
* Stuff inside CONFIG_MAC_EMUMOUSEBTN should really be moved to userspace.
* This file will soon be removed in favor of an uinput userspace tool.
*/
#include <linux/config.h>
......@@ -16,36 +16,14 @@
#include <linux/module.h>
static unsigned char e0_keys[128] = {
0, 0, 0, KEY_KPCOMMA, 0, KEY_INTL3, 0, 0, /* 0x00-0x07 */
0, 0, 0, 0, KEY_LANG1, KEY_LANG2, 0, 0, /* 0x08-0x0f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10-0x17 */
0, 0, 0, 0, KEY_KPENTER, KEY_RIGHTCTRL, KEY_VOLUMEUP, 0,/* 0x18-0x1f */
0, 0, 0, 0, 0, KEY_VOLUMEDOWN, KEY_MUTE, 0, /* 0x20-0x27 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x28-0x2f */
0, 0, 0, 0, 0, KEY_KPSLASH, 0, KEY_SYSRQ, /* 0x30-0x37 */
KEY_RIGHTALT, KEY_BRIGHTNESSUP, KEY_BRIGHTNESSDOWN,
KEY_EJECTCD, 0, 0, 0, 0, /* 0x38-0x3f */
0, 0, 0, 0, 0, 0, 0, KEY_HOME, /* 0x40-0x47 */
KEY_UP, KEY_PAGEUP, 0, KEY_LEFT, 0, KEY_RIGHT, 0, KEY_END, /* 0x48-0x4f */
KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, 0, 0, 0, 0, /* 0x50-0x57 */
0, 0, 0, KEY_LEFTMETA, KEY_RIGHTMETA, KEY_COMPOSE, KEY_POWER, 0, /* 0x58-0x5f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */
0, 0, 0, 0, 0, 0, 0, KEY_MACRO, /* 0x68-0x6f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */
0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
};
#ifdef CONFIG_MAC_EMUMOUSEBTN
static struct input_dev emumousebtn;
static void emumousebtn_input_register(void);
static int mouse_emulate_buttons = 0;
static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */
static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */
static int mouse_last_keycode = 0;
#endif
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MAC_EMUMOUSEBTN)
#if defined(CONFIG_SYSCTL)
/* file(s) in /proc/sys/dev/mac_hid */
ctl_table mac_hid_files[] =
{
......@@ -85,76 +63,11 @@ static struct ctl_table_header *mac_hid_sysctl_header;
#endif /* endif CONFIG_SYSCTL */
int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{
/* This code was copied from char/pc_keyb.c and will be
* superflous when the input layer is fully integrated.
* We don't need the high_keys handling, so this part
* has been removed.
*/
static int prev_scancode = 0;
/* special prefix scancodes.. */
if (scancode == 0xe0 || scancode == 0xe1) {
prev_scancode = scancode;
return 0;
}
scancode &= 0x7f;
if (prev_scancode) {
if (prev_scancode != 0xe0) {
if (prev_scancode == 0xe1 && scancode == 0x1d) {
prev_scancode = 0x100;
return 0;
} else if (prev_scancode == 0x100 && scancode == 0x45) {
*keycode = KEY_PAUSE;
prev_scancode = 0;
} else {
if (!raw_mode)
printk(KERN_INFO "keyboard: unknown e1 escape sequence\n");
prev_scancode = 0;
return 0;
}
} else {
prev_scancode = 0;
if (scancode == 0x2a || scancode == 0x36)
return 0;
}
if (e0_keys[scancode])
*keycode = e0_keys[scancode];
else {
if (!raw_mode)
printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n",
scancode);
return 0;
}
} else {
switch (scancode) {
case 91: scancode = KEY_LINEFEED; break;
case 92: scancode = KEY_KPEQUAL; break;
case 125: scancode = KEY_INTL1; break;
}
*keycode = scancode;
}
return 1;
}
char mac_hid_kbd_unexpected_up(unsigned char keycode)
{
if (keycode == KEY_F13)
return 0;
else
return 0x80;
}
#ifdef CONFIG_MAC_EMUMOUSEBTN
int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down)
{
switch (caller) {
case 1:
/* Called from keybdev.c */
/* Called from keyboard.c */
if (mouse_emulate_buttons
&& (keycode == mouse_button2_keycode
|| keycode == mouse_button3_keycode)) {
......@@ -191,16 +104,13 @@ static void emumousebtn_input_register(void)
printk(KERN_INFO "input: Macintosh mouse button emulation\n");
}
#endif
int __init mac_hid_init(void)
{
#ifdef CONFIG_MAC_EMUMOUSEBTN
emumousebtn_input_register();
#endif
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MAC_EMUMOUSEBTN)
#if defined(CONFIG_SYSCTL)
mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir, 1);
#endif /* CONFIG_SYSCTL */
......
/*
* 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__ */
......@@ -57,12 +57,6 @@ struct machdep_calls {
unsigned char (*nvram_read_val)(int addr);
void (*nvram_write_val)(int addr, unsigned char val);
/* Tons of keyboard stuff. */
int (*kbd_translate)(unsigned char scancode,
unsigned char *keycode,
char raw_mode);
char (*kbd_unexpected_up)(unsigned char keycode);
/*
* optional PCI "hooks"
*/
......
/*
* 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 */
......@@ -570,6 +570,7 @@ struct input_absinfo {
#define SND_CLICK 0x00
#define SND_BELL 0x01
#define SND_TONE 0x02
#define SND_MAX 0x07
/*
......@@ -756,6 +757,9 @@ struct ff_effect {
#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
#define LONG(x) ((x)/BITS_PER_LONG)
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
((dev->keycodesize == 1) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
struct input_dev {
void *private;
......
/*
* 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 */
......@@ -32,8 +32,8 @@ extern struct vt_struct {
wait_queue_head_t paste_wait;
} *vt_cons[MAX_NR_CONSOLES];
extern void (*kd_mksound)(unsigned int hz, unsigned int ticks);
extern int (*kbd_rate)(struct kbd_repeat *rep);
extern void kd_mksound(unsigned int hz, unsigned int ticks);
extern int kbd_rate(struct kbd_repeat *rep);
/* console.c */
......
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