diff options
| author | Vojtech Pavlik <vojtech@suse.cz> | 2004-03-03 11:59:51 +0100 |
|---|---|---|
| committer | Vojtech Pavlik <vojtech@suse.cz> | 2004-03-03 11:59:51 +0100 |
| commit | 0d32daf57c8c5ce1a11be7a99292e4f2f45aca35 (patch) | |
| tree | f42fab4623f5766b9c114373c44e0ff1a1274f4e /drivers | |
| parent | 912f9f42ddf8973b1294ecc7672af6c31cb6a0ff (diff) | |
| parent | 366b7517f22c58bdb57df51fb5bbbc096d789324 (diff) | |
input: Manual merge with Dmitry.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/input/joystick/amijoy.c | 19 | ||||
| -rw-r--r-- | drivers/input/joystick/analog.c | 28 | ||||
| -rw-r--r-- | drivers/input/joystick/db9.c | 67 | ||||
| -rw-r--r-- | drivers/input/joystick/gamecon.c | 82 | ||||
| -rw-r--r-- | drivers/input/joystick/turbografx.c | 68 | ||||
| -rw-r--r-- | drivers/input/keyboard/atkbd.c | 25 | ||||
| -rw-r--r-- | drivers/input/mouse/98busmouse.c | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/inport.c | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/logibm.c | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/psmouse-base.c | 22 | ||||
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 53 | ||||
| -rw-r--r-- | drivers/input/mouse/synaptics.h | 7 | ||||
| -rw-r--r-- | drivers/input/serio/i8042.c | 7 | ||||
| -rw-r--r-- | drivers/isdn/icn/icn.c | 6 | ||||
| -rw-r--r-- | drivers/isdn/isdnloop/isdnloop.c | 6 | ||||
| -rw-r--r-- | drivers/usb/host/ohci-hcd.c | 14 | ||||
| -rw-r--r-- | drivers/usb/host/ohci-q.c | 16 |
17 files changed, 217 insertions, 209 deletions
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index c84662f60ba1..df57287ccce1 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c @@ -32,6 +32,7 @@ #include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/init.h> #include <linux/input.h> #include <linux/interrupt.h> @@ -42,10 +43,15 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_DESCRIPTION("Driver for Amiga joysticks"); -MODULE_PARM(amijoy, "1-2i"); MODULE_LICENSE("GPL"); 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 struct input_dev amijoy_dev[2]; static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" }; @@ -101,17 +107,6 @@ static void amijoy_close(struct input_dev *dev) 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) { int i, j; diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index acd405370d8d..d76c5fbdfe8a 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -32,6 +32,7 @@ #include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/slab.h> #include <linux/bitops.h> #include <linux/init.h> @@ -50,9 +51,12 @@ MODULE_LICENSE("GPL"); #define ANALOG_PORTS 16 static char *js[ANALOG_PORTS]; +static int js_nargs; static int analog_options[ANALOG_PORTS]; -MODULE_PARM(js, "1-" __MODULE_STRING(ANALOG_PORTS) "s"); -MODULE_PARM_DESC(js, "Analog joystick options"); +module_param_array_named(map, js, charp, js_nargs, 0); +MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities"); + +__obsolete_setup("js="); /* * Times, feature definitions. @@ -711,7 +715,7 @@ static void analog_parse_options(void) int i, j; 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++) if (!strcmp(analog_types[j].name, js[i])) { @@ -742,24 +746,6 @@ static struct gameport_dev analog_dev = { .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) { analog_parse_options(); diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 0ee467e1c48a..f7d3eebd7d0f 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -33,6 +33,7 @@ #include <linux/kernel.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/parport.h> @@ -42,9 +43,24 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_DESCRIPTION("Atari, Amstrad, Commodore, Amiga, Sega, etc. joystick driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(db9, "2i"); -MODULE_PARM(db9_2, "2i"); -MODULE_PARM(db9_3, "2i"); +static int db9[] __initdata = { -1, 0 }; +static int db9_nargs __initdata = 0; +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_MULTI2_STICK 0x02 @@ -76,10 +92,6 @@ MODULE_PARM(db9_3, "2i"); #define DB9_GENESIS6_DELAY 14 #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 input_dev dev[DB9_MAX_DEVICES]; struct timer_list timer; @@ -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 parport *pp; @@ -526,6 +538,12 @@ static struct db9 __init *db9_probe(int *config) if (config[0] < 0) 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]]) { printk(KERN_ERR "db9.c: bad config\n"); return NULL; @@ -601,38 +619,11 @@ static struct db9 __init *db9_probe(int *config) 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) { - db9_base[0] = db9_probe(db9); - db9_base[1] = db9_probe(db9_2); - db9_base[2] = db9_probe(db9_3); + db9_base[0] = db9_probe(db9, db9_nargs); + db9_base[1] = db9_probe(db9_2, db9_nargs_2); + db9_base[2] = db9_probe(db9_3, db9_nargs_3); if (db9_base[0] || db9_base[1] || db9_base[2]) return 0; diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index ae94ab8141d9..02ee05a98c50 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -35,6 +35,7 @@ #include <linux/kernel.h> #include <linux/delay.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/init.h> #include <linux/parport.h> #include <linux/input.h> @@ -43,10 +44,26 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_DESCRIPTION("NES, SNES, N64, MultiSystem, PSX gamepad driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(gc, "2-6i"); -MODULE_PARM(gc_2,"2-6i"); -MODULE_PARM(gc_3,"2-6i"); -MODULE_PARM(gc_psx_delay, "i"); +static int gc[] __initdata = { -1, 0, 0, 0, 0, 0 }; +static int gc_nargs __initdata = 0; +module_param_array_named(map, gc, int, gc_nargs, 0); +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_NES 2 @@ -71,10 +88,6 @@ struct gc { 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 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) #define GC_PSX_LEN(x) ((x) & 0xf) /* Low nibble is length in words */ 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_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 }; @@ -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 parport *pp; @@ -478,6 +496,11 @@ static struct gc __init *gc_probe(int *config) if (config[0] < 0) 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]); if (!pp) { @@ -507,7 +530,7 @@ static struct gc __init *gc_probe(int *config) gc->timer.data = (long) gc; gc->timer.function = gc_timer; - for (i = 0; i < 5; i++) { + for (i = 0; i < nargs - 1; i++) { if (!config[i + 1]) continue; @@ -632,44 +655,11 @@ static struct gc __init *gc_probe(int *config) 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) { - gc_base[0] = gc_probe(gc); - gc_base[1] = gc_probe(gc_2); - gc_base[2] = gc_probe(gc_3); + gc_base[0] = gc_probe(gc, gc_nargs); + gc_base[1] = gc_probe(gc_2, gc_nargs_2); + gc_base[2] = gc_probe(gc_3, gc_nargs_3); if (gc_base[0] || gc_base[1] || gc_base[2]) return 0; diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 718e8f706a9d..8cf86aa83072 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -35,15 +35,31 @@ #include <linux/parport.h> #include <linux/input.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/init.h> MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_DESCRIPTION("TurboGraFX parallel port interface driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(tgfx, "2-8i"); -MODULE_PARM(tgfx_2, "2-8i"); -MODULE_PARM(tgfx_3, "2-8i"); +static int tgfx[] __initdata = { -1, 0, 0, 0, 0, 0, 0, 0 }; +static int tgfx_nargs __initdata = 0; +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 */ @@ -58,10 +74,6 @@ MODULE_PARM(tgfx_3, "2-8i"); #define TGFX_TOP 0x01 #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 char *tgfx_name = "TurboGraFX Multisystem joystick"; @@ -133,7 +145,7 @@ static void tgfx_close(struct input_dev *dev) * 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 parport *pp; @@ -142,6 +154,11 @@ static struct tgfx __init *tgfx_probe(int *config) if (config[0] < 0) 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]); if (!pp) { @@ -171,7 +188,7 @@ static struct tgfx __init *tgfx_probe(int *config) 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) { tgfx->sticks |= (1 << i); @@ -212,38 +229,11 @@ static struct tgfx __init *tgfx_probe(int *config) 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) { - tgfx_base[0] = tgfx_probe(tgfx); - tgfx_base[1] = tgfx_probe(tgfx_2); - tgfx_base[2] = tgfx_probe(tgfx_3); + tgfx_base[0] = tgfx_probe(tgfx, tgfx_nargs); + tgfx_base[1] = tgfx_probe(tgfx_2, tgfx_nargs_2); + tgfx_base[2] = tgfx_probe(tgfx_3, tgfx_nargs_3); if (tgfx_base[0] || tgfx_base[1] || tgfx_base[2]) return 0; diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index e1e52dbdbff4..5451481a2772 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -30,9 +30,6 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); 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"); static int atkbd_set = 2; @@ -59,6 +56,10 @@ 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 * are loadable via an userland utility. @@ -227,7 +228,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, atkbd->resend = 1; goto out; } - + if (!flags && data == ATKBD_RET_ACK) atkbd->resend = 0; #endif @@ -301,7 +302,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, case ATKBD_KEY_UNKNOWN: printk(KERN_WARNING "atkbd.c: Unknown key %s (%s set %d, code %#x on %s).\n", atkbd->release ? "released" : "pressed", - atkbd->translated ? "translated" : "raw", + atkbd->translated ? "translated" : "raw", atkbd->set, code, serio->phys); if (atkbd->translated && atkbd->set == 2 && code == 0x7a) printk(KERN_WARNING "atkbd.c: This is an XFree86 bug. It shouldn't access" @@ -400,7 +401,7 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command) if (receive && param) for (i = 0; i < receive; i++) atkbd->cmdbuf[(receive - 1) - i] = param[i]; - + if (command & 0xff) if (atkbd_sendbyte(atkbd, command & 0xff)) return (atkbd->cmdcnt = 0) - 1; @@ -420,7 +421,7 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command) atkbd->cmdcnt = 0; break; } - + udelay(1); } @@ -513,7 +514,7 @@ static int atkbd_probe(struct atkbd *atkbd) */ if (atkbd_reset) - if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT)) + if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT)) printk(KERN_WARNING "atkbd.c: keyboard reset failed on %s\n", atkbd->serio->phys); /* @@ -584,7 +585,7 @@ static int atkbd_set_3(struct atkbd *atkbd) } } - if (atkbd_set != 3) + if (atkbd_set != 3) return 2; if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) { @@ -685,7 +686,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) switch (serio->type & SERIO_TYPE) { - case SERIO_8042_XL: + case SERIO_8042_XL: atkbd->translated = 1; case SERIO_8042: if (serio->write) @@ -698,7 +699,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) kfree(atkbd); return; } - + if (atkbd->write) { atkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); atkbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); @@ -735,7 +736,7 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev) kfree(atkbd); return; } - + atkbd->set = atkbd_set_3(atkbd); atkbd_enable(atkbd); diff --git a/drivers/input/mouse/98busmouse.c b/drivers/input/mouse/98busmouse.c index 94a4882e60a8..fed160f4cd22 100644 --- a/drivers/input/mouse/98busmouse.c +++ b/drivers/input/mouse/98busmouse.c @@ -74,6 +74,8 @@ static int pc98bm_irq = PC98BM_IRQ; module_param_named(irq, pc98bm_irq, uint, 0); MODULE_PARM_DESC(irq, "IRQ number (13=default)"); +__obsolete_setup("pc98bm_irq="); + static int pc98bm_used = 0; static irqreturn_t pc98bm_interrupt(int irq, void *dev_id, struct pt_regs *regs); diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c index c6ff4b49d4bb..ca4e96886627 100644 --- a/drivers/input/mouse/inport.c +++ b/drivers/input/mouse/inport.c @@ -85,6 +85,8 @@ static int inport_irq = INPORT_IRQ; module_param_named(irq, inport_irq, uint, 0); MODULE_PARM_DESC(irq, "IRQ number (5=default)"); +__obsolete_setup("inport_irq="); + static int inport_used; static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs); diff --git a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c index 6b972dd26735..77eb83e87f61 100644 --- a/drivers/input/mouse/logibm.c +++ b/drivers/input/mouse/logibm.c @@ -75,6 +75,8 @@ static int logibm_irq = LOGIBM_IRQ; module_param_named(irq, logibm_irq, uint, 0); MODULE_PARM_DESC(irq, "IRQ number (5=default)"); +__obsolete_setup("logibm_irq="); + static int logibm_used = 0; static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs); diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 19ab40865600..dd52a465a61c 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -47,6 +47,12 @@ unsigned int psmouse_resetafter; module_param_named(resetafter, psmouse_resetafter, uint, 0); 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"}; /* @@ -163,14 +169,14 @@ static irqreturn_t psmouse_interrupt(struct serio *serio, psmouse->name, psmouse->phys, psmouse->pktcnt); psmouse->pktcnt = 0; } - + psmouse->last = jiffies; psmouse->packet[psmouse->pktcnt++] = data; if (psmouse->packet[0] == PSMOUSE_RET_BAT) { if (psmouse->pktcnt == 1) goto out; - + if (psmouse->pktcnt == 2) { if (psmouse->packet[1] == PSMOUSE_RET_ID) { psmouse->state = PSMOUSE_IGNORE; @@ -258,7 +264,7 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command) return (psmouse->cmdcnt = 0) - 1; while (psmouse->cmdcnt && timeout--) { - + if (psmouse->cmdcnt == 1 && command == PSMOUSE_CMD_RESET_BAT && timeout > 100000) /* do not run in a endless loop */ timeout = 100000; /* 1 sec */ @@ -442,7 +448,7 @@ static int psmouse_probe(struct psmouse *psmouse) */ 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 @@ -497,7 +503,7 @@ static void psmouse_set_rate(struct psmouse *psmouse) static void psmouse_initialize(struct psmouse *psmouse) { unsigned char param[2]; - + /* * We set the mouse report rate, resolution and scaling. */ @@ -571,7 +577,7 @@ static void psmouse_disconnect(struct serio *serio) static void psmouse_connect(struct serio *serio, struct serio_dev *dev) { struct psmouse *psmouse; - + if ((serio->type & SERIO_TYPE) != SERIO_8042 && (serio->type & SERIO_TYPE) != SERIO_PS_PSTHRU) return; @@ -603,7 +609,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev) serio->private = NULL; return; } - + sprintf(psmouse->devname, "%s %s %s", psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name); sprintf(psmouse->phys, "%s/input0", @@ -617,7 +623,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev) psmouse->dev.id.version = psmouse->model; input_register_device(&psmouse->dev); - + printk(KERN_INFO "input: %s on %s\n", psmouse->devname, serio->phys); psmouse_initialize(psmouse); diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index a41d90f55cb4..2894ea1bba30 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -435,6 +435,8 @@ int synaptics_init(struct psmouse *psmouse) 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)) synaptics_pt_create(psmouse); @@ -602,19 +604,42 @@ static void synaptics_process_packet(struct psmouse *psmouse) 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_rslt[] = { 0x80, 0x00, 0x00, 0xC0, 0x00 }; - static unsigned char oldabs_mask[] = { 0xC0, 0x60, 0x00, 0xC0, 0x60 }; - static unsigned char oldabs_rslt[] = { 0xC0, 0x00, 0x00, 0x80, 0x00 }; - struct synaptics_data *priv = psmouse->private; - int idx = psmouse->pktcnt - 1; + 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 oldabs_mask[] = { 0xC0, 0x60, 0x00, 0xC0, 0x60 }; + static unsigned char oldabs_rslt[] = { 0xC0, 0x00, 0x00, 0x80, 0x00 }; - if (SYN_MODEL_NEWABS(priv->model_id)) - return (psmouse->packet[idx] & newabs_mask[idx]) == newabs_rslt[idx]; - else - return (psmouse->packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx]; + switch (pkt_type) { + case SYN_NEWABS: + case SYN_NEWABS_RELAXED: + 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) @@ -630,13 +655,17 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) 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)) synaptics_pass_pt_packet(&psmouse->ptport->serio, psmouse->packet); else synaptics_process_packet(psmouse); 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); psmouse->pktcnt = 0; if (++priv->out_of_sync == psmouse_resetafter) { diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index dbb1a25aff4c..2b41ee0c1afc 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@ -70,6 +70,12 @@ extern int synaptics_init(struct psmouse *psmouse); #define SYN_PS_SET_MODE2 0x14 #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) */ @@ -103,6 +109,7 @@ struct synaptics_data { /* Data for normal processing */ unsigned int out_of_sync; /* # of packets out of sync */ int old_w; /* Previous w value */ + unsigned char pkt_type; /* packet type - old, new, etc */ }; #endif /* _SYNAPTICS_H */ diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index d36cd1736789..445f5042d593 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -52,6 +52,13 @@ static unsigned int i8042_dumbkbd; module_param_named(dumbkbd, i8042_dumbkbd, bool, 0); 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 #include "i8042.h" diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index b715a91f3dbf..391a8f139c08 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c @@ -504,19 +504,19 @@ icn_parse_status(u_char * status, int channel, icn_card * card) case 3: { char *t = status + 6; - char *s = strpbrk(t, ","); + char *s = strchr(t, ','); *s++ = '\0'; strlcpy(cmd.parm.setup.phone, t, sizeof(cmd.parm.setup.phone)); - s = strpbrk(t = s, ","); + s = strchr(t = s, ','); *s++ = '\0'; if (!strlen(t)) cmd.parm.setup.si1 = 0; else cmd.parm.setup.si1 = simple_strtoul(t, NULL, 10); - s = strpbrk(t = s, ","); + s = strchr(t = s, ','); *s++ = '\0'; if (!strlen(t)) cmd.parm.setup.si2 = 0; diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index 040638d97480..fde3db9abb60 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -122,17 +122,17 @@ static void isdnloop_parse_setup(char *setup, isdn_ctrl * cmd) { char *t = setup; - char *s = strpbrk(t, ","); + char *s = strchr(t, ','); *s++ = '\0'; strlcpy(cmd->parm.setup.phone, t, sizeof(cmd->parm.setup.phone)); - s = strpbrk(t = s, ","); + s = strchr(t = s, ','); *s++ = '\0'; if (!strlen(t)) cmd->parm.setup.si1 = 0; else cmd->parm.setup.si1 = simple_strtoul(t, NULL, 10); - s = strpbrk(t = s, ","); + s = strchr(t = s, ','); *s++ = '\0'; if (!strlen(t)) cmd->parm.setup.si2 = 0; diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 87103c77e226..02c7e3152dbe 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -229,11 +229,21 @@ static int ohci_urb_enqueue ( 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 */ if (ed->state == ED_IDLE) { retval = ed_schedule (ohci, ed); if (retval < 0) - goto fail; + goto fail0; if (ed->type == PIPE_ISOCHRONOUS) { u16 frame = OHCI_FRAME_NO(ohci->hcca); @@ -257,6 +267,8 @@ static int ohci_urb_enqueue ( urb->hcpriv = urb_priv; td_submit_urb (ohci, urb); +fail0: + spin_unlock (&urb->lock); fail: if (retval) urb_free_priv (ohci, urb_priv); diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index d1f99bf726e6..2cead07ef548 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -331,19 +331,6 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed) periodic_unlink (ohci, ed); 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 ( /* start periodic dma if needed */ if (periodic) { + wmb (); ohci->hc_control |= OHCI_CTRL_PLE|OHCI_CTRL_IE; 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) /* clean schedule: unlink EDs that are no longer busy */ if (list_empty (&ed->td_list)) - ed_deschedule (ohci, ed); + start_ed_unlink (ohci, ed); /* ... reenabling halted EDs only after fault cleanup */ else if ((ed->hwINFO & (ED_SKIP | ED_DEQUEUE)) == ED_SKIP) { td = list_entry (ed->td_list.next, struct td, td_list); |
