Commit 51cbfa04 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/vojtech/input

into ppc970.osdl.org:/home/torvalds/v2.5/linux
parents 1b2ed5b7 9c930c3f
...@@ -434,7 +434,7 @@ Here are described their command lines: ...@@ -434,7 +434,7 @@ Here are described their command lines:
Using gamecon.c you can connect up to five devices to one parallel port. It Using gamecon.c you can connect up to five devices to one parallel port. It
uses the following kernel/module command line: uses the following kernel/module command line:
gc=port,pad1,pad2,pad3,pad4,pad5 gamecon.map=port,pad1,pad2,pad3,pad4,pad5
Where 'port' the number of the parport interface (eg. 0 for parport0). Where 'port' the number of the parport interface (eg. 0 for parport0).
...@@ -457,15 +457,15 @@ uses the following kernel/module command line: ...@@ -457,15 +457,15 @@ uses the following kernel/module command line:
your controller plugged in before initializing. your controller plugged in before initializing.
Should you want to use more than one of parallel ports at once, you can use Should you want to use more than one of parallel ports at once, you can use
gc_2 and gc_3 as additional command line parameters for two more parallel gamecon.map2 and gamecon.map3 as additional command line parameters for two
ports. more parallel ports.
3.2 db9.c 3.2 db9.c
~~~~~~~~~ ~~~~~~~~~
Apart from making an interface, there is nothing difficult on using the Apart from making an interface, there is nothing difficult on using the
db9.c driver. It uses the following kernel/module command line: db9.c driver. It uses the following kernel/module command line:
db9=port,type db9.dev=port,type
Where 'port' is the number of the parport interface (eg. 0 for parport0). Where 'port' is the number of the parport interface (eg. 0 for parport0).
...@@ -489,14 +489,14 @@ Old parallel ports may not have this feature. ...@@ -489,14 +489,14 @@ Old parallel ports may not have this feature.
10 | Amiga CD32 pad 10 | Amiga CD32 pad
Should you want to use more than one of these joysticks/pads at once, you Should you want to use more than one of these joysticks/pads at once, you
can use db9_2 and db9_3 as additional command line parameters for two can use db9.dev2 and db9.dev3 as additional command line parameters for two
more joysticks/pads. more joysticks/pads.
3.3 turbografx.c 3.3 turbografx.c
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
The turbografx.c driver uses a very simple kernel/module command line: The turbografx.c driver uses a very simple kernel/module command line:
tgfx=port,js1,js2,js3,js4,js5,js6,js7 turbografx.map=port,js1,js2,js3,js4,js5,js6,js7
Where 'port' is the number of the parport interface (eg. 0 for parport0). Where 'port' is the number of the parport interface (eg. 0 for parport0).
...@@ -504,8 +504,8 @@ more joysticks/pads. ...@@ -504,8 +504,8 @@ more joysticks/pads.
interface ports 1-7 have. For a standard multisystem joystick, this is 1. interface ports 1-7 have. For a standard multisystem joystick, this is 1.
Should you want to use more than one of these interfaces at once, you can Should you want to use more than one of these interfaces at once, you can
use tgfx_2 and tgfx_3 as additional command line parameters for two more use turbografx.map2 and turbografx.map3 as additional command line parameters
interfaces. for two more interfaces.
3.4 PC parallel port pinout 3.4 PC parallel port pinout
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -111,7 +111,7 @@ your needs: ...@@ -111,7 +111,7 @@ your needs:
alias tty-ldisc-2 serport alias tty-ldisc-2 serport
alias char-major-13 input alias char-major-13 input
above input joydev ns558 analog above input joydev ns558 analog
options analog js=gamepad options analog map=gamepad,none,2btn
2.5 Verifying that it works 2.5 Verifying that it works
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -185,7 +185,7 @@ you'll need to specify the types either on the kernel command line or on the ...@@ -185,7 +185,7 @@ you'll need to specify the types either on the kernel command line or on the
module command line, when inserting analog.o into the kernel. The module command line, when inserting analog.o into the kernel. The
parameters are: parameters are:
js=type,type,type,.... analog.map=<type1>,<type2>,<type3>,....
'type' is type of the joystick from the table below, defining joysticks 'type' is type of the joystick from the table below, defining joysticks
present on gameports in the system, starting with gameport0, second 'type' present on gameports in the system, starting with gameport0, second 'type'
...@@ -419,7 +419,7 @@ card. ...@@ -419,7 +419,7 @@ card.
Amiga joysticks, connected to an Amiga, are supported by the amijoy.c Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
driver. Since they can't be autodetected, the driver has a command line. driver. Since they can't be autodetected, the driver has a command line.
amijoy=a,b amijoy.map=<a>,<b>
a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
the Amiga. the Amiga.
......
...@@ -162,7 +162,15 @@ running once the system is up. ...@@ -162,7 +162,15 @@ running once the system is up.
Format: <host-scsi-id>,<target-scsi-id>,<max-rate>,<max-offset> Format: <host-scsi-id>,<target-scsi-id>,<max-rate>,<max-offset>
See also header of drivers/scsi/AM53C974.c. See also header of drivers/scsi/AM53C974.c.
amijoy= [HW,JOY] Amiga joystick support amijoy.map= [HW,JOY] Amiga joystick support
Map of devices attached to JOY0DAT and JOY1DAT
Format: <a>,<b>
See also Documentation/kernel/input/joystick.txt
analog.map= [HW,JOY] Analog joystick and gamepad support
Specifies type or capabilities of an analog joystick
connected to one of 16 gameports
Format: <type1>,<type2>,..<type16>
apc= [HW,SPARC] Power management functions (SPARCstation-4/5 + deriv.) apc= [HW,SPARC] Power management functions (SPARCstation-4/5 + deriv.)
Format: noidle Format: noidle
...@@ -185,11 +193,18 @@ running once the system is up. ...@@ -185,11 +193,18 @@ running once the system is up.
atascsi= [HW,SCSI] Atari SCSI atascsi= [HW,SCSI] Atari SCSI
atkbd.extra= [HW] Enable extra LEDs and keys on IBM RapidAccess, EzKey
and similar keyboards
atkbd.reset= [HW] Reset keyboard during initialization
atkbd.set= [HW] Select keyboard code set atkbd.set= [HW] Select keyboard code set
Format: <int> Format: <int> (2 = AT (default) 3 = PS/2)
atkbd.scroll= [HW] Enable scroll wheel on MS Office and similar keyboards
atkbd.softrepeat= atkbd.softrepeat=
[HW] Use software keyboard repeat [HW] Use software keyboard repeat
atkbd.reset= [HW] Reset keyboard during initialization
autotest [IA64] autotest [IA64]
...@@ -291,9 +306,10 @@ running once the system is up. ...@@ -291,9 +306,10 @@ running once the system is up.
dasd= [HW,NET] dasd= [HW,NET]
See header of drivers/s390/block/dasd_devmap.c. See header of drivers/s390/block/dasd_devmap.c.
db9= [HW,JOY] db9.dev[2|3]= [HW,JOY] Multisystem joystick support via parallel port
db9_2= (one device per port)
db9_3= Format: <port#>,<type>
See also Documentation/input/joystick-parport.txt
debug [KNL] Enable kernel debugging (events log level). debug [KNL] Enable kernel debugging (events log level).
...@@ -388,11 +404,13 @@ running once the system is up. ...@@ -388,11 +404,13 @@ running once the system is up.
ftape= [HW] Floppy Tape subsystem debugging options. ftape= [HW] Floppy Tape subsystem debugging options.
See Documentation/ftape.txt. See Documentation/ftape.txt.
gamma= [HW,DRM] gamecon.map[2|3]=
[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
support via parallel port (up to 5 devices per port)
Format: <port#>,<pad1>,<pad2>,<pad3>,<pad4>,<pad5>
See also Documentation/input/joystick-parport.txt
gc= [HW,JOY] gamma= [HW,DRM]
gc_2= See Documentation/input/joystick-parport.txt.
gc_3=
gdth= [HW,SCSI] gdth= [HW,SCSI]
See header of drivers/scsi/gdth.c. See header of drivers/scsi/gdth.c.
...@@ -620,9 +638,9 @@ running once the system is up. ...@@ -620,9 +638,9 @@ running once the system is up.
mga= [HW,DRM] mga= [HW,DRM]
mousedev.xres [MOUSE] Horizontal screen resolution, used for devices mousedev.xres= [MOUSE] Horizontal screen resolution, used for devices
reporting absolute coordinates, such as tablets reporting absolute coordinates, such as tablets
mousedev.yres [MOUSE] Vertical screen resolution, used for devices mousedev.yres= [MOUSE] Vertical screen resolution, used for devices
reporting absolute coordinates, such as tablets reporting absolute coordinates, such as tablets
mpu401= [HW,OSS] mpu401= [HW,OSS]
...@@ -1168,10 +1186,6 @@ running once the system is up. ...@@ -1168,10 +1186,6 @@ running once the system is up.
tdfx= [HW,DRM] tdfx= [HW,DRM]
tgfx= [HW,JOY] TurboGraFX parallel port interface
tgfx_2= See Documentation/input/joystick-parport.txt.
tgfx_3=
thash_entries= [KNL,NET] thash_entries= [KNL,NET]
Set number of hash buckets for TCP connection Set number of hash buckets for TCP connection
...@@ -1193,8 +1207,13 @@ running once the system is up. ...@@ -1193,8 +1207,13 @@ running once the system is up.
trix= [HW,OSS] MediaTrix AudioTrix Pro trix= [HW,OSS] MediaTrix AudioTrix Pro
Format: <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq> Format: <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq>
tsdev.xres [TS] Horizontal screen resolution. tsdev.xres= [TS] Horizontal screen resolution.
tsdev.yres [TS] Vertical screen resolution. tsdev.yres= [TS] Vertical screen resolution.
turbografx.map[2|3]=
[HW,JOY] TurboGraFX parallel port interface
Format: <port#>,<js1>,<js2>,<js3>,<js4>,<js5>,<js6>,<js7>
See also Documentation/input/joystick-parport.txt
u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter
See header of drivers/scsi/u14-34f.c. See header of drivers/scsi/u14-34f.c.
......
...@@ -28,7 +28,7 @@ in the package: See the file COPYING. ...@@ -28,7 +28,7 @@ in the package: See the file COPYING.
1. Usage 1. Usage
~~~~~~~~ ~~~~~~~~
The drivers/usb/acm.c drivers works with USB modems and USB ISDN terminal The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
adapters that conform to the Universal Serial Bus Communication Device Class adapters that conform to the Universal Serial Bus Communication Device Class
Abstract Control Model (USB CDC ACM) specification. Abstract Control Model (USB CDC ACM) specification.
...@@ -65,9 +65,9 @@ minor/major numbers anywhere you want, but either the above location or ...@@ -65,9 +65,9 @@ minor/major numbers anywhere you want, but either the above location or
To use the modems you need these modules loaded: To use the modems you need these modules loaded:
usbcore.o usbcore.ko
usb-[uo]hci.o or uhci.o uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
acm.o cdc-acm.ko
After that, the modem[s] should be accessible. You should be able to use After that, the modem[s] should be accessible. You should be able to use
minicom, ppp and mgetty with them. minicom, ppp and mgetty with them.
......
...@@ -198,11 +198,6 @@ source "drivers/input/Kconfig" ...@@ -198,11 +198,6 @@ source "drivers/input/Kconfig"
source "drivers/char/Kconfig" source "drivers/char/Kconfig"
config KBDMOUSE
bool
depends on ARCH_ACORN && BUSMOUSE=y
default y
source "drivers/media/Kconfig" source "drivers/media/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
......
...@@ -599,30 +599,6 @@ config PC9800_OLDLP_CONSOLE ...@@ -599,30 +599,6 @@ config PC9800_OLDLP_CONSOLE
bool "Support for console on line printer" bool "Support for console on line printer"
depends on PC9800_OLDLP depends on PC9800_OLDLP
menu "Mice"
config BUSMOUSE
tristate "Bus Mouse Support"
---help---
Say Y here if your machine has a bus mouse as opposed to a serial
mouse. Most people have a regular serial MouseSystem or
Microsoft mouse (made by Logitech) that plugs into a COM port
(rectangular with 9 or 25 pins). These people say N here.
If you have a laptop, you either have to check the documentation or
experiment a bit to find out whether the trackball is a serial mouse
or not; it's best to say Y here for you.
This is the generic bus mouse driver code. If you have a bus mouse,
you will have to say Y here and also to the specific driver for your
mouse below.
To compile this driver as a module, choose M here: the
module will be called busmouse.
endmenu
config QIC02_TAPE config QIC02_TAPE
tristate "QIC-02 tape support" tristate "QIC-02 tape support"
help help
......
...@@ -49,7 +49,6 @@ obj-$(CONFIG_PRINTER) += lp.o ...@@ -49,7 +49,6 @@ obj-$(CONFIG_PRINTER) += lp.o
obj-$(CONFIG_TIPAR) += tipar.o obj-$(CONFIG_TIPAR) += tipar.o
obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o
obj-$(CONFIG_BUSMOUSE) += busmouse.o
obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_DTLK) += dtlk.o
obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_R3964) += n_r3964.o
obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_APPLICOM) += applicom.o
......
...@@ -209,7 +209,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -209,7 +209,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct evdev *evdev = list->evdev; struct evdev *evdev = list->evdev;
struct input_dev *dev = evdev->handle.dev; struct input_dev *dev = evdev->handle.dev;
struct input_absinfo abs; struct input_absinfo abs;
int t, u, v; int i, t, u, v;
if (!evdev->exist) return -ENODEV; if (!evdev->exist) return -ENODEV;
...@@ -234,6 +234,9 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -234,6 +234,9 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
u = SET_INPUT_KEYCODE(dev, t, v); u = SET_INPUT_KEYCODE(dev, t, v);
clear_bit(u, dev->keybit); clear_bit(u, dev->keybit);
set_bit(v, dev->keybit); set_bit(v, dev->keybit);
for (i = 0; i < dev->keycodemax; i++)
if (INPUT_KEYCODE(dev,i) == u)
set_bit(u, dev->keybit);
return 0; return 0;
case EVIOCSFF: case EVIOCSFF:
......
...@@ -77,7 +77,7 @@ static void ns558_isa_probe(int io) ...@@ -77,7 +77,7 @@ static void ns558_isa_probe(int io)
* No one should be using this address. * No one should be using this address.
*/ */
if (check_region(io, 1)) if (!request_region(io, 1, "ns558-isa"))
return; return;
/* /*
...@@ -89,7 +89,8 @@ static void ns558_isa_probe(int io) ...@@ -89,7 +89,8 @@ static void ns558_isa_probe(int io)
outb(~c & ~3, io); outb(~c & ~3, io);
if (~(u = v = inb(io)) & 3) { if (~(u = v = inb(io)) & 3) {
outb(c, io); outb(c, io);
return; i = 0;
goto out;
} }
/* /*
* After a trigger, there must be at least some bits changing. * After a trigger, there must be at least some bits changing.
...@@ -99,7 +100,8 @@ static void ns558_isa_probe(int io) ...@@ -99,7 +100,8 @@ static void ns558_isa_probe(int io)
if (u == v) { if (u == v) {
outb(c, io); outb(c, io);
return; i = 0;
goto out;
} }
wait_ms(3); wait_ms(3);
/* /*
...@@ -110,7 +112,8 @@ static void ns558_isa_probe(int io) ...@@ -110,7 +112,8 @@ static void ns558_isa_probe(int io)
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
if ((u ^ inb(io)) & 0xf) { if ((u ^ inb(io)) & 0xf) {
outb(c, io); outb(c, io);
return; i = 0;
goto out;
} }
/* /*
* And now find the number of mirrors of the port. * And now find the number of mirrors of the port.
...@@ -118,7 +121,9 @@ static void ns558_isa_probe(int io) ...@@ -118,7 +121,9 @@ static void ns558_isa_probe(int io)
for (i = 1; i < 5; i++) { for (i = 1; i < 5; i++) {
if (check_region(io & (-1 << i), (1 << i))) /* Don't disturb anyone */ release_region(io & (-1 << (i-1)), (1 << (i-1)));
if (!request_region(io & (-1 << i), (1 << i), "ns558-isa")) /* Don't disturb anyone */
break; break;
outb(0xff, io & (-1 << i)); outb(0xff, io & (-1 << i));
...@@ -126,15 +131,22 @@ static void ns558_isa_probe(int io) ...@@ -126,15 +131,22 @@ static void ns558_isa_probe(int io)
if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++; if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;
wait_ms(3); wait_ms(3);
if (b > 300) /* We allow 30% difference */ if (b > 300) { /* We allow 30% difference */
release_region(io & (-1 << i), (1 << i));
break; break;
} }
}
i--; i--;
if (i != 4) {
if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))
return;
}
if (!(port = kmalloc(sizeof(struct ns558), GFP_KERNEL))) { if (!(port = kmalloc(sizeof(struct ns558), GFP_KERNEL))) {
printk(KERN_ERR "ns558: Memory allocation failed.\n"); printk(KERN_ERR "ns558: Memory allocation failed.\n");
return; goto out;
} }
memset(port, 0, sizeof(struct ns558)); memset(port, 0, sizeof(struct ns558));
...@@ -148,8 +160,6 @@ static void ns558_isa_probe(int io) ...@@ -148,8 +160,6 @@ static void ns558_isa_probe(int io)
sprintf(port->phys, "isa%04x/gameport0", io & (-1 << i)); sprintf(port->phys, "isa%04x/gameport0", io & (-1 << i));
sprintf(port->name, "NS558 ISA"); sprintf(port->name, "NS558 ISA");
request_region(io & (-1 << i), (1 << i), "ns558-isa");
gameport_register_port(&port->gameport); gameport_register_port(&port->gameport);
printk(KERN_INFO "gameport: NS558 ISA at %#x", port->gameport.io); printk(KERN_INFO "gameport: NS558 ISA at %#x", port->gameport.io);
...@@ -157,6 +167,9 @@ static void ns558_isa_probe(int io) ...@@ -157,6 +167,9 @@ static void ns558_isa_probe(int io)
printk(" speed %d kHz\n", port->gameport.speed); printk(" speed %d kHz\n", port->gameport.speed);
list_add(&port->node, &ns558_list); list_add(&port->node, &ns558_list);
return;
out:
release_region(io & (-1 << i), (1 << i));
} }
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
...@@ -276,6 +289,7 @@ void __exit ns558_exit(void) ...@@ -276,6 +289,7 @@ void __exit ns558_exit(void)
#endif #endif
case NS558_ISA: case NS558_ISA:
release_region(port->gameport.io & ~(port->size - 1), port->size); release_region(port->gameport.io & ~(port->size - 1), port->size);
kfree(port);
break; break;
default: default:
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -42,10 +43,15 @@ ...@@ -42,10 +43,15 @@
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");
MODULE_PARM(amijoy, "1-2i");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int amijoy[2] = { 0, 1 }; static int amijoy[2] = { 0, 1 };
static int amijoy_nargs;
module_param_array_named(map, amijoy, uint, amijoy_nargs, 0);
MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)");
__obsolete_setup("amijoy=");
static int amijoy_used[2] = { 0, 0 }; static int amijoy_used[2] = { 0, 0 };
static struct input_dev amijoy_dev[2]; static struct input_dev amijoy_dev[2];
static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" }; static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" };
...@@ -101,17 +107,6 @@ static void amijoy_close(struct input_dev *dev) ...@@ -101,17 +107,6 @@ static void amijoy_close(struct input_dev *dev)
free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt); free_irq(IRQ_AMIGA_VERTB, amijoy_interrupt);
} }
static int __init amijoy_setup(char *str)
{
int i;
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;
}
__setup("amijoy=", amijoy_setup);
static int __init amijoy_init(void) static int __init amijoy_init(void)
{ {
int i, j; int i, j;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -50,9 +51,12 @@ MODULE_LICENSE("GPL"); ...@@ -50,9 +51,12 @@ MODULE_LICENSE("GPL");
#define ANALOG_PORTS 16 #define ANALOG_PORTS 16
static char *js[ANALOG_PORTS]; static char *js[ANALOG_PORTS];
static int js_nargs;
static int analog_options[ANALOG_PORTS]; static int analog_options[ANALOG_PORTS];
MODULE_PARM(js, "1-" __MODULE_STRING(ANALOG_PORTS) "s"); module_param_array_named(map, js, charp, js_nargs, 0);
MODULE_PARM_DESC(js, "Analog joystick options"); MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities");
__obsolete_setup("js=");
/* /*
* Times, feature definitions. * Times, feature definitions.
...@@ -711,7 +715,7 @@ static void analog_parse_options(void) ...@@ -711,7 +715,7 @@ static void analog_parse_options(void)
int i, j; int i, j;
char *end; char *end;
for (i = 0; i < ANALOG_PORTS && js[i]; i++) { for (i = 0; i < js_nargs; i++) {
for (j = 0; analog_types[j].name; j++) for (j = 0; analog_types[j].name; j++)
if (!strcmp(analog_types[j].name, js[i])) { if (!strcmp(analog_types[j].name, js[i])) {
...@@ -742,24 +746,6 @@ static struct gameport_dev analog_dev = { ...@@ -742,24 +746,6 @@ static struct gameport_dev analog_dev = {
.disconnect = analog_disconnect, .disconnect = analog_disconnect,
}; };
#ifndef MODULE
static int __init analog_setup(char *str)
{
char *s = str;
int i = 0;
if (!str || !*str) return 0;
while ((str = s) && (i < ANALOG_PORTS)) {
if ((s = strchr(str,','))) *s++ = 0;
js[i++] = str;
}
return 1;
}
__setup("js=", analog_setup);
#endif
int __init analog_init(void) int __init analog_init(void)
{ {
analog_parse_options(); analog_parse_options();
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/parport.h> #include <linux/parport.h>
...@@ -42,9 +43,24 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); ...@@ -42,9 +43,24 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver"); MODULE_DESCRIPTION("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(db9, "2i"); static int db9[] __initdata = { -1, 0 };
MODULE_PARM(db9_2, "2i"); static int db9_nargs __initdata = 0;
MODULE_PARM(db9_3, "2i"); module_param_array_named(dev, db9, int, db9_nargs, 0);
MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)");
static int db9_2[] __initdata = { -1, 0 };
static int db9_nargs_2 __initdata = 0;
module_param_array_named(dev2, db9_2, int, db9_nargs_2, 0);
MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)");
static int db9_3[] __initdata = { -1, 0 };
static int db9_nargs_3 __initdata = 0;
module_param_array_named(dev3, db9_3, int, db9_nargs_3, 0);
MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)");
__obsolete_setup("db9=");
__obsolete_setup("db9_2=");
__obsolete_setup("db9_3=");
#define DB9_MULTI_STICK 0x01 #define DB9_MULTI_STICK 0x01
#define DB9_MULTI2_STICK 0x02 #define DB9_MULTI2_STICK 0x02
...@@ -76,10 +92,6 @@ MODULE_PARM(db9_3, "2i"); ...@@ -76,10 +92,6 @@ MODULE_PARM(db9_3, "2i");
#define DB9_GENESIS6_DELAY 14 #define DB9_GENESIS6_DELAY 14
#define DB9_REFRESH_TIME HZ/100 #define DB9_REFRESH_TIME HZ/100
static int db9[] __initdata = { -1, 0 };
static int db9_2[] __initdata = { -1, 0 };
static int db9_3[] __initdata = { -1, 0 };
struct db9 { struct db9 {
struct input_dev dev[DB9_MAX_DEVICES]; struct input_dev dev[DB9_MAX_DEVICES];
struct timer_list timer; struct timer_list timer;
...@@ -518,7 +530,7 @@ static void db9_close(struct input_dev *dev) ...@@ -518,7 +530,7 @@ static void db9_close(struct input_dev *dev)
} }
} }
static struct db9 __init *db9_probe(int *config) static struct db9 __init *db9_probe(int *config, int nargs)
{ {
struct db9 *db9; struct db9 *db9;
struct parport *pp; struct parport *pp;
...@@ -526,6 +538,12 @@ static struct db9 __init *db9_probe(int *config) ...@@ -526,6 +538,12 @@ static struct db9 __init *db9_probe(int *config)
if (config[0] < 0) if (config[0] < 0)
return NULL; return NULL;
if (nargs < 2) {
printk(KERN_ERR "db9.c: Device type must be specified.\n");
return NULL;
}
if (config[1] < 1 || config[1] >= DB9_MAX_PAD || !db9_buttons[config[1]]) { if (config[1] < 1 || config[1] >= DB9_MAX_PAD || !db9_buttons[config[1]]) {
printk(KERN_ERR "db9.c: bad config\n"); printk(KERN_ERR "db9.c: bad config\n");
return NULL; return NULL;
...@@ -601,38 +619,11 @@ static struct db9 __init *db9_probe(int *config) ...@@ -601,38 +619,11 @@ static struct db9 __init *db9_probe(int *config)
return db9; return db9;
} }
#ifndef MODULE
static int __init db9_setup(char *str)
{
int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) db9[i] = ints[i + 1];
return 1;
}
static int __init db9_setup_2(char *str)
{
int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) db9_2[i] = ints[i + 1];
return 1;
}
static int __init db9_setup_3(char *str)
{
int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) db9_3[i] = ints[i + 1];
return 1;
}
__setup("db9=", db9_setup);
__setup("db9_2=", db9_setup_2);
__setup("db9_3=", db9_setup_3);
#endif
int __init db9_init(void) int __init db9_init(void)
{ {
db9_base[0] = db9_probe(db9); db9_base[0] = db9_probe(db9, db9_nargs);
db9_base[1] = db9_probe(db9_2); db9_base[1] = db9_probe(db9_2, db9_nargs_2);
db9_base[2] = db9_probe(db9_3); db9_base[2] = db9_probe(db9_3, db9_nargs_3);
if (db9_base[0] || db9_base[1] || db9_base[2]) if (db9_base[0] || db9_base[1] || db9_base[2])
return 0; return 0;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/parport.h> #include <linux/parport.h>
#include <linux/input.h> #include <linux/input.h>
...@@ -43,10 +44,26 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); ...@@ -43,10 +44,26 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver"); MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(gc, "2-6i"); static int gc[] __initdata = { -1, 0, 0, 0, 0, 0 };
MODULE_PARM(gc_2,"2-6i"); static int gc_nargs __initdata = 0;
MODULE_PARM(gc_3,"2-6i"); module_param_array_named(map, gc, int, gc_nargs, 0);
MODULE_PARM(gc_psx_delay, "i"); MODULE_PARM_DESC(map, "Describers first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)");
static int gc_2[] __initdata = { -1, 0, 0, 0, 0, 0 };
static int gc_nargs_2 __initdata = 0;
module_param_array_named(map2, gc_2, int, gc_nargs_2, 0);
MODULE_PARM_DESC(map2, "Describers second set of devices");
static int gc_3[] __initdata = { -1, 0, 0, 0, 0, 0 };
static int gc_nargs_3 __initdata = 0;
module_param_array_named(map3, gc_3, int, gc_nargs_3, 0);
MODULE_PARM_DESC(map3, "Describers third set of devices");
__obsolete_setup("gc=");
__obsolete_setup("gc_2=");
__obsolete_setup("gc_3=");
/* see also gs_psx_delay parameter in PSX support section */
#define GC_SNES 1 #define GC_SNES 1
#define GC_NES 2 #define GC_NES 2
...@@ -71,10 +88,6 @@ struct gc { ...@@ -71,10 +88,6 @@ struct gc {
static struct gc *gc_base[3]; static struct gc *gc_base[3];
static int gc[] __initdata = { -1, 0, 0, 0, 0, 0 };
static int gc_2[] __initdata = { -1, 0, 0, 0, 0, 0 };
static int gc_3[] __initdata = { -1, 0, 0, 0, 0, 0 };
static int gc_status_bit[] = { 0x40, 0x80, 0x20, 0x10, 0x08 }; static int gc_status_bit[] = { 0x40, 0x80, 0x20, 0x10, 0x08 };
static char *gc_names[] = { NULL, "SNES pad", "NES pad", "NES FourPort", "Multisystem joystick", static char *gc_names[] = { NULL, "SNES pad", "NES pad", "NES FourPort", "Multisystem joystick",
...@@ -232,6 +245,11 @@ static void gc_multi_read_packet(struct gc *gc, int length, unsigned char *data) ...@@ -232,6 +245,11 @@ static void gc_multi_read_packet(struct gc *gc, int length, unsigned char *data)
#define GC_PSX_LEN(x) ((x) & 0xf) /* Low nibble is length in words */ #define GC_PSX_LEN(x) ((x) & 0xf) /* Low nibble is length in words */
static int gc_psx_delay = GC_PSX_DELAY; static int gc_psx_delay = GC_PSX_DELAY;
module_param_named(psx_delay, gc_psx_delay, uint, 0);
MODULE_PARM_DESC(psx_delay, "Delay when accessing Sony PSX controller (usecs)");
__obsolete_setup("gc_psx_delay=");
static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y }; static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y };
static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y, static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y,
BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR }; BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR };
...@@ -468,7 +486,7 @@ static void gc_close(struct input_dev *dev) ...@@ -468,7 +486,7 @@ static void gc_close(struct input_dev *dev)
} }
} }
static struct gc __init *gc_probe(int *config) static struct gc __init *gc_probe(int *config, int nargs)
{ {
struct gc *gc; struct gc *gc;
struct parport *pp; struct parport *pp;
...@@ -478,6 +496,11 @@ static struct gc __init *gc_probe(int *config) ...@@ -478,6 +496,11 @@ static struct gc __init *gc_probe(int *config)
if (config[0] < 0) if (config[0] < 0)
return NULL; return NULL;
if (nargs < 2) {
printk(KERN_ERR "gamecon.c: at least one device must be specified\n");
return NULL;
}
pp = parport_find_number(config[0]); pp = parport_find_number(config[0]);
if (!pp) { if (!pp) {
...@@ -507,7 +530,7 @@ static struct gc __init *gc_probe(int *config) ...@@ -507,7 +530,7 @@ static struct gc __init *gc_probe(int *config)
gc->timer.data = (long) gc; gc->timer.data = (long) gc;
gc->timer.function = gc_timer; gc->timer.function = gc_timer;
for (i = 0; i < 5; i++) { for (i = 0; i < nargs - 1; i++) {
if (!config[i + 1]) if (!config[i + 1])
continue; continue;
...@@ -632,44 +655,11 @@ static struct gc __init *gc_probe(int *config) ...@@ -632,44 +655,11 @@ static struct gc __init *gc_probe(int *config)
return gc; return gc;
} }
#ifndef MODULE
static int __init gc_setup(char *str)
{
int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 6; i++) gc[i] = ints[i + 1];
return 1;
}
static int __init gc_setup_2(char *str)
{
int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 6; i++) gc_2[i] = ints[i + 1];
return 1;
}
static int __init gc_setup_3(char *str)
{
int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 6; i++) gc_3[i] = ints[i + 1];
return 1;
}
static int __init gc_psx_setup(char *str)
{
get_option(&str, &gc_psx_delay);
return 1;
}
__setup("gc=", gc_setup);
__setup("gc_2=", gc_setup_2);
__setup("gc_3=", gc_setup_3);
__setup("gc_psx_delay=", gc_psx_setup);
#endif
int __init gc_init(void) int __init gc_init(void)
{ {
gc_base[0] = gc_probe(gc); gc_base[0] = gc_probe(gc, gc_nargs);
gc_base[1] = gc_probe(gc_2); gc_base[1] = gc_probe(gc_2, gc_nargs_2);
gc_base[2] = gc_probe(gc_3); gc_base[2] = gc_probe(gc_3, gc_nargs_3);
if (gc_base[0] || gc_base[1] || gc_base[2]) if (gc_base[0] || gc_base[1] || gc_base[2])
return 0; return 0;
......
...@@ -35,15 +35,31 @@ ...@@ -35,15 +35,31 @@
#include <linux/parport.h> #include <linux/parport.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("TurboGraFX parallel port interface driver"); MODULE_DESCRIPTION("TurboGraFX parallel port interface driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(tgfx, "2-8i"); static int tgfx[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
MODULE_PARM(tgfx_2, "2-8i"); static int tgfx_nargs __initdata = 0;
MODULE_PARM(tgfx_3, "2-8i"); module_param_array_named(map, tgfx, int, tgfx_nargs, 0);
MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<js1>,<js2>,..<js7>");
static int tgfx_2[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
static int tgfx_nargs_2 __initdata = 0;
module_param_array_named(map2, tgfx_2, int, tgfx_nargs_2, 0);
MODULE_PARM_DESC(map2, "Describes second set of devices");
static int tgfx_3[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
static int tgfx_nargs_3 __initdata = 0;
module_param_array_named(map3, tgfx_3, int, tgfx_nargs_3, 0);
MODULE_PARM_DESC(map3, "Describes third set of devices");
__obsolete_setup("tgfx=");
__obsolete_setup("tgfx_2=");
__obsolete_setup("tgfx_3=");
#define TGFX_REFRESH_TIME HZ/100 /* 10 ms */ #define TGFX_REFRESH_TIME HZ/100 /* 10 ms */
...@@ -58,10 +74,6 @@ MODULE_PARM(tgfx_3, "2-8i"); ...@@ -58,10 +74,6 @@ MODULE_PARM(tgfx_3, "2-8i");
#define TGFX_TOP 0x01 #define TGFX_TOP 0x01
#define TGFX_TOP2 0x08 #define TGFX_TOP2 0x08
static int tgfx[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
static int tgfx_2[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
static int tgfx_3[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 };
static int tgfx_buttons[] = { BTN_TRIGGER, BTN_THUMB, BTN_THUMB2, BTN_TOP, BTN_TOP2 }; static int tgfx_buttons[] = { BTN_TRIGGER, BTN_THUMB, BTN_THUMB2, BTN_TOP, BTN_TOP2 };
static char *tgfx_name = "TurboGraFX Multisystem joystick"; static char *tgfx_name = "TurboGraFX Multisystem joystick";
...@@ -133,7 +145,7 @@ static void tgfx_close(struct input_dev *dev) ...@@ -133,7 +145,7 @@ static void tgfx_close(struct input_dev *dev)
* tgfx_probe() probes for tg gamepads. * tgfx_probe() probes for tg gamepads.
*/ */
static struct tgfx __init *tgfx_probe(int *config) static struct tgfx __init *tgfx_probe(int *config, int nargs)
{ {
struct tgfx *tgfx; struct tgfx *tgfx;
struct parport *pp; struct parport *pp;
...@@ -142,6 +154,11 @@ static struct tgfx __init *tgfx_probe(int *config) ...@@ -142,6 +154,11 @@ static struct tgfx __init *tgfx_probe(int *config)
if (config[0] < 0) if (config[0] < 0)
return NULL; return NULL;
if (nargs < 2) {
printk(KERN_ERR "turbografx.c: at least one joystick must be specified\n");
return NULL;
}
pp = parport_find_number(config[0]); pp = parport_find_number(config[0]);
if (!pp) { if (!pp) {
...@@ -171,7 +188,7 @@ static struct tgfx __init *tgfx_probe(int *config) ...@@ -171,7 +188,7 @@ static struct tgfx __init *tgfx_probe(int *config)
tgfx->sticks = 0; tgfx->sticks = 0;
for (i = 0; i < 7; i++) for (i = 0; i < nargs - 1; i++)
if (config[i+1] > 0 && config[i+1] < 6) { if (config[i+1] > 0 && config[i+1] < 6) {
tgfx->sticks |= (1 << i); tgfx->sticks |= (1 << i);
...@@ -212,38 +229,11 @@ static struct tgfx __init *tgfx_probe(int *config) ...@@ -212,38 +229,11 @@ static struct tgfx __init *tgfx_probe(int *config)
return tgfx; return tgfx;
} }
#ifndef MODULE
static int __init tgfx_setup(char *str)
{
int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 8; i++) tgfx[i] = ints[i + 1];
return 1;
}
static int __init tgfx_setup_2(char *str)
{
int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 8; i++) tgfx_2[i] = ints[i + 1];
return 1;
}
static int __init tgfx_setup_3(char *str)
{
int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 8; i++) tgfx_3[i] = ints[i + 1];
return 1;
}
__setup("tgfx=", tgfx_setup);
__setup("tgfx_2=", tgfx_setup_2);
__setup("tgfx_3=", tgfx_setup_3);
#endif
int __init tgfx_init(void) int __init tgfx_init(void)
{ {
tgfx_base[0] = tgfx_probe(tgfx); tgfx_base[0] = tgfx_probe(tgfx, tgfx_nargs);
tgfx_base[1] = tgfx_probe(tgfx_2); tgfx_base[1] = tgfx_probe(tgfx_2, tgfx_nargs_2);
tgfx_base[2] = tgfx_probe(tgfx_3); tgfx_base[2] = tgfx_probe(tgfx_3, tgfx_nargs_3);
if (tgfx_base[0] || tgfx_base[1] || tgfx_base[2]) if (tgfx_base[0] || tgfx_base[1] || tgfx_base[2])
return 0; return 0;
......
...@@ -17,6 +17,7 @@ config KEYBOARD_ATKBD ...@@ -17,6 +17,7 @@ config KEYBOARD_ATKBD
depends on INPUT && INPUT_KEYBOARD depends on INPUT && INPUT_KEYBOARD
select SERIO select SERIO
select SERIO_I8042 if PC select SERIO_I8042 if PC
select SERIO_GSCPS2 if GSC
help help
Say Y here if you want to use a standard AT or PS/2 keyboard. Usually Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
you'll need this, unless you have a different type keyboard (USB, ADB you'll need this, unless you have a different type keyboard (USB, ADB
...@@ -40,6 +41,19 @@ config KEYBOARD_SUNKBD ...@@ -40,6 +41,19 @@ config KEYBOARD_SUNKBD
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called sunkbd. module will be called sunkbd.
config KEYBOARD_LKKBD
tristate "DECstation/VAXstation LK201/LK401 keyboard support"
depends on INPUT && INPUT_KEYBOARD
select SERIO
help
Say Y here if you want to use a LK201 or LK401 style serial
keyboard. This keyboard is also useable on PCs if you attach
it with the inputattach program. The connector pinout is
described within lkkbd.c.
To compile this driver as a module, choose M here: the
module will be called lkkbd.
config KEYBOARD_XTKBD config KEYBOARD_XTKBD
tristate "XT Keyboard support" tristate "XT Keyboard support"
depends on INPUT && INPUT_KEYBOARD depends on INPUT && INPUT_KEYBOARD
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o
obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o
obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o
obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
......
...@@ -30,21 +30,17 @@ ...@@ -30,21 +30,17 @@
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("AT and PS/2 keyboard driver"); MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
MODULE_PARM(atkbd_set, "1i");
MODULE_PARM(atkbd_reset, "1i");
MODULE_PARM(atkbd_softrepeat, "1i");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int atkbd_set = 2; static int atkbd_set = 2;
module_param_named(set, atkbd_set, int, 0); module_param_named(set, atkbd_set, int, 0);
MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)"); MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3 = PS/2 native)");
#if defined(__i386__) || defined(__x86_64__) || defined(__hppa__) #if defined(__i386__) || defined(__x86_64__) || defined(__hppa__)
static int atkbd_reset; static int atkbd_reset;
#else #else
static int atkbd_reset = 1; static int atkbd_reset = 1;
#endif #endif
static int atkbd_softrepeat;
module_param_named(reset, atkbd_reset, bool, 0); module_param_named(reset, atkbd_reset, bool, 0);
MODULE_PARM_DESC(reset, "Reset keyboard during initialization"); MODULE_PARM_DESC(reset, "Reset keyboard during initialization");
...@@ -52,6 +48,18 @@ static int atkbd_softrepeat; ...@@ -52,6 +48,18 @@ static int atkbd_softrepeat;
module_param_named(softrepeat, atkbd_softrepeat, bool, 0); module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat"); MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
static int atkbd_scroll;
module_param_named(scroll, atkbd_scroll, bool, 0);
MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
static int atkbd_extra;
module_param_named(extra, atkbd_extra, bool, 0);
MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards");
__obsolete_setup("atkbd_set=");
__obsolete_setup("atkbd_reset");
__obsolete_setup("atkbd_softrepeat=");
/* /*
* Scancode to keycode tables. These are just the default setting, and * Scancode to keycode tables. These are just the default setting, and
* are loadable via an userland utility. * are loadable via an userland utility.
...@@ -127,11 +135,11 @@ static unsigned char atkbd_unxlate_table[128] = { ...@@ -127,11 +135,11 @@ static unsigned char atkbd_unxlate_table[128] = {
#define ATKBD_CMD_EX_SETLEDS 0x20eb #define ATKBD_CMD_EX_SETLEDS 0x20eb
#define ATKBD_CMD_OK_GETID 0x02e8 #define ATKBD_CMD_OK_GETID 0x02e8
#define ATKBD_RET_ACK 0xfa #define ATKBD_RET_ACK 0xfa
#define ATKBD_RET_NAK 0xfe #define ATKBD_RET_NAK 0xfe
#define ATKBD_RET_BAT 0xaa #define ATKBD_RET_BAT 0xaa
#define ATKBD_RET_EMUL0 0xe0 #define ATKBD_RET_EMUL0 0xe0
#define ATKBD_RET_EMULX 0x80
#define ATKBD_RET_EMUL1 0xe1 #define ATKBD_RET_EMUL1 0xe1
#define ATKBD_RET_RELEASE 0xf0 #define ATKBD_RET_RELEASE 0xf0
#define ATKBD_RET_HANGUEL 0xf1 #define ATKBD_RET_HANGUEL 0xf1
...@@ -141,6 +149,22 @@ static unsigned char atkbd_unxlate_table[128] = { ...@@ -141,6 +149,22 @@ static unsigned char atkbd_unxlate_table[128] = {
#define ATKBD_KEY_UNKNOWN 0 #define ATKBD_KEY_UNKNOWN 0
#define ATKBD_KEY_NULL 255 #define ATKBD_KEY_NULL 255
#define ATKBD_SCR_1 254
#define ATKBD_SCR_2 253
#define ATKBD_SCR_4 252
#define ATKBD_SCR_8 251
#define ATKBD_SCR_CLICK 250
#define ATKBD_SPECIAL 250
static unsigned char atkbd_scroll_keys[5][2] = {
{ ATKBD_SCR_1, 0x45 },
{ ATKBD_SCR_2, 0x29 },
{ ATKBD_SCR_4, 0x36 },
{ ATKBD_SCR_8, 0x27 },
{ ATKBD_SCR_CLICK, 0x60 },
};
/* /*
* The atkbd control structure * The atkbd control structure
*/ */
...@@ -155,6 +179,7 @@ struct atkbd { ...@@ -155,6 +179,7 @@ struct atkbd {
unsigned char cmdbuf[4]; unsigned char cmdbuf[4];
unsigned char cmdcnt; unsigned char cmdcnt;
unsigned char set; unsigned char set;
unsigned char extra;
unsigned char release; unsigned char release;
int lastkey; int lastkey;
volatile signed char ack; volatile signed char ack;
...@@ -189,6 +214,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -189,6 +214,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
{ {
struct atkbd *atkbd = serio->private; struct atkbd *atkbd = serio->private;
unsigned int code = data; unsigned int code = data;
int scroll = 0, click = -1;
int value; int value;
#ifdef ATKBD_DEBUG #ifdef ATKBD_DEBUG
...@@ -284,6 +310,21 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -284,6 +310,21 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
else else
printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n", code & 0x80 ? "e0" : "", code & 0x7f); printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n", code & 0x80 ? "e0" : "", code & 0x7f);
break; break;
case ATKBD_SCR_1:
scroll = 1 - atkbd->release * 2;
break;
case ATKBD_SCR_2:
scroll = 2 - atkbd->release * 4;
break;
case ATKBD_SCR_4:
scroll = 4 - atkbd->release * 8;
break;
case ATKBD_SCR_8:
scroll = 8 - atkbd->release * 16;
break;
case ATKBD_SCR_CLICK:
click = !atkbd->release;
break;
default: default:
value = atkbd->release ? 0 : value = atkbd->release ? 0 :
(1 + (!atkbd_softrepeat && test_bit(atkbd->keycode[code], atkbd->dev.key))); (1 + (!atkbd_softrepeat && test_bit(atkbd->keycode[code], atkbd->dev.key)));
...@@ -305,6 +346,13 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -305,6 +346,13 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
atkbd_report_key(&atkbd->dev, regs, atkbd->keycode[code], value); atkbd_report_key(&atkbd->dev, regs, atkbd->keycode[code], value);
} }
if (scroll || click != -1) {
input_regs(&atkbd->dev, regs);
input_report_key(&atkbd->dev, BTN_MIDDLE, click);
input_report_rel(&atkbd->dev, REL_WHEEL, scroll);
input_sync(&atkbd->dev);
}
atkbd->release = 0; atkbd->release = 0;
out: out:
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -420,7 +468,7 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co ...@@ -420,7 +468,7 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co
| (test_bit(LED_CAPSL, dev->led) ? 4 : 0); | (test_bit(LED_CAPSL, dev->led) ? 4 : 0);
atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS); atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS);
if (atkbd->set == 4) { if (atkbd->extra) {
param[0] = 0; param[0] = 0;
param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0) param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
| (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0) | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
...@@ -529,21 +577,22 @@ static int atkbd_set_3(struct atkbd *atkbd) ...@@ -529,21 +577,22 @@ static int atkbd_set_3(struct atkbd *atkbd)
return 3; return 3;
} }
if (atkbd_set != 2) if (atkbd_extra) {
if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) { param[0] = 0x71;
atkbd->id = param[0] << 8 | param[1]; if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE)) {
atkbd->extra = 1;
return 2; return 2;
} }
if (atkbd_set == 4) {
param[0] = 0x71;
if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
return 4;
} }
if (atkbd_set != 3) if (atkbd_set != 3)
return 2; return 2;
if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
atkbd->id = param[0] << 8 | param[1];
return 2;
}
param[0] = 3; param[0] = 3;
if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET)) if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
return 2; return 2;
...@@ -696,24 +745,32 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -696,24 +745,32 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
atkbd->id = 0xab00; atkbd->id = 0xab00;
} }
if (atkbd->set == 4) { if (atkbd->extra) {
atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC); atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC);
sprintf(atkbd->name, "AT Set 2 Extended keyboard"); sprintf(atkbd->name, "AT Set 2 Extra keyboard");
} else } else
sprintf(atkbd->name, "AT %s Set %d keyboard", sprintf(atkbd->name, "AT %s Set %d keyboard",
atkbd->translated ? "Translated" : "Raw", atkbd->set); atkbd->translated ? "Translated" : "Raw", atkbd->set);
sprintf(atkbd->phys, "%s/input0", serio->phys); sprintf(atkbd->phys, "%s/input0", serio->phys);
if (atkbd_scroll) {
for (i = 0; i < 5; i++)
atkbd_set2_keycode[atkbd_scroll_keys[i][1]] = atkbd_scroll_keys[i][0];
atkbd->dev.evbit[0] |= BIT(EV_REL);
atkbd->dev.relbit[0] = BIT(REL_WHEEL);
set_bit(BTN_MIDDLE, atkbd->dev.keybit);
}
if (atkbd->translated) { if (atkbd->translated) {
for (i = 0; i < 128; i++) { for (i = 0; i < 128; i++) {
atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]]; atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80]; atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
} }
} else if (atkbd->set == 2) { } else if (atkbd->set == 3) {
memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
} else {
memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode)); memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
} else {
memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
} }
atkbd->dev.name = atkbd->name; atkbd->dev.name = atkbd->name;
...@@ -724,7 +781,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -724,7 +781,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
atkbd->dev.id.version = atkbd->id; atkbd->dev.id.version = atkbd->id;
for (i = 0; i < 512; i++) for (i = 0; i < 512; i++)
if (atkbd->keycode[i] && atkbd->keycode[i] < 255) if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL)
set_bit(atkbd->keycode[i], atkbd->dev.keybit); set_bit(atkbd->keycode[i], atkbd->dev.keybit);
input_register_device(&atkbd->dev); input_register_device(&atkbd->dev);
...@@ -741,7 +798,7 @@ static int atkbd_reconnect(struct serio *serio) ...@@ -741,7 +798,7 @@ static int atkbd_reconnect(struct serio *serio)
{ {
struct atkbd *atkbd = serio->private; struct atkbd *atkbd = serio->private;
struct serio_dev *dev = serio->dev; struct serio_dev *dev = serio->dev;
int i; unsigned char param[1];
if (!dev) { if (!dev) {
printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
...@@ -749,38 +806,21 @@ static int atkbd_reconnect(struct serio *serio) ...@@ -749,38 +806,21 @@ static int atkbd_reconnect(struct serio *serio)
} }
if (atkbd->write) { if (atkbd->write) {
param[0] = (test_bit(LED_SCROLLL, atkbd->dev.led) ? 1 : 0)
| (test_bit(LED_NUML, atkbd->dev.led) ? 2 : 0)
| (test_bit(LED_CAPSL, atkbd->dev.led) ? 4 : 0);
if (atkbd_probe(atkbd)) if (atkbd_probe(atkbd))
return -1; return -1;
if (atkbd->set != atkbd_set_3(atkbd))
return -1;
atkbd->set = atkbd_set_3(atkbd);
atkbd_enable(atkbd); atkbd_enable(atkbd);
} else {
atkbd->set = 2;
atkbd->id = 0xab00;
}
/* if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
* Here we probably should check if the keyboard has the same set that return -1;
* it had before and bail out if it's different. But this will most likely
* cause new keyboard device be created... and for the user it will look
* like keyboard is lost
*/
if (atkbd->translated) {
for (i = 0; i < 128; i++) {
atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
}
} else if (atkbd->set == 2) {
memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
} else {
memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
} }
for (i = 0; i < 512; i++)
if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
set_bit(atkbd->keycode[i], atkbd->dev.keybit);
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -77,6 +77,7 @@ struct sunkbd { ...@@ -77,6 +77,7 @@ struct sunkbd {
struct input_dev dev; struct input_dev dev;
struct serio *serio; struct serio *serio;
struct work_struct tq; struct work_struct tq;
wait_queue_head_t wait;
char name[64]; char name[64];
char phys[32]; char phys[32];
char type; char type;
...@@ -96,11 +97,13 @@ static irqreturn_t sunkbd_interrupt(struct serio *serio, ...@@ -96,11 +97,13 @@ static irqreturn_t sunkbd_interrupt(struct serio *serio,
if (sunkbd->reset <= -1) { /* If cp[i] is 0xff, sunkbd->reset will stay -1. */ if (sunkbd->reset <= -1) { /* If cp[i] is 0xff, sunkbd->reset will stay -1. */
sunkbd->reset = data; /* The keyboard sends 0xff 0xff 0xID on powerup */ sunkbd->reset = data; /* The keyboard sends 0xff 0xff 0xID on powerup */
wake_up_interruptible(&sunkbd->wait);
goto out; goto out;
} }
if (sunkbd->layout == -1) { if (sunkbd->layout == -1) {
sunkbd->layout = data; sunkbd->layout = data;
wake_up_interruptible(&sunkbd->wait);
goto out; goto out;
} }
...@@ -176,22 +179,19 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c ...@@ -176,22 +179,19 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
static int sunkbd_initialize(struct sunkbd *sunkbd) static int sunkbd_initialize(struct sunkbd *sunkbd)
{ {
int t;
t = 1000;
sunkbd->reset = -2; sunkbd->reset = -2;
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_RESET); sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_RESET);
while (sunkbd->reset < 0 && --t) mdelay(1); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
if (!t) return -1; if (sunkbd->reset <0)
return -1;
sunkbd->type = sunkbd->reset; sunkbd->type = sunkbd->reset;
if (sunkbd->type == 4) { /* Type 4 keyboard */ if (sunkbd->type == 4) { /* Type 4 keyboard */
t = 250;
sunkbd->layout = -2; sunkbd->layout = -2;
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_LAYOUT); sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_LAYOUT);
while (sunkbd->layout < 0 && --t) mdelay(1); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->layout >= 0, HZ/4);
if (!t) return -1; if (sunkbd->layout < 0) return -1;
if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK) sunkbd->type = 5; if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK) sunkbd->type = 5;
} }
...@@ -206,9 +206,8 @@ static int sunkbd_initialize(struct sunkbd *sunkbd) ...@@ -206,9 +206,8 @@ static int sunkbd_initialize(struct sunkbd *sunkbd)
static void sunkbd_reinit(void *data) static void sunkbd_reinit(void *data)
{ {
struct sunkbd *sunkbd = data; struct sunkbd *sunkbd = data;
int t = 1000;
while (sunkbd->reset < 0 && --t) mdelay(1); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED); sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED);
sunkbd->serio->write(sunkbd->serio, sunkbd->serio->write(sunkbd->serio,
...@@ -239,6 +238,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -239,6 +238,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
memset(sunkbd, 0, sizeof(struct sunkbd)); memset(sunkbd, 0, sizeof(struct sunkbd));
init_input_dev(&sunkbd->dev); init_input_dev(&sunkbd->dev);
init_waitqueue_head(&sunkbd->wait);
sunkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP); sunkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
sunkbd->dev.ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML); sunkbd->dev.ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML);
...@@ -275,7 +275,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -275,7 +275,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
set_bit(sunkbd->keycode[i], sunkbd->dev.keybit); set_bit(sunkbd->keycode[i], sunkbd->dev.keybit);
clear_bit(0, sunkbd->dev.keybit); clear_bit(0, sunkbd->dev.keybit);
sprintf(sunkbd->name, "%s/input", serio->phys); sprintf(sunkbd->phys, "%s/input0", serio->phys);
sunkbd->dev.name = sunkbd->name; sunkbd->dev.name = sunkbd->name;
sunkbd->dev.phys = sunkbd->phys; sunkbd->dev.phys = sunkbd->phys;
......
...@@ -54,12 +54,3 @@ config INPUT_UINPUT ...@@ -54,12 +54,3 @@ config INPUT_UINPUT
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called uinput. module will be called uinput.
config INPUT_GSC
tristate "PA-RISC GSC PS/2 keyboard/mouse support"
depends on GSC && INPUT && INPUT_MISC
help
Say Y here if you have a PS/2 keyboard and/or mouse attached
to your PA-RISC box. HP run the keyboard in AT mode rather than
XT mode like everyone else, so we need our own driver.
Furthermore, the GSC PS/2 controller shares IRQ between mouse and
keyboard.
...@@ -9,4 +9,3 @@ obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o ...@@ -9,4 +9,3 @@ obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o obj-$(CONFIG_INPUT_UINPUT) += uinput.o
obj-$(CONFIG_INPUT_GSC) += gsc_ps2.o
This diff is collapsed.
...@@ -74,6 +74,8 @@ static int pc98bm_irq = PC98BM_IRQ; ...@@ -74,6 +74,8 @@ static int pc98bm_irq = PC98BM_IRQ;
module_param_named(irq, pc98bm_irq, uint, 0); module_param_named(irq, pc98bm_irq, uint, 0);
MODULE_PARM_DESC(irq, "IRQ number (13=default)"); MODULE_PARM_DESC(irq, "IRQ number (13=default)");
__obsolete_setup("pc98bm_irq=");
static int pc98bm_used = 0; static int pc98bm_used = 0;
static irqreturn_t pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
......
...@@ -17,6 +17,7 @@ config MOUSE_PS2 ...@@ -17,6 +17,7 @@ config MOUSE_PS2
depends on INPUT && INPUT_MOUSE depends on INPUT && INPUT_MOUSE
select SERIO select SERIO
select SERIO_I8042 if PC select SERIO_I8042 if PC
select SERIO_GSCPS2 if GSC
---help--- ---help---
Say Y here if you have a PS/2 mouse connected to your system. This Say Y here if you have a PS/2 mouse connected to your system. This
includes the standard 2 or 3-button PS/2 mouse, as well as PS/2 includes the standard 2 or 3-button PS/2 mouse, as well as PS/2
...@@ -117,6 +118,19 @@ config MOUSE_RISCPC ...@@ -117,6 +118,19 @@ config MOUSE_RISCPC
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called rpcmouse. module will be called rpcmouse.
config MOUSE_VSXXXAA
tristate "DEC VSXXX-AA/GA mouse and tablet"
depends on INPUT && INPUT_MOUSE
select SERIO
help
Say Y (or M) if you want to use a DEC VSXXX-AA (hockey
puck) or a VSXXX-GA (rectangular) mouse. Theses mice are
typically used on DECstations or VAXstations, but can also
be used on any box capable of RS232 (with some adaptor
described in the source file). This driver should, in theory,
also work with the digitizer DEC produced, but it isn't tested
with that (I don't have the hardware yet).
config MOUSE_PC9800 config MOUSE_PC9800
tristate "NEC PC-9800 busmouse" tristate "NEC PC-9800 busmouse"
depends on X86_PC9800 && INPUT && INPUT_MOUSE && ISA depends on X86_PC9800 && INPUT && INPUT_MOUSE && ISA
......
...@@ -13,5 +13,6 @@ obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o ...@@ -13,5 +13,6 @@ obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o
obj-$(CONFIG_MOUSE_PC9800) += 98busmouse.o obj-$(CONFIG_MOUSE_PC9800) += 98busmouse.o
obj-$(CONFIG_MOUSE_PS2) += psmouse.o obj-$(CONFIG_MOUSE_PS2) += psmouse.o
obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
psmouse-objs := psmouse-base.o logips2pp.o synaptics.o psmouse-objs := psmouse-base.o logips2pp.o synaptics.o
...@@ -85,6 +85,8 @@ static int inport_irq = INPORT_IRQ; ...@@ -85,6 +85,8 @@ static int inport_irq = INPORT_IRQ;
module_param_named(irq, inport_irq, uint, 0); module_param_named(irq, inport_irq, uint, 0);
MODULE_PARM_DESC(irq, "IRQ number (5=default)"); MODULE_PARM_DESC(irq, "IRQ number (5=default)");
__obsolete_setup("inport_irq=");
static int inport_used; static int inport_used;
static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
......
...@@ -75,6 +75,8 @@ static int logibm_irq = LOGIBM_IRQ; ...@@ -75,6 +75,8 @@ static int logibm_irq = LOGIBM_IRQ;
module_param_named(irq, logibm_irq, uint, 0); module_param_named(irq, logibm_irq, uint, 0);
MODULE_PARM_DESC(irq, "IRQ number (5=default)"); MODULE_PARM_DESC(irq, "IRQ number (5=default)");
__obsolete_setup("logibm_irq=");
static int logibm_used = 0; static int logibm_used = 0;
static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
......
...@@ -47,6 +47,12 @@ unsigned int psmouse_resetafter; ...@@ -47,6 +47,12 @@ unsigned int psmouse_resetafter;
module_param_named(resetafter, psmouse_resetafter, uint, 0); module_param_named(resetafter, psmouse_resetafter, uint, 0);
MODULE_PARM_DESC(resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never)."); MODULE_PARM_DESC(resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
__obsolete_setup("psmouse_noext");
__obsolete_setup("psmouse_resolution=");
__obsolete_setup("psmouse_smartscroll=");
__obsolete_setup("psmouse_resetafter=");
__obsolete_setup("psmouse_rate=");
static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"}; static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"};
/* /*
...@@ -281,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command) ...@@ -281,6 +287,24 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
return 0; return 0;
} }
/*
* psmouse_reset() resets the mouse into power-on state.
*/
int psmouse_reset(struct psmouse *psmouse)
{
unsigned char param[2];
if (psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT))
return -1;
if (param[0] != PSMOUSE_RET_BAT && param[1] != PSMOUSE_RET_ID)
return -1;
return 0;
}
/* /*
* Genius NetMouse magic init. * Genius NetMouse magic init.
*/ */
...@@ -365,6 +389,10 @@ static int psmouse_extensions(struct psmouse *psmouse) ...@@ -365,6 +389,10 @@ static int psmouse_extensions(struct psmouse *psmouse)
*/ */
psmouse_max_proto = PSMOUSE_IMEX; psmouse_max_proto = PSMOUSE_IMEX;
} }
/*
* Make sure that touchpad is in relative mode, gestures (taps) are enabled
*/
synaptics_reset(psmouse);
} }
if (psmouse_max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) { if (psmouse_max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) {
...@@ -410,6 +438,7 @@ static int psmouse_extensions(struct psmouse *psmouse) ...@@ -410,6 +438,7 @@ static int psmouse_extensions(struct psmouse *psmouse)
* pass through port it could get disabled while probing for protocol * pass through port it could get disabled while probing for protocol
* extensions. * extensions.
*/ */
psmouse_reset(psmouse);
psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS); psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS);
} }
...@@ -442,7 +471,7 @@ static int psmouse_probe(struct psmouse *psmouse) ...@@ -442,7 +471,7 @@ static int psmouse_probe(struct psmouse *psmouse)
*/ */
if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS)) if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS))
return -1; printk(KERN_WARNING "psmouse.c: Failed to reset mouse on %s\n", psmouse->serio->phys);
/* /*
* And here we try to determine if it has any extensions over the * And here we try to determine if it has any extensions over the
...@@ -534,8 +563,8 @@ static void psmouse_activate(struct psmouse *psmouse) ...@@ -534,8 +563,8 @@ static void psmouse_activate(struct psmouse *psmouse)
static void psmouse_cleanup(struct serio *serio) static void psmouse_cleanup(struct serio *serio)
{ {
struct psmouse *psmouse = serio->private; struct psmouse *psmouse = serio->private;
unsigned char param[2];
psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT); psmouse_reset(psmouse);
} }
/* /*
...@@ -546,7 +575,7 @@ static void psmouse_disconnect(struct serio *serio) ...@@ -546,7 +575,7 @@ static void psmouse_disconnect(struct serio *serio)
{ {
struct psmouse *psmouse = serio->private; struct psmouse *psmouse = serio->private;
psmouse->state = PSMOUSE_IGNORE; psmouse->state = PSMOUSE_CMD_MODE;
if (psmouse->ptport) { if (psmouse->ptport) {
if (psmouse->ptport->deactivate) if (psmouse->ptport->deactivate)
...@@ -559,6 +588,8 @@ static void psmouse_disconnect(struct serio *serio) ...@@ -559,6 +588,8 @@ static void psmouse_disconnect(struct serio *serio)
if (psmouse->disconnect) if (psmouse->disconnect)
psmouse->disconnect(psmouse); psmouse->disconnect(psmouse);
psmouse->state = PSMOUSE_IGNORE;
input_unregister_device(&psmouse->dev); input_unregister_device(&psmouse->dev);
serio_close(serio); serio_close(serio);
kfree(psmouse); kfree(psmouse);
...@@ -586,7 +617,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev) ...@@ -586,7 +617,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y); psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
psmouse->state = PSMOUSE_NEW_DEVICE; psmouse->state = PSMOUSE_CMD_MODE;
psmouse->serio = serio; psmouse->serio = serio;
psmouse->dev.private = psmouse; psmouse->dev.private = psmouse;
...@@ -637,14 +668,16 @@ static int psmouse_reconnect(struct serio *serio) ...@@ -637,14 +668,16 @@ static int psmouse_reconnect(struct serio *serio)
{ {
struct psmouse *psmouse = serio->private; struct psmouse *psmouse = serio->private;
struct serio_dev *dev = serio->dev; struct serio_dev *dev = serio->dev;
int old_type = psmouse->type; int old_type;
if (!dev) { if (!dev || !psmouse) {
printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n"); printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n");
return -1; return -1;
} }
psmouse->state = PSMOUSE_NEW_DEVICE; old_type = psmouse->type;
psmouse->state = PSMOUSE_CMD_MODE;
psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0; psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0;
if (psmouse->reconnect) { if (psmouse->reconnect) {
if (psmouse->reconnect(psmouse)) if (psmouse->reconnect(psmouse))
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define PSMOUSE_RET_NAK 0xfe #define PSMOUSE_RET_NAK 0xfe
/* psmouse states */ /* psmouse states */
#define PSMOUSE_NEW_DEVICE 0 #define PSMOUSE_CMD_MODE 0
#define PSMOUSE_ACTIVATED 1 #define PSMOUSE_ACTIVATED 1
#define PSMOUSE_IGNORE 2 #define PSMOUSE_IGNORE 2
...@@ -65,6 +65,7 @@ struct psmouse { ...@@ -65,6 +65,7 @@ struct psmouse {
#define PSMOUSE_SYNAPTICS 7 #define PSMOUSE_SYNAPTICS 7
int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command); int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
int psmouse_reset(struct psmouse *psmouse);
extern int psmouse_smartscroll; extern int psmouse_smartscroll;
extern unsigned int psmouse_rate; extern unsigned int psmouse_rate;
......
...@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode) ...@@ -92,17 +92,6 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
return 0; return 0;
} }
static int synaptics_reset(struct psmouse *psmouse)
{
unsigned char r[2];
if (psmouse_command(psmouse, r, PSMOUSE_CMD_RESET_BAT))
return -1;
if (r[0] == PSMOUSE_RET_BAT && r[1] == PSMOUSE_RET_ID)
return 0;
return -1;
}
/* /*
* Read the model-id bytes from the touchpad * Read the model-id bytes from the touchpad
* see also SYN_MODEL_* macros * see also SYN_MODEL_* macros
...@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse) ...@@ -197,7 +186,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
{ {
int retries = 0; int retries = 0;
while ((retries++ < 3) && synaptics_reset(psmouse)) while ((retries++ < 3) && psmouse_reset(psmouse))
printk(KERN_ERR "synaptics reset failed\n"); printk(KERN_ERR "synaptics reset failed\n");
if (synaptics_identify(psmouse)) if (synaptics_identify(psmouse))
...@@ -368,9 +357,15 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) ...@@ -368,9 +357,15 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
clear_bit(REL_Y, dev->relbit); clear_bit(REL_Y, dev->relbit);
} }
static void synaptics_disconnect(struct psmouse *psmouse) void synaptics_reset(struct psmouse *psmouse)
{ {
/* reset touchpad back to relative mode, gestures enabled */
synaptics_mode_cmd(psmouse, 0); synaptics_mode_cmd(psmouse, 0);
}
static void synaptics_disconnect(struct psmouse *psmouse)
{
synaptics_reset(psmouse);
kfree(psmouse->private); kfree(psmouse->private);
} }
...@@ -435,6 +430,8 @@ int synaptics_init(struct psmouse *psmouse) ...@@ -435,6 +430,8 @@ int synaptics_init(struct psmouse *psmouse)
goto init_fail; goto init_fail;
} }
priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
if (SYN_CAP_EXTENDED(priv->capabilities) && SYN_CAP_PASS_THROUGH(priv->capabilities)) if (SYN_CAP_EXTENDED(priv->capabilities) && SYN_CAP_PASS_THROUGH(priv->capabilities))
synaptics_pt_create(psmouse); synaptics_pt_create(psmouse);
...@@ -602,19 +599,42 @@ static void synaptics_process_packet(struct psmouse *psmouse) ...@@ -602,19 +599,42 @@ static void synaptics_process_packet(struct psmouse *psmouse)
input_sync(dev); input_sync(dev);
} }
static int synaptics_validate_byte(struct psmouse *psmouse) static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned char pkt_type)
{ {
static unsigned char newabs_mask[] = { 0xC0, 0x00, 0x00, 0xC0, 0x00 }; static unsigned char newabs_mask[] = { 0xC8, 0x00, 0x00, 0xC8, 0x00 };
static unsigned char newabs_rel_mask[] = { 0xC0, 0x00, 0x00, 0xC0, 0x00 };
static unsigned char newabs_rslt[] = { 0x80, 0x00, 0x00, 0xC0, 0x00 }; static unsigned char newabs_rslt[] = { 0x80, 0x00, 0x00, 0xC0, 0x00 };
static unsigned char oldabs_mask[] = { 0xC0, 0x60, 0x00, 0xC0, 0x60 }; static unsigned char oldabs_mask[] = { 0xC0, 0x60, 0x00, 0xC0, 0x60 };
static unsigned char oldabs_rslt[] = { 0xC0, 0x00, 0x00, 0x80, 0x00 }; static unsigned char oldabs_rslt[] = { 0xC0, 0x00, 0x00, 0x80, 0x00 };
struct synaptics_data *priv = psmouse->private;
int idx = psmouse->pktcnt - 1;
if (SYN_MODEL_NEWABS(priv->model_id)) switch (pkt_type) {
return (psmouse->packet[idx] & newabs_mask[idx]) == newabs_rslt[idx]; case SYN_NEWABS:
else case SYN_NEWABS_RELAXED:
return (psmouse->packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx]; return (packet[idx] & newabs_rel_mask[idx]) == newabs_rslt[idx];
case SYN_NEWABS_STRICT:
return (packet[idx] & newabs_mask[idx]) == newabs_rslt[idx];
case SYN_OLDABS:
return (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx];
default:
printk(KERN_ERR "synaptics: unknown packet type %d\n", pkt_type);
return 0;
}
}
static unsigned char synaptics_detect_pkt_type(struct psmouse *psmouse)
{
int i;
for (i = 0; i < 5; i++)
if (!synaptics_validate_byte(psmouse->packet, i, SYN_NEWABS_STRICT)) {
printk(KERN_INFO "synaptics: using relaxed packet validation\n");
return SYN_NEWABS_RELAXED;
}
return SYN_NEWABS_STRICT;
} }
void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
...@@ -630,13 +650,17 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) ...@@ -630,13 +650,17 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
printk(KERN_NOTICE "Synaptics driver resynced.\n"); printk(KERN_NOTICE "Synaptics driver resynced.\n");
} }
if (unlikely(priv->pkt_type == SYN_NEWABS))
priv->pkt_type = synaptics_detect_pkt_type(psmouse);
if (psmouse->ptport && psmouse->ptport->serio.dev && synaptics_is_pt_packet(psmouse->packet)) if (psmouse->ptport && psmouse->ptport->serio.dev && synaptics_is_pt_packet(psmouse->packet))
synaptics_pass_pt_packet(&psmouse->ptport->serio, psmouse->packet); synaptics_pass_pt_packet(&psmouse->ptport->serio, psmouse->packet);
else else
synaptics_process_packet(psmouse); synaptics_process_packet(psmouse);
psmouse->pktcnt = 0; psmouse->pktcnt = 0;
} else if (psmouse->pktcnt && !synaptics_validate_byte(psmouse)) { } else if (psmouse->pktcnt &&
!synaptics_validate_byte(psmouse->packet, psmouse->pktcnt - 1, priv->pkt_type)) {
printk(KERN_WARNING "Synaptics driver lost sync at byte %d\n", psmouse->pktcnt); printk(KERN_WARNING "Synaptics driver lost sync at byte %d\n", psmouse->pktcnt);
psmouse->pktcnt = 0; psmouse->pktcnt = 0;
if (++priv->out_of_sync == psmouse_resetafter) { if (++priv->out_of_sync == psmouse_resetafter) {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
extern void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs); extern void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs);
extern int synaptics_detect(struct psmouse *psmouse); extern int synaptics_detect(struct psmouse *psmouse);
extern int synaptics_init(struct psmouse *psmouse); extern int synaptics_init(struct psmouse *psmouse);
extern void synaptics_reset(struct psmouse *psmouse);
/* synaptics queries */ /* synaptics queries */
#define SYN_QUE_IDENTIFY 0x00 #define SYN_QUE_IDENTIFY 0x00
...@@ -70,6 +71,12 @@ extern int synaptics_init(struct psmouse *psmouse); ...@@ -70,6 +71,12 @@ extern int synaptics_init(struct psmouse *psmouse);
#define SYN_PS_SET_MODE2 0x14 #define SYN_PS_SET_MODE2 0x14
#define SYN_PS_CLIENT_CMD 0x28 #define SYN_PS_CLIENT_CMD 0x28
/* synaptics packet types */
#define SYN_NEWABS 0
#define SYN_NEWABS_STRICT 1
#define SYN_NEWABS_RELAXED 2
#define SYN_OLDABS 3
/* /*
* A structure to describe the state of the touchpad hardware (buttons and pad) * A structure to describe the state of the touchpad hardware (buttons and pad)
*/ */
...@@ -103,6 +110,7 @@ struct synaptics_data { ...@@ -103,6 +110,7 @@ struct synaptics_data {
/* Data for normal processing */ /* Data for normal processing */
unsigned int out_of_sync; /* # of packets out of sync */ unsigned int out_of_sync; /* # of packets out of sync */
int old_w; /* Previous w value */ int old_w; /* Previous w value */
unsigned char pkt_type; /* packet type - old, new, etc */
}; };
#endif /* _SYNAPTICS_H */ #endif /* _SYNAPTICS_H */
This diff is collapsed.
...@@ -20,6 +20,7 @@ config SERIO_I8042 ...@@ -20,6 +20,7 @@ config SERIO_I8042
tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
default y default y
select SERIO select SERIO
depends on !PARISC
---help--- ---help---
i8042 is the chip over which the standard AT keyboard and PS/2 i8042 is the chip over which the standard AT keyboard and PS/2
mouse are connected to the computer. If you use these devices, mouse are connected to the computer. If you use these devices,
...@@ -48,6 +49,7 @@ config SERIO_SERPORT ...@@ -48,6 +49,7 @@ config SERIO_SERPORT
config SERIO_CT82C710 config SERIO_CT82C710
tristate "ct82c710 Aux port controller" tristate "ct82c710 Aux port controller"
depends on SERIO depends on SERIO
depends on !PARISC
---help--- ---help---
Say Y here if you have a Texas Instruments TravelMate notebook Say Y here if you have a Texas Instruments TravelMate notebook
equipped with the ct82c710 chip and want to use a mouse connected equipped with the ct82c710 chip and want to use a mouse connected
...@@ -105,6 +107,20 @@ config SERIO_98KBD ...@@ -105,6 +107,20 @@ config SERIO_98KBD
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called 98kbd-io. module will be called 98kbd-io.
config SERIO_GSCPS2
tristate "HP GSC PS/2 keyboard and PS/2 mouse controller"
depends on GSC && SERIO
default y
help
This driver provides support for the PS/2 ports on PA-RISC machines
over which HP PS/2 keyboards and PS/2 mice may be connected.
If you use these devices, you'll need to say Y here.
It's safe to enable this driver, so if unsure, say Y.
To compile this driver as a module, choose M here: the
module will be called gscps2.
config SERIO_PCIPS2 config SERIO_PCIPS2
tristate "PCI PS/2 keyboard and PS/2 mouse controller" tristate "PCI PS/2 keyboard and PS/2 mouse controller"
depends on PCI && SERIO depends on PCI && SERIO
......
...@@ -14,4 +14,5 @@ obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o ...@@ -14,4 +14,5 @@ obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o
obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o
obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o
obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o
obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o
obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o
This diff is collapsed.
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#elif defined(__ia64__) #elif defined(__ia64__)
# define I8042_KBD_IRQ isa_irq_to_vector(1) # define I8042_KBD_IRQ isa_irq_to_vector(1)
# define I8042_AUX_IRQ isa_irq_to_vector(12) # define I8042_AUX_IRQ isa_irq_to_vector(12)
#elif defined(__arm__)
/* defined in include/asm-arm/arch-xxx/irqs.h */
#include <asm/irq.h>
#else #else
# define I8042_KBD_IRQ 1 # define I8042_KBD_IRQ 1
# define I8042_AUX_IRQ 12 # define I8042_AUX_IRQ 12
......
...@@ -52,6 +52,13 @@ static unsigned int i8042_dumbkbd; ...@@ -52,6 +52,13 @@ static unsigned int i8042_dumbkbd;
module_param_named(dumbkbd, i8042_dumbkbd, bool, 0); module_param_named(dumbkbd, i8042_dumbkbd, bool, 0);
MODULE_PARM_DESC(dumbkbd, "Pretend that controller can only read data from keyboard"); MODULE_PARM_DESC(dumbkbd, "Pretend that controller can only read data from keyboard");
__obsolete_setup("i8042_noaux");
__obsolete_setup("i8042_nomux");
__obsolete_setup("i8042_unlock");
__obsolete_setup("i8042_reset");
__obsolete_setup("i8042_direct");
__obsolete_setup("i8042_dumbkbd");
#undef DEBUG #undef DEBUG
#include "i8042.h" #include "i8042.h"
...@@ -379,6 +386,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -379,6 +386,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned int dfl; unsigned int dfl;
int ret; int ret;
mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
spin_lock_irqsave(&i8042_lock, flags); spin_lock_irqsave(&i8042_lock, flags);
str = i8042_read_status(); str = i8042_read_status();
if (str & I8042_STR_OBF) if (str & I8042_STR_OBF)
...@@ -433,7 +442,6 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -433,7 +442,6 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
irq_ret: irq_ret:
ret = 1; ret = 1;
out: out:
mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
return IRQ_RETVAL(ret); return IRQ_RETVAL(ret);
} }
...@@ -523,6 +531,11 @@ static int __init i8042_check_mux(struct i8042_values *values) ...@@ -523,6 +531,11 @@ static int __init i8042_check_mux(struct i8042_values *values)
if (i8042_enable_mux_mode(values, &mux_version)) if (i8042_enable_mux_mode(values, &mux_version))
return -1; return -1;
/* Workaround for broken chips which seem to support MUX, but in reality don't. */
/* They all report version 12.10 */
if (mux_version == 0xCA)
return -1;
printk(KERN_INFO "i8042.c: Detected active multiplexing controller, rev %d.%d.\n", printk(KERN_INFO "i8042.c: Detected active multiplexing controller, rev %d.%d.\n",
(mux_version >> 4) & 0xf, mux_version & 0xf); (mux_version >> 4) & 0xf, mux_version & 0xf);
...@@ -708,14 +721,6 @@ static int i8042_controller_init(void) ...@@ -708,14 +721,6 @@ static int i8042_controller_init(void)
printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n");
} }
/*
* If the chip is configured into nontranslated mode by the BIOS, don't
* bother enabling translating and be happy.
*/
if (~i8042_ctr & I8042_CTR_XLATE)
i8042_direct = 1;
/* /*
* Set nontranslated mode for the kbd interface if requested by an option. * Set nontranslated mode for the kbd interface if requested by an option.
* After this the kbd interface becomes a simple serial in/out, like the aux * After this the kbd interface becomes a simple serial in/out, like the aux
......
...@@ -195,6 +195,9 @@ irqreturn_t serio_interrupt(struct serio *serio, ...@@ -195,6 +195,9 @@ irqreturn_t serio_interrupt(struct serio *serio,
ret = serio->dev->interrupt(serio, data, flags, regs); ret = serio->dev->interrupt(serio, data, flags, regs);
} else { } else {
if (!flags) { if (!flags) {
if ((serio->type == SERIO_8042 ||
serio->type == SERIO_8042_XL) && (data != 0xaa))
return ret;
serio_rescan(serio); serio_rescan(serio);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
} }
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <linux/input.h> #include <linux/input.h>
#define DEBUG #undef DEBUG
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include "hid.h"
......
...@@ -377,7 +377,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -377,7 +377,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
set_bit(usage->type, input->evbit); set_bit(usage->type, input->evbit);
if ((usage->type == EV_REL) if ((usage->type == EV_REL)
&& (device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK) && (device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_BACK
| HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA))
&& (usage->code == REL_WHEEL)) { && (usage->code == REL_WHEEL)) {
set_bit(REL_HWHEEL, bit); set_bit(REL_HWHEEL, bit);
} }
...@@ -431,21 +432,22 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct ...@@ -431,21 +432,22 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
input_regs(input, regs); input_regs(input, regs);
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK) if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA) && (usage->code == BTN_EXTRA))
&& (usage->code == BTN_BACK)) { || ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_BACK) && (usage->code == BTN_BACK))) {
if (value) if (value)
hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
else else
hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON; hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON;
return; return;
} }
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON)
&& (usage->code == REL_WHEEL)) { && (usage->code == REL_WHEEL)) {
input_event(input, usage->type, REL_HWHEEL, value); input_event(input, usage->type, REL_HWHEEL, value);
return; return;
} }
if (usage->hat_min != usage->hat_max) { if (usage->hat_min != usage->hat_max ) { /* FIXME: hat_max can be 0 and hat_min 1 */
value = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1; value = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1;
if (value < 0 || value > 8) value = 0; if (value < 0 || value > 8) value = 0;
input_event(input, usage->type, usage->code , hid_hat_to_axis[value].x); input_event(input, usage->type, usage->code , hid_hat_to_axis[value].x);
...@@ -484,7 +486,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct ...@@ -484,7 +486,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
return; return;
} }
if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UKNOWN */ if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */
return; return;
input_event(input, usage->type, usage->code, value); input_event(input, usage->type, usage->code, value);
...@@ -567,8 +569,10 @@ int hidinput_connect(struct hid_device *hid) ...@@ -567,8 +569,10 @@ int hidinput_connect(struct hid_device *hid)
while (list != &report_enum->report_list) { while (list != &report_enum->report_list) {
report = (struct hid_report *) list; report = (struct hid_report *) list;
if (!report->maxfield) if (!report->maxfield) {
list = list->next;
continue; continue;
}
if (!hidinput) { if (!hidinput) {
hidinput = kmalloc(sizeof(*hidinput), GFP_KERNEL); hidinput = kmalloc(sizeof(*hidinput), GFP_KERNEL);
......
...@@ -208,8 +208,9 @@ struct hid_item { ...@@ -208,8 +208,9 @@ struct hid_item {
#define HID_QUIRK_HIDDEV 0x010 #define HID_QUIRK_HIDDEV 0x010
#define HID_QUIRK_BADPAD 0x020 #define HID_QUIRK_BADPAD 0x020
#define HID_QUIRK_MULTI_INPUT 0x040 #define HID_QUIRK_MULTI_INPUT 0x040
#define HID_QUIRK_2WHEEL_MOUSE_HACK 0x080 #define HID_QUIRK_2WHEEL_MOUSE_HACK_BACK 0x080
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x100 #define HID_QUIRK_2WHEEL_MOUSE_HACK_EXTRA 0x100
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200
/* /*
* This is the global environment of the parser. This information is * This is the global environment of the parser. This information is
...@@ -309,7 +310,7 @@ struct hid_report_enum { ...@@ -309,7 +310,7 @@ struct hid_report_enum {
#define HID_REPORT_TYPES 3 #define HID_REPORT_TYPES 3
#define HID_BUFFER_SIZE 32 #define HID_BUFFER_SIZE 64 /* use 64 for compatibility with all possible packetlen */
#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
#define HID_OUTPUT_FIFO_SIZE 64 #define HID_OUTPUT_FIFO_SIZE 64
......
...@@ -403,7 +403,8 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -403,7 +403,8 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
struct hiddev_collection_info cinfo; struct hiddev_collection_info cinfo;
struct hiddev_report_info rinfo; struct hiddev_report_info rinfo;
struct hiddev_field_info finfo; struct hiddev_field_info finfo;
struct hiddev_usage_ref uref; struct hiddev_usage_ref_multi uref_multi;
struct hiddev_usage_ref *uref = &uref_multi.uref;
struct hiddev_devinfo dinfo; struct hiddev_devinfo dinfo;
struct hid_report *report; struct hid_report *report;
struct hid_field *field; struct hid_field *field;
...@@ -575,68 +576,98 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -575,68 +576,98 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
return 0; return 0;
case HIDIOCGUCODE: case HIDIOCGUCODE:
if (copy_from_user(&uref, (void *) arg, sizeof(uref))) if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
return -EFAULT; return -EFAULT;
rinfo.report_type = uref.report_type; rinfo.report_type = uref->report_type;
rinfo.report_id = uref.report_id; rinfo.report_id = uref->report_id;
if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL) if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL)
return -EINVAL; return -EINVAL;
if (uref.field_index >= report->maxfield) if (uref->field_index >= report->maxfield)
return -EINVAL; return -EINVAL;
field = report->field[uref.field_index]; field = report->field[uref->field_index];
if (uref.usage_index >= field->maxusage) if (uref->usage_index >= field->maxusage)
return -EINVAL; return -EINVAL;
uref.usage_code = field->usage[uref.usage_index].hid; uref->usage_code = field->usage[uref->usage_index].hid;
if (copy_to_user((void *) arg, &uref, sizeof(uref))) if (copy_to_user((void *) arg, uref, sizeof(*uref)))
return -EFAULT; return -EFAULT;
return 0; return 0;
case HIDIOCGUSAGE: case HIDIOCGUSAGE:
case HIDIOCSUSAGE: case HIDIOCSUSAGE:
case HIDIOCGUSAGES:
case HIDIOCSUSAGES:
case HIDIOCGCOLLECTIONINDEX: case HIDIOCGCOLLECTIONINDEX:
if (copy_from_user(&uref, (void *) arg, sizeof(uref))) if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
if (copy_from_user(&uref_multi, (void *) arg,
sizeof(uref_multi)))
return -EFAULT;
} else {
if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
return -EFAULT; return -EFAULT;
}
if (cmd != HIDIOCGUSAGE && uref.report_type == HID_REPORT_TYPE_INPUT) if (cmd != HIDIOCGUSAGE &&
cmd != HIDIOCGUSAGES &&
uref->report_type == HID_REPORT_TYPE_INPUT)
return -EINVAL; return -EINVAL;
if (uref.report_id == HID_REPORT_ID_UNKNOWN) { if (uref->report_id == HID_REPORT_ID_UNKNOWN) {
field = hiddev_lookup_usage(hid, &uref); field = hiddev_lookup_usage(hid, uref);
if (field == NULL) if (field == NULL)
return -EINVAL; return -EINVAL;
} else { } else {
rinfo.report_type = uref.report_type; rinfo.report_type = uref->report_type;
rinfo.report_id = uref.report_id; rinfo.report_id = uref->report_id;
if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL) if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL)
return -EINVAL; return -EINVAL;
if (uref.field_index >= report->maxfield) if (uref->field_index >= report->maxfield)
return -EINVAL;
field = report->field[uref->field_index];
if (uref->usage_index >= field->maxusage)
return -EINVAL; return -EINVAL;
field = report->field[uref.field_index]; if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
if (uref.usage_index >= field->maxusage) if (uref_multi.num_values >= HID_MAX_USAGES ||
uref->usage_index >= field->maxusage ||
(uref->usage_index + uref_multi.num_values) >= field->maxusage)
return -EINVAL; return -EINVAL;
} }
}
switch (cmd) { switch (cmd) {
case HIDIOCGUSAGE: case HIDIOCGUSAGE:
uref.value = field->value[uref.usage_index]; uref->value = field->value[uref->usage_index];
if (copy_to_user((void *) arg, &uref, sizeof(uref))) if (copy_to_user((void *) arg, uref, sizeof(*uref)))
return -EFAULT; return -EFAULT;
return 0; return 0;
case HIDIOCSUSAGE: case HIDIOCSUSAGE:
field->value[uref.usage_index] = uref.value; field->value[uref->usage_index] = uref->value;
return 0; return 0;
case HIDIOCGCOLLECTIONINDEX: case HIDIOCGCOLLECTIONINDEX:
return field->usage[uref.usage_index].collection_index; return field->usage[uref->usage_index].collection_index;
case HIDIOCGUSAGES:
for (i = 0; i < uref_multi.num_values; i++)
uref_multi.values[i] =
field->value[uref->usage_index + i];
if (copy_to_user((void *) arg, &uref_multi,
sizeof(uref_multi)))
return -EFAULT;
return 0;
case HIDIOCSUSAGES:
for (i = 0; i < uref_multi.num_values; i++)
field->value[uref->usage_index + i] =
uref_multi.values[i];
return 0;
} }
return 0; return 0;
......
This diff is collapsed.
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
#undef RTC_IRQ #undef RTC_IRQ
#define RTC_IRQ IRQ_ISA_RTC_ALARM #define RTC_IRQ IRQ_ISA_RTC_ALARM
#undef AUX_IRQ #define I8042_KBD_IRQ IRQ_ISA_KEYBOARD
#define AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE) #define I8042_AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY #define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY
#define irq_canonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i) #define irq_canonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
#define IRQ_ISA_KEYBOARD 1 #define IRQ_ISA_KEYBOARD 1
#define RTC_IRQ 8 #define RTC_IRQ 8
#define AUX_IRQ 12 #define I8042_KBD_IRQ 1
#define I8042_AUX_IRQ 12
#define IRQ_HARDDISK 14 #define IRQ_HARDDISK 14
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/major.h> #include <linux/major.h>
#define BUSMOUSE_MINOR 0
#define PSMOUSE_MINOR 1 #define PSMOUSE_MINOR 1
#define MS_BUSMOUSE_MINOR 2 #define MS_BUSMOUSE_MINOR 2
#define ATIXL_BUSMOUSE_MINOR 3 #define ATIXL_BUSMOUSE_MINOR 3
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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