Commit 0d32daf5 authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: Manual merge with Dmitry.

parents 912f9f42 366b7517
...@@ -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.
......
...@@ -151,7 +151,15 @@ running once the system is up. ...@@ -151,7 +151,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
...@@ -287,9 +295,10 @@ running once the system is up. ...@@ -287,9 +295,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).
...@@ -384,11 +393,13 @@ running once the system is up. ...@@ -384,11 +393,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.
...@@ -616,9 +627,9 @@ running once the system is up. ...@@ -616,9 +627,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]
...@@ -1164,10 +1175,6 @@ running once the system is up. ...@@ -1164,10 +1175,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
...@@ -1189,8 +1196,13 @@ running once the system is up. ...@@ -1189,8 +1196,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.
......
...@@ -248,12 +248,6 @@ int __init verify_local_APIC(void) ...@@ -248,12 +248,6 @@ int __init verify_local_APIC(void)
*/ */
reg0 = apic_read(APIC_ID); reg0 = apic_read(APIC_ID);
Dprintk("Getting ID: %x\n", reg0); Dprintk("Getting ID: %x\n", reg0);
apic_write(APIC_ID, reg0 ^ APIC_ID_MASK);
reg1 = apic_read(APIC_ID);
Dprintk("Getting ID: %x\n", reg1);
apic_write(APIC_ID, reg0);
if (reg1 != (reg0 ^ APIC_ID_MASK))
return 0;
/* /*
* The next two are just to see if we have sane values. * The next two are just to see if we have sane values.
......
...@@ -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;
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
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;
...@@ -59,6 +56,10 @@ static int atkbd_extra; ...@@ -59,6 +56,10 @@ static int atkbd_extra;
module_param_named(extra, atkbd_extra, bool, 0); module_param_named(extra, atkbd_extra, bool, 0);
MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); 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.
......
...@@ -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);
......
...@@ -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"};
/* /*
...@@ -442,7 +448,7 @@ static int psmouse_probe(struct psmouse *psmouse) ...@@ -442,7 +448,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
......
...@@ -435,6 +435,8 @@ int synaptics_init(struct psmouse *psmouse) ...@@ -435,6 +435,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 +604,42 @@ static void synaptics_process_packet(struct psmouse *psmouse) ...@@ -602,19 +604,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 +655,17 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) ...@@ -630,13 +655,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) {
......
...@@ -70,6 +70,12 @@ extern int synaptics_init(struct psmouse *psmouse); ...@@ -70,6 +70,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 +109,7 @@ struct synaptics_data { ...@@ -103,6 +109,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 */
...@@ -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"
......
...@@ -504,19 +504,19 @@ icn_parse_status(u_char * status, int channel, icn_card * card) ...@@ -504,19 +504,19 @@ icn_parse_status(u_char * status, int channel, icn_card * card)
case 3: case 3:
{ {
char *t = status + 6; char *t = status + 6;
char *s = strpbrk(t, ","); char *s = strchr(t, ',');
*s++ = '\0'; *s++ = '\0';
strlcpy(cmd.parm.setup.phone, t, strlcpy(cmd.parm.setup.phone, t,
sizeof(cmd.parm.setup.phone)); sizeof(cmd.parm.setup.phone));
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd.parm.setup.si1 = 0; cmd.parm.setup.si1 = 0;
else else
cmd.parm.setup.si1 = cmd.parm.setup.si1 =
simple_strtoul(t, NULL, 10); simple_strtoul(t, NULL, 10);
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd.parm.setup.si2 = 0; cmd.parm.setup.si2 = 0;
......
...@@ -122,17 +122,17 @@ static void ...@@ -122,17 +122,17 @@ static void
isdnloop_parse_setup(char *setup, isdn_ctrl * cmd) isdnloop_parse_setup(char *setup, isdn_ctrl * cmd)
{ {
char *t = setup; char *t = setup;
char *s = strpbrk(t, ","); char *s = strchr(t, ',');
*s++ = '\0'; *s++ = '\0';
strlcpy(cmd->parm.setup.phone, t, sizeof(cmd->parm.setup.phone)); strlcpy(cmd->parm.setup.phone, t, sizeof(cmd->parm.setup.phone));
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd->parm.setup.si1 = 0; cmd->parm.setup.si1 = 0;
else else
cmd->parm.setup.si1 = simple_strtoul(t, NULL, 10); cmd->parm.setup.si1 = simple_strtoul(t, NULL, 10);
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd->parm.setup.si2 = 0; cmd->parm.setup.si2 = 0;
......
...@@ -229,11 +229,21 @@ static int ohci_urb_enqueue ( ...@@ -229,11 +229,21 @@ static int ohci_urb_enqueue (
goto fail; goto fail;
} }
/* in case of unlink-during-submit */
spin_lock (&urb->lock);
if (urb->status != -EINPROGRESS) {
spin_unlock (&urb->lock);
finish_urb (ohci, urb, 0);
retval = 0;
goto fail;
}
/* schedule the ed if needed */ /* schedule the ed if needed */
if (ed->state == ED_IDLE) { if (ed->state == ED_IDLE) {
retval = ed_schedule (ohci, ed); retval = ed_schedule (ohci, ed);
if (retval < 0) if (retval < 0)
goto fail; goto fail0;
if (ed->type == PIPE_ISOCHRONOUS) { if (ed->type == PIPE_ISOCHRONOUS) {
u16 frame = OHCI_FRAME_NO(ohci->hcca); u16 frame = OHCI_FRAME_NO(ohci->hcca);
...@@ -257,6 +267,8 @@ static int ohci_urb_enqueue ( ...@@ -257,6 +267,8 @@ static int ohci_urb_enqueue (
urb->hcpriv = urb_priv; urb->hcpriv = urb_priv;
td_submit_urb (ohci, urb); td_submit_urb (ohci, urb);
fail0:
spin_unlock (&urb->lock);
fail: fail:
if (retval) if (retval)
urb_free_priv (ohci, urb_priv); urb_free_priv (ohci, urb_priv);
......
...@@ -331,19 +331,6 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed) ...@@ -331,19 +331,6 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
periodic_unlink (ohci, ed); periodic_unlink (ohci, ed);
break; break;
} }
/* NOTE: Except for a couple of exceptionally clean unlink cases
* (like unlinking the only c/b ED, with no TDs) HCs may still be
* caching this operational ED (or its address). Safe unlinking
* involves not marking it ED_IDLE till INTR_SF; we always do that
* if td_list isn't empty. Otherwise the race is small; but ...
*/
if (ed->state == ED_OPER) {
ed->state = ED_IDLE;
ed->hwINFO &= ~(ED_SKIP | ED_DEQUEUE);
ed->hwHeadP &= ~ED_H;
wmb ();
}
} }
...@@ -665,6 +652,7 @@ static void td_submit_urb ( ...@@ -665,6 +652,7 @@ static void td_submit_urb (
/* start periodic dma if needed */ /* start periodic dma if needed */
if (periodic) { if (periodic) {
wmb ();
ohci->hc_control |= OHCI_CTRL_PLE|OHCI_CTRL_IE; ohci->hc_control |= OHCI_CTRL_PLE|OHCI_CTRL_IE;
writel (ohci->hc_control, &ohci->regs->control); writel (ohci->hc_control, &ohci->regs->control);
} }
...@@ -1053,7 +1041,7 @@ dl_done_list (struct ohci_hcd *ohci, struct td *td, struct pt_regs *regs) ...@@ -1053,7 +1041,7 @@ dl_done_list (struct ohci_hcd *ohci, struct td *td, struct pt_regs *regs)
/* clean schedule: unlink EDs that are no longer busy */ /* clean schedule: unlink EDs that are no longer busy */
if (list_empty (&ed->td_list)) if (list_empty (&ed->td_list))
ed_deschedule (ohci, ed); start_ed_unlink (ohci, ed);
/* ... reenabling halted EDs only after fault cleanup */ /* ... reenabling halted EDs only after fault cleanup */
else if ((ed->hwINFO & (ED_SKIP | ED_DEQUEUE)) == ED_SKIP) { else if ((ed->hwINFO & (ED_SKIP | ED_DEQUEUE)) == ED_SKIP) {
td = list_entry (ed->td_list.next, struct td, td_list); td = list_entry (ed->td_list.next, struct td, td_list);
......
...@@ -110,12 +110,21 @@ struct obs_kernel_param { ...@@ -110,12 +110,21 @@ struct obs_kernel_param {
}; };
/* OBSOLETE: see moduleparam.h for the right way. */ /* OBSOLETE: see moduleparam.h for the right way. */
#define __setup(str, fn) \ #define __setup_param(str, unique_id, fn) \
static char __setup_str_##fn[] __initdata = str; \ static char __setup_str_##unique_id[] __initdata = str; \
static struct obs_kernel_param __setup_##fn \ static struct obs_kernel_param __setup_##unique_id \
__attribute_used__ \ __attribute_used__ \
__attribute__((__section__(".init.setup"))) \ __attribute__((__section__(".init.setup"))) \
= { __setup_str_##fn, fn } = { __setup_str_##unique_id, fn }
#define __setup_null_param(str, unique_id) \
__setup_param(str, unique_id, NULL)
#define __setup(str, fn) \
__setup_param(str, fn, fn)
#define __obsolete_setup(str) \
__setup_null_param(str, __LINE__)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
...@@ -172,7 +181,10 @@ struct obs_kernel_param { ...@@ -172,7 +181,10 @@ struct obs_kernel_param {
{ return exitfn; } \ { return exitfn; } \
void cleanup_module(void) __attribute__((alias(#exitfn))); void cleanup_module(void) __attribute__((alias(#exitfn)));
#define __setup(str,func) /* nothing */ #define __setup_param(str, unique_id, fn) /* nothing */
#define __setup_null_param(str, unique_id) /* nothing */
#define __setup(str, func) /* nothing */
#define __obsolete_setup(str) /* nothing */
#endif #endif
/* Data marked not to be saved by software_suspend() */ /* Data marked not to be saved by software_suspend() */
......
...@@ -126,13 +126,16 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); ...@@ -126,13 +126,16 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp);
#define param_check_invbool(name, p) __param_check(name, p, int) #define param_check_invbool(name, p) __param_check(name, p, int)
/* Comma-separated array: num is set to number they actually specified. */ /* Comma-separated array: num is set to number they actually specified. */
#define module_param_array(name, type, num, perm) \ #define module_param_array_named(name, array, type, num, perm) \
static struct kparam_array __param_arr_##name \ static struct kparam_array __param_arr_##name \
= { ARRAY_SIZE(name), &num, param_set_##type, param_get_##type, \ = { ARRAY_SIZE(array), &num, param_set_##type, param_get_##type,\
sizeof(name[0]), name }; \ sizeof(array[0]), array }; \
module_param_call(name, param_array_set, param_array_get, \ module_param_call(name, param_array_set, param_array_get, \
&__param_arr_##name, perm) &__param_arr_##name, perm)
#define module_param_array(name, type, num, perm) \
module_param_array_named(name, name, type, num, perm)
extern int param_array_set(const char *val, struct kernel_param *kp); extern int param_array_set(const char *val, struct kernel_param *kp);
extern int param_array_get(char *buffer, struct kernel_param *kp); extern int param_array_get(char *buffer, struct kernel_param *kp);
......
...@@ -155,8 +155,11 @@ static int __init obsolete_checksetup(char *line) ...@@ -155,8 +155,11 @@ static int __init obsolete_checksetup(char *line)
p = &__setup_start; p = &__setup_start;
do { do {
int n = strlen(p->str); int n = strlen(p->str);
if (!strncmp(line,p->str,n)) { if (!strncmp(line, p->str, n)) {
if (p->setup_func(line+n)) if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
return 1;
} else if (p->setup_func(line + n))
return 1; return 1;
} }
p++; p++;
......
...@@ -42,11 +42,6 @@ static int daca_detach_client(struct i2c_client *client); ...@@ -42,11 +42,6 @@ static int daca_detach_client(struct i2c_client *client);
/* Unique ID allocation */ /* Unique ID allocation */
static int daca_id; static int daca_id;
struct daca_data
{
int arf; /* place holder for furture use */
};
struct i2c_driver daca_driver = { struct i2c_driver daca_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "DAC3550A driver V " DACA_VERSION, .name = "DAC3550A driver V " DACA_VERSION,
...@@ -168,12 +163,12 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address) ...@@ -168,12 +163,12 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address)
{ {
const char *client_name = "DAC 3550A Digital Equalizer"; const char *client_name = "DAC 3550A Digital Equalizer";
struct i2c_client *new_client; struct i2c_client *new_client;
struct daca_data *data;
int rc = -ENODEV; int rc = -ENODEV;
new_client = kmalloc(sizeof(*new_client) + sizeof(*data), GFP_KERNEL); new_client = kmalloc(sizeof(*new_client), GFP_KERNEL);
if (!new_client) if (!new_client)
return -ENOMEM; return -ENOMEM;
memset(new_client, 0, sizeof(*new_client));
new_client->addr = address; new_client->addr = address;
new_client->adapter = adapter; new_client->adapter = adapter;
...@@ -182,9 +177,6 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address) ...@@ -182,9 +177,6 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address)
strcpy(new_client->name, client_name); strcpy(new_client->name, client_name);
new_client->id = daca_id++; /* racy... */ new_client->id = daca_id++; /* racy... */
data = (struct daca_data *)(new_client+1);
dev_set_drvdata(&new_client->dev, data);
if (daca_init_client(new_client)) if (daca_init_client(new_client))
goto bail; goto bail;
......
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