Commit 731418bc authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input

parents d17e9bb6 2b227974
...@@ -203,13 +203,13 @@ CONFIG_JOYSTICK_TURBOGRAFX ...@@ -203,13 +203,13 @@ CONFIG_JOYSTICK_TURBOGRAFX
The module will be called turbografx.o. If you want to compile it 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>. 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 Say Y here if you have an Amiga with a digital joystick connected
to it. to it.
This driver is also available as a module ( = code which can be This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want). 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>. a module, say M here and read <file:Documentation/modules.txt>.
CONFIG_INPUT_JOYDUMP CONFIG_INPUT_JOYDUMP
......
...@@ -28,7 +28,7 @@ dep_tristate ' Multisystem, NES, SNES, N64, PSX joysticks and gamepads' CONFIG_ ...@@ -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 dep_tristate ' Multisystem joysticks via TurboGraFX device' CONFIG_JOYSTICK_TURBOGRAFX $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_PARPORT
if [ "$CONFIG_AMIGA" = "y" ]; then 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 fi
dep_tristate ' Gameport data dumper' CONFIG_INPUT_JOYDUMP $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK dep_tristate ' Gameport data dumper' CONFIG_INPUT_JOYDUMP $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/amigahw.h> #include <asm/amigahw.h>
#include <asm/amigaints.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Driver for Amiga joysticks"); MODULE_DESCRIPTION("Driver for Amiga joysticks");
...@@ -78,13 +79,13 @@ static int amijoy_open(struct input_dev *dev) ...@@ -78,13 +79,13 @@ static int amijoy_open(struct input_dev *dev)
if ((*used)++) if ((*used)++)
return 0; 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)--; (*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 -EBUSY;
} }
return 0; return 0;
} }
...@@ -99,8 +100,9 @@ static void amijoy_close(struct input_dev *dev) ...@@ -99,8 +100,9 @@ static void amijoy_close(struct input_dev *dev)
static int __init amijoy_setup(char *str) static int __init amijoy_setup(char *str)
{ {
int i; int i;
int ints[4] int ints[4];
str = get_options(str, ARRAY_SIZE(ints), ints);
str = get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) amijoy[i] = ints[i+1]; for (i = 0; i <= ints[0] && i < 2; i++) amijoy[i] = ints[i+1];
return 1; return 1;
} }
...@@ -110,9 +112,6 @@ static int __init amijoy_init(void) ...@@ -110,9 +112,6 @@ static int __init amijoy_init(void)
{ {
int i, j; int i, j;
init_timer(amijoy_timer);
port->timer.function = amijoy_timer;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
if (amijoy[i]) { if (amijoy[i]) {
if (!request_mem_region(CUSTOM_PHYSADDR+10+i*2, 2, if (!request_mem_region(CUSTOM_PHYSADDR+10+i*2, 2,
...@@ -134,12 +133,12 @@ static int __init amijoy_init(void) ...@@ -134,12 +133,12 @@ static int __init amijoy_init(void)
amijoy_dev[i].absmax[ABS_X + j] = 1; amijoy_dev[i].absmax[ABS_X + j] = 1;
} }
amijoy->dev[i].name = amijoy_name; amijoy_dev[i].name = amijoy_name;
amijoy->dev[i].phys = amijoy_phys[i]; amijoy_dev[i].phys = amijoy_phys[i];
amijoy->dev[i].id.bustype = BUS_AMIGA; amijoy_dev[i].id.bustype = BUS_AMIGA;
amijoy->dev[i].id.vendor = 0x0001; amijoy_dev[i].id.vendor = 0x0001;
amijoy->dev[i].id.product = 0x0003; amijoy_dev[i].id.product = 0x0003;
amijoy->dev[i].id.version = 0x0100; amijoy_dev[i].id.version = 0x0100;
amijoy_dev[i].private = amijoy_used + i; amijoy_dev[i].private = amijoy_used + i;
...@@ -149,7 +148,7 @@ static int __init amijoy_init(void) ...@@ -149,7 +148,7 @@ static int __init amijoy_init(void)
return 0; return 0;
} }
static void _exit amijoy_exit(void) static void __exit amijoy_exit(void)
{ {
int i; int i;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/delay.h>
#include <asm/amigaints.h> #include <asm/amigaints.h>
#include <asm/amigahw.h> #include <asm/amigahw.h>
...@@ -51,9 +52,9 @@ static unsigned char amikbd_keycode[0x78] = { ...@@ -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, 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, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 98, 55, 78, 87,
42, 54, 58, 29, 56,100 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_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
KERN_WARNING "amikbd: keyboard lost sync\n", KERN_WARNING "amikbd: keyboard lost sync\n",
KERN_WARNING "amikbd: keyboard buffer overflow\n", KERN_WARNING "amikbd: keyboard buffer overflow\n",
...@@ -79,19 +80,19 @@ static void amikbd_interrupt(int irq, void *dummy, struct pt_regs *fp) ...@@ -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 */ ciaa.cra &= ~0x40; /* switch CIA serial port to input mode */
down = scancode & 1; /* lowest bit is release bit */ down = scancode & 1; /* lowest bit is release bit */
scancode = scancode >> 1; scancode >>= 1;
if (scancode < 0x78) { /* scancodes < 0x78 are keys */ if (scancode < 0x78) { /* scancodes < 0x78 are keys */
scancode = amikbd_keycode[scancode]; 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, 1);
input_report_key(&amikbd_dev, scancode, 0); input_report_key(&amikbd_dev, scancode, 0);
input_sync(&amikbd_dev); input_sync(&amikbd_dev);
return; return;
} }
input_report_key(&amikbd_dev, scancode, down); input_report_key(&amikbd_dev, scancode, down);
input_sync(&amikbd_dev); input_sync(&amikbd_dev);
...@@ -106,20 +107,20 @@ static int __init amikbd_init(void) ...@@ -106,20 +107,20 @@ static int __init amikbd_init(void)
int i; int i;
if (!AMIGAHW_PRESENT(AMI_KEYBOARD)) 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; 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; amikbd_dev.keycode = amikbd_keycode;
for (i = 0; i < 0x78; i++) for (i = 0; i < 0x78; i++)
if (amikbd_keycode[i]) if (amikbd_keycode[i])
set_bit(amikbd_keycode[i], amikbd_dev.keybit); set_bit(amikbd_keycode[i], amikbd_dev.keybit);
ciaa.cra &= ~0x41; /* serial data in, turn off TA */ 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.name = amikbd_name;
amikbd_dev.phys = amikbd_phys; amikbd_dev.phys = amikbd_phys;
......
...@@ -64,7 +64,7 @@ static void amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp) ...@@ -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_X, dx);
input_report_rel(&amimouse_dev, REL_Y, dy); input_report_rel(&amimouse_dev, REL_Y, dy);
input_report_key(&amimouse_dev, BTN_LEFT, ciaa.pra & 0x40); 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_MIDDLE, potgor & 0x0100);
input_report_key(&amimouse_dev, BTN_RIGHT, potgor & 0x0400); input_report_key(&amimouse_dev, BTN_RIGHT, potgor & 0x0400);
...@@ -84,9 +84,9 @@ static int amimouse_open(struct input_dev *dev) ...@@ -84,9 +84,9 @@ static int amimouse_open(struct input_dev *dev)
amimouse_lastx = joy0dat & 0xff; amimouse_lastx = joy0dat & 0xff;
amimouse_lasty = joy0dat >> 8; 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--; 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; return -EBUSY;
} }
...@@ -116,10 +116,11 @@ static int __init amimouse_init(void) ...@@ -116,10 +116,11 @@ static int __init amimouse_init(void)
amimouse_dev.id.vendor = 0x0001; amimouse_dev.id.vendor = 0x0001;
amimouse_dev.id.product = 0x0002; amimouse_dev.id.product = 0x0002;
amimouse_dev.id.version = 0x0100; amimouse_dev.id.version = 0x0100;
input_register_device(&amimouse_dev); input_register_device(&amimouse_dev);
printk(KERN_INFO "input: %s at joy0dat\n", amimouse_name); printk(KERN_INFO "input: %s at joy0dat\n", amimouse_name);
return 0;
} }
static void __exit amimouse_exit(void) static void __exit amimouse_exit(void)
......
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