Skip to contentSkip to conversation

New set of input patches

PATCH In review Dmitry Torokhov 3 participants 13 messages Feb 29, 2004 – Mar 2, 2004

Subsystems (3)
lore
Share & tools
lore
#2 lore raw

PATCH 2/9 atkbd bad merge

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-27 23:42:30-05:00, [email protected]
Atkbd: Clean up unclean merge (remove old MODULE_PARMs)

 atkbd.c |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)

===================================================================

drivers/input/keyboard/atkbd.c +1 -5
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
@@ -30,21 +30,17 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
 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;
 module_param_named(set, atkbd_set, int, 0);
 MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3, 4)");
+
 #if defined(__i386__) || defined(__x86_64__) || defined(__hppa__)
 static int atkbd_reset;
 #else
 static int atkbd_reset = 1;
 #endif
-static int atkbd_softrepeat;
-
 module_param_named(reset, atkbd_reset, bool, 0);
 MODULE_PARM_DESC(reset, "Reset keyboard during initialization");
 
#1 lore raw

PATCH 1/9 atkbd whitespace fixes

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-27 23:41:11-05:00, [email protected]
Atkbd: whitespace fixes

 atkbd.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

===================================================================

drivers/input/keyboard/atkbd.c +10 -10
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
@@ -202,7 +202,7 @@
 		atkbd->resend = 1;
 		goto out;
 	}
-	
+
 	if (!flags && data == ATKBD_RET_ACK)
 		atkbd->resend = 0;
 #endif
@@ -276,7 +276,7 @@
 		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"
@@ -353,7 +353,7 @@
 	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;
@@ -373,7 +373,7 @@
 			atkbd->cmdcnt = 0;
 			break;
 		}
-	
+
 		udelay(1);
 	}
 
@@ -466,7 +466,7 @@
  */
 
 	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);
 
 /*
@@ -529,7 +529,7 @@
 		return 3;
 	}
 
-	if (atkbd_set != 2) 
+	if (atkbd_set != 2)
 		if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
 			atkbd->id = param[0] << 8 | param[1];
 			return 2;
@@ -541,7 +541,7 @@
 			return 4;
 	}
 
-	if (atkbd_set != 3) 
+	if (atkbd_set != 3)
 		return 2;
 
 	param[0] = 3;
@@ -637,7 +637,7 @@
 
 	switch (serio->type & SERIO_TYPE) {
 
-		case SERIO_8042_XL: 
+		case SERIO_8042_XL:
 			atkbd->translated = 1;
 		case SERIO_8042:
 			if (serio->write)
@@ -650,7 +650,7 @@
 			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);
@@ -687,7 +687,7 @@
 			kfree(atkbd);
 			return;
 		}
-		
+
 		atkbd->set = atkbd_set_3(atkbd);
 		atkbd_enable(atkbd);
 
#4 lore raw

PATCH 4/9 psmouse whitespace fixes

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-27 23:46:16-05:00, [email protected]
Psmouse: whitespace fixes

 psmouse-base.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

===================================================================

drivers/input/mouse/psmouse-base.c +7 -7
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
@@ -163,14 +163,14 @@
 		       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 +258,7 @@
 			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 */
@@ -497,7 +497,7 @@
 static void psmouse_initialize(struct psmouse *psmouse)
 {
 	unsigned char param[2];
-	
+
 /*
  * We set the mouse report rate, resolution and scaling.
  */
@@ -571,7 +571,7 @@
 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 +603,7 @@
 		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 +617,7 @@
 	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);
#0 lore raw

cover New set of input patches

Hi Vojtech,

Here is the new set of input patches that I have. You have seen some of them, buit this time they are rediffed against 2.6.4-rc1 and in nice order.

01-atkbd-whitespace-fixes.patch
simple whitespace fixes

02-atkbd-bad-merge.patch
clean up bad merge in atkbd module (get rid of MODULE_PARMs, atkbd_softrepeat was declared twice)

03-synaptics-relaxed-proto.patch
some hardware (PowerBook) require relaxed Synaptics protocol checks, but relaxed checks hurt hardware implementing proper protocol when device looses sync. With the patch synaptics driver analyzes first full data packet and either staus in relaxed mode or switches into strict mode.

04-psmouse-whitespace-fixes.patch
simple whitespace fixes

05-psmouse-workaround-noack.patch
some mice do not ACK "disable streaming mode" command causing psmouse driver abort initialization without any indication to the user. This is a regression compared to 2.4. Have kernel complain but continue with prbing hardware (after all we got valid responce from GET ID command).

06-module-param-array-named.patch
introduce module_param_array_named() modeled after module_param_named that allows mapping array module option to

07-joystick-module-param.patch
complete moving input drivers to the new way of handling module parameters using module_param()

08-obsolete-setup.patch
introduce __obsolete_setup(). This is a drop-in replacement for __setup() for truly obsolete options. Kernel will complain when sees such an option.

09-input-obsolete-setup.patch
document removed or renamed options in input drivers using __obsolete_setup() so users will have some clue why old options stopped having any effect.

Signature · 1 line
Dmitry
#5 lore raw

PATCH 5/9 psmouse broken hardware workaround

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-27 23:57:31-05:00, [email protected]
Psmouse: some hardware does not ACK "disable streaming mode" command.
Since we already have an idea that it's a mouse device that is present (from its response to GET ID command), instead of aborting, issue a warning and continue.

 psmouse-base.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

===================================================================

drivers/input/mouse/psmouse-base.c +1 -1
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
@@ -442,7 +442,7 @@
  */
 
 	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
#7 lore raw

PATCH 7/9 Move joysticks to the module_param way of handling options

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-28 00:48:18-05:00, [email protected]
Input: Convert joystick modules to the new way of handling parameters and

         document them in kernel-parameters.txt
  
         The new names are:
           amijoy.map=<a>,<b>
           analog.map=<type1>,<type2>,...<type16>
           db9.dev[2|3]=<parport#>,<type>
           gamecon.map[2|3]=<parport#>,<pad1>,<pad2>,...<pad5>
           turbografx.map[2|3]=<parport#>,<js1>,<js2>,...<js7>
  
         Also there is a tiny change to mousedev and tsdev descriptions in
         kernel-parameters, but no name changes.
 Documentation/input/joystick-parport.txt |   16 +++---
 Documentation/input/joystick.txt         |    6 +-
 Documentation/kernel-parameters.txt      |   46 ++++++++++-------
 drivers/input/joystick/amijoy.c          |   17 +-----
 drivers/input/joystick/analog.c          |   26 +--------
 drivers/input/joystick/db9.c             |   63 +++++++++--------------
 drivers/input/joystick/gamecon.c         |   82 +++++++++++++------------------
 drivers/input/joystick/turbografx.c      |   68 ++++++++++---------------
 8 files changed, 140 insertions(+), 184 deletions(-)

===================================================================

Documentation/input/joystick-parport.txt +8 -8
diff -Nru a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt
@@ -434,7 +434,7 @@
   Using gamecon.c you can connect up to five devices to one parallel port. It
 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).
 
@@ -457,15 +457,15 @@
 your controller plugged in before initializing.
 
   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
-ports.
+gamecon.map2 and gamecon.map3 as additional command line parameters for two
+more parallel ports.
 
 3.2 db9.c
 ~~~~~~~~~
   Apart from making an interface, there is nothing difficult on using the
 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).
 
@@ -489,14 +489,14 @@
 	 10  | Amiga CD32 pad
 
   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.
 
 3.3 turbografx.c
 ~~~~~~~~~~~~~~~~
   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).
 
@@ -504,8 +504,8 @@
 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
-use tgfx_2 and tgfx_3 as additional command line parameters for two more
-interfaces.
+use turbografx.map2 and turbografx.map3 as additional command line parameters
+for two more interfaces.
 
 3.4 PC parallel port pinout
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation/input/joystick.txt +3 -3
diff -Nru a/Documentation/input/joystick.txt b/Documentation/input/joystick.txt
@@ -111,7 +111,7 @@
 	alias tty-ldisc-2 serport
 	alias char-major-13 input
 	above input joydev ns558 analog
-	options analog js=gamepad
+	options analog map=gamepad,none,2btn
 
 2.5 Verifying that it works
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -185,7 +185,7 @@
 module command line, when inserting analog.o into the kernel. The
 parameters are:
 
-	js=type,type,type,....
+	analog.map=<type1>,<type2>,<type3>,....
 
   'type' is type of the joystick from the table below, defining joysticks
 present on gameports in the system, starting with gameport0, second 'type'
@@ -419,7 +419,7 @@
   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.
 
-	amijoy=a,b
+	amijoy.map=<a>,<b>
 
   a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
 the Amiga.
Documentation/kernel-parameters.txt +29 -17

85 lines not on this page · raw message

drivers/input/joystick/amijoy.c +5 -12
diff -Nru 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,13 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <[email protected]>");
 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)");
+
 static int amijoy_used[2] = { 0, 0 };
 static struct input_dev amijoy_dev[2];
 static char *amijoy_phys[2] = { "amijoy/input0", "amijoy/input1" };
@@ -100,17 +104,6 @@
 	if (!--(*used))
 		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)
 {
drivers/input/joystick/analog.c +5 -21
diff -Nru 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,10 @@
 #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");
 
 /*
  * Times, feature definitions.
@@ -711,7 +713,7 @@
 	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])) {
@@ -741,24 +743,6 @@
 	.connect =	analog_connect,
 	.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)
 {
drivers/input/joystick/db9.c +25 -38

101 lines not on this page · raw message

drivers/input/joystick/gamecon.c +36 -46

132 lines not on this page · raw message

drivers/input/joystick/turbografx.c +29 -39

112 lines not on this page · raw message

#9 lore raw

PATCH 9/9 Document removed input options using __obsolete_setup

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-28 00:51:33-05:00, [email protected]
Input: use __obsolete_setup to document removed (renamed)
options so users will have a clue why the options do not work anymore

 joystick/amijoy.c     |    2 ++
 joystick/analog.c     |    2 ++
 joystick/db9.c        |    4 ++++
 joystick/gamecon.c    |    6 ++++++
 joystick/turbografx.c |    4 ++++
 keyboard/atkbd.c      |    4 ++++
 mouse/98busmouse.c    |    2 ++
 mouse/inport.c        |    2 ++
 mouse/logibm.c        |    2 ++
 mouse/psmouse-base.c  |    6 ++++++
 serio/i8042.c         |    7 +++++++
 11 files changed, 41 insertions(+)

===================================================================

drivers/input/joystick/amijoy.c +2 -0
diff -Nru a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
@@ -50,6 +50,8 @@
 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" };
drivers/input/joystick/analog.c +2 -0
diff -Nru a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
@@ -56,6 +56,8 @@
 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.
  */
drivers/input/joystick/db9.c +4 -0
diff -Nru a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
@@ -58,6 +58,10 @@
 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
 #define DB9_GENESIS_PAD		0x03
drivers/input/joystick/gamecon.c +6 -0
diff -Nru a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
@@ -63,6 +63,10 @@
 __obsolete_setup("gc_2=");
 __obsolete_setup("gc_3=");
 
+__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
@@ -247,6 +251,8 @@
 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=");
 
 __obsolete_setup("gc_psx_delay=");
 
drivers/input/joystick/turbografx.c +4 -0
diff -Nru a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c
@@ -61,6 +61,10 @@
 __obsolete_setup("tgfx_2=");
 __obsolete_setup("tgfx_3=");
 
+__obsolete_setup("tgfx=");
+__obsolete_setup("tgfx_2=");
+__obsolete_setup("tgfx_3=");
+
 #define TGFX_REFRESH_TIME	HZ/100	/* 10 ms */
 
 #define TGFX_TRIGGER		0x08
drivers/input/keyboard/atkbd.c +4 -0
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
@@ -48,6 +48,10 @@
 module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
 MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
 
+__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.
drivers/input/mouse/98busmouse.c +2 -0
diff -Nru a/drivers/input/mouse/98busmouse.c b/drivers/input/mouse/98busmouse.c
@@ -74,6 +74,8 @@
 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);
drivers/input/mouse/inport.c +2 -0
diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
@@ -85,6 +85,8 @@
 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);
drivers/input/mouse/logibm.c +2 -0
diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c
@@ -75,6 +75,8 @@
 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);
drivers/input/mouse/psmouse-base.c +6 -0
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
@@ -47,6 +47,12 @@
 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"};
 
 /*
drivers/input/serio/i8042.c +7 -0
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
@@ -52,6 +52,13 @@
 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"
 
#6 lore raw

PATCH 6/9 introduce module_param_array_named

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-28 00:20:14-05:00, [email protected]
Introduce module_param_array_named to allow for module options with name different form corresponding array variable. Allows using short (but descriptive) option names without hurting code readability.

Modeled after module_param_named.

 moduleparam.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

===================================================================

include/linux/moduleparam.h +6 -3
diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h
@@ -126,12 +126,15 @@
 #define param_check_invbool(name, p) __param_check(name, p, int)
 
 /* 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			\
-	= { ARRAY_SIZE(name), &num, param_set_##type, param_get_##type,	\
-	    sizeof(name[0]), name };					\
+	= { ARRAY_SIZE(array), &num, param_set_##type, param_get_##type,\
+	    sizeof(array[0]), array };					\
 	module_param_call(name, param_array_set, param_array_get, 	\
 			  &__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_get(char *buffer, struct kernel_param *kp);
#3 lore raw

PATCH 3/9 synaptics strict/relaxed protocol checks

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-27 23:44:17-05:00, [email protected]
Input: Switch between strict/relaxed synaptics protocol checks based on
data in the first full data packet. Having strict checks helps getting rid of bad data after loosing sync, but not all harware implements strict protocol.

 synaptics.c |   53 +++++++++++++++++++++++++++++++++++++++++------------
 synaptics.h |    7 +++++++
 2 files changed, 48 insertions(+), 12 deletions(-)

===================================================================

drivers/input/mouse/synaptics.c +41 -12
diff -Nru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
@@ -435,6 +435,8 @@
 		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 @@
 	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 };
+
+	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];
 
-	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];
+		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 @@
 			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) {
drivers/input/mouse/synaptics.h +7 -0
diff -Nru a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
@@ -70,6 +70,12 @@
 #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 @@
 	/* 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 */
#8 lore raw

PATCH 8/9 introduce __obsolete_setup

In reply to Dmitry Torokhov

===================================================================

[email protected], 2004-02-28 00:49:41-05:00, [email protected]
Setup: introduce __obsolete_setup macro to denote truly obsolete
parameters. Whenever such parameter is specified kernel will comlain that "Parameter %s is obsolete, ignored"

 include/linux/init.h |   22 +++++++++++++++++-----
 init/main.c          |    7 +++++--
 2 files changed, 22 insertions(+), 7 deletions(-)

===================================================================

include/linux/init.h +17 -5
diff -Nru a/include/linux/init.h b/include/linux/init.h
@@ -110,12 +110,21 @@
 };
 
 /* OBSOLETE: see moduleparam.h for the right way. */
-#define __setup(str, fn)					\
-	static char __setup_str_##fn[] __initdata = str;	\
-	static struct obs_kernel_param __setup_##fn		\
+#define __setup_param(str, unique_id, fn)			\
+	static char __setup_str_##unique_id[] __initdata = str;	\
+	static struct obs_kernel_param __setup_##unique_id	\
 		 __attribute_used__				\
 		 __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__ */
 
@@ -172,7 +181,10 @@
 	{ return 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
 
 /* Data marked not to be saved by software_suspend() */
init/main.c +5 -2
diff -Nru a/init/main.c b/init/main.c
@@ -155,8 +155,11 @@
 	p = &__setup_start;
 	do {
 		int n = strlen(p->str);
-		if (!strncmp(line,p->str,n)) {
-			if (p->setup_func(line+n))
+		if (!strncmp(line, p->str, 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;
 		}
 		p++;
#10 lore raw
In reply to Dmitry Torokhov
Quoted 2 lines · Dmitry Torokhov

Here is the new set of input patches that I have. You have seen some of them, buit this time they are rediffed against 2.6.4-rc1 and in nice order.

I like them very much. Do you have a bitkeeper tree anywhere where I could pull from, so that I don't have to apply these by hand?

Quoted 41 lines

01-atkbd-whitespace-fixes.patch
simple whitespace fixes

02-atkbd-bad-merge.patch
clean up bad merge in atkbd module (get rid of MODULE_PARMs, atkbd_softrepeat was declared twice)

03-synaptics-relaxed-proto.patch
some hardware (PowerBook) require relaxed Synaptics protocol checks, but relaxed checks hurt hardware implementing proper protocol when device looses sync. With the patch synaptics driver analyzes first full data packet and either staus in relaxed mode or switches into strict mode.

04-psmouse-whitespace-fixes.patch
simple whitespace fixes

05-psmouse-workaround-noack.patch
some mice do not ACK "disable streaming mode" command causing psmouse driver abort initialization without any indication to the user. This is a regression compared to 2.4. Have kernel complain but continue with prbing hardware (after all we got valid responce from GET ID command).

06-module-param-array-named.patch
introduce module_param_array_named() modeled after module_param_named that allows mapping array module option to

07-joystick-module-param.patch
complete moving input drivers to the new way of handling module parameters using module_param()

08-obsolete-setup.patch
introduce __obsolete_setup(). This is a drop-in replacement for __setup() for truly obsolete options. Kernel will complain when sees such an option.

09-input-obsolete-setup.patch
document removed or renamed options in input drivers using __obsolete_setup() so users will have some clue why old options stopped having any effect.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#11 lore raw
Quoted 8 lines · Vojtech Pavlik
Quoted 2 lines · Dmitry Torokhov

Here is the new set of input patches that I have. You have seen some of them, buit this time they are rediffed against 2.6.4-rc1 and in nice order.

I like them very much. Do you have a bitkeeper tree anywhere where I could pull from, so that I don't have to apply these by hand?

No, unfortunately I don't have an accessible tree... Hmm, what does it take to get an account at kernel.bkbits.net?

Signature · 1 line
Dmitry
#12 lore raw

bkbits hosting (was Re: [PATCH 0/9] New set of input patches)

Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines · Vojtech Pavlik

I like them very much. Do you have a bitkeeper tree anywhere where I could pull from, so that I don't have to apply these by hand?

No, unfortunately I don't have an accessible tree... Hmm, what does it take to get an account at kernel.bkbits.net?

I already sent private mail to Dmitry, but it occurs to me that other developers are probably in the same straits.

The easiest thing to do in this case is to host your patches at bkbits.net (hostme.bkbits.net, which is different than kernel.bkbits.net -- kernel is a special case). You don't have to change your workflow at all, after it's been set up; you end up just pushing to the bkbits repository when you've got changes to submit.

To set up a hosted project, just follow the directions under
http://www.bitkeeper.com/Hosted.html (the table of contents is on the left). You can clone Linus' tree to populate your tree initially, then push your csets from your workstation to hostme.

If any kernel developers have difficulty doing this, drop me a line -- I'm trying to make the process easy and error-free, and I appreciate any suggestions.

If any kernel developers are having BK workflow problems ("how do I merge my work with other developers'? How do I keep up-to-date without generating hundreds of merge csets?") the first thing to do is to read the BK kernel howto, http://lwn.net/2002/0425/a/bk-thing.php3. If your questions aren't answered there, send them to me or to the bitkeeper-users list.

-andy