linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [cset] Add a input_sync() a method to tell which events belong together.
       [not found] <20020725083716.A20717@ucw.cz>
@ 2002-07-25 12:00 ` Vojtech Pavlik
  2002-07-25 12:03   ` Vojtech Pavlik
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 12:00 UTC (permalink / raw)
  To: torvalds, linux-kernel, linuxconsole-dev, rmk

Hi!

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
work.

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


ChangeSet@1.444, 2002-07-25 13:56:28+02:00, vojtech@twilight.ucw.cz
  By popular request, and explicit method of telling which events
  from a device belong together was implemented - input_sync() and
  EV_SYN. Touches every input driver. The first to make use of it
  is mousedev.c to properly merge events into PS/2 packets.

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

 Documentation/input/input-programming.txt      |   12 ++++++++-
 drivers/input/input.c                          |   32 +++++++++++++++++--------
 drivers/input/joystick/a3d.c                   |    4 +++
 drivers/input/joystick/adi.c                   |    2 +
 drivers/input/joystick/amijoy.c                |    2 +
 drivers/input/joystick/analog.c                |    2 +
 drivers/input/joystick/cobra.c                 |    2 +
 drivers/input/joystick/db9.c                   |    2 +
 drivers/input/joystick/gamecon.c               |   11 ++++++++
 drivers/input/joystick/gf2k.c                  |    2 +
 drivers/input/joystick/grip.c                  |    2 +
 drivers/input/joystick/grip_mp.c               |    4 +++
 drivers/input/joystick/guillemot.c             |    2 +
 drivers/input/joystick/iforce/iforce-packets.c |    3 ++
 drivers/input/joystick/interact.c              |    2 +
 drivers/input/joystick/magellan.c              |    2 +
 drivers/input/joystick/sidewinder.c            |   10 +++++++
 drivers/input/joystick/spaceball.c             |    2 +
 drivers/input/joystick/spaceorb.c              |    2 +
 drivers/input/joystick/stinger.c               |    2 +
 drivers/input/joystick/tmdc.c                  |    2 +
 drivers/input/joystick/turbografx.c            |    2 +
 drivers/input/joystick/twidjoy.c               |    2 +
 drivers/input/joystick/warrior.c               |    7 +++--
 drivers/input/keybdev.c                        |    3 --
 drivers/input/keyboard/amikbd.c                |    2 +
 drivers/input/keyboard/atkbd.c                 |    1 
 drivers/input/keyboard/maple_keyb.c            |    2 +
 drivers/input/keyboard/newtonkbd.c             |    2 +
 drivers/input/keyboard/ps2serkbd.c             |    1 
 drivers/input/keyboard/sunkbd.c                |    1 
 drivers/input/keyboard/xtkbd.c                 |    1 
 drivers/input/mouse/amimouse.c                 |    2 +
 drivers/input/mouse/inport.c                   |    2 +
 drivers/input/mouse/logibm.c                   |    2 +
 drivers/input/mouse/maplemouse.c               |    1 
 drivers/input/mouse/pc110pad.c                 |    3 --
 drivers/input/mouse/psmouse.c                  |    1 
 drivers/input/mouse/rpcmouse.c                 |    2 +
 drivers/input/mouse/sermouse.c                 |    4 +++
 drivers/input/mousedev.c                       |   21 ++++++++++------
 drivers/input/touchscreen/gunze.c              |    1 
 drivers/input/touchscreen/h3600_ts_input.c     |    4 +++
 drivers/macintosh/adbhid.c                     |    6 ++++
 drivers/macintosh/mac_hid.c                    |    1 
 drivers/usb/input/aiptek.c                     |    2 +
 drivers/usb/input/hid-core.c                   |    3 ++
 drivers/usb/input/hid-input.c                  |    5 +++
 drivers/usb/input/hid.h                        |    2 +
 drivers/usb/input/powermate.c                  |    1 
 drivers/usb/input/usbkbd.c                     |    4 ++-
 drivers/usb/input/usbmouse.c                   |    4 ++-
 drivers/usb/input/wacom.c                      |    5 +++
 drivers/usb/input/xpad.c                       |    2 +
 include/linux/input.h                          |   20 +++++++++++----
 55 files changed, 193 insertions(+), 33 deletions(-)


diff -Nru a/Documentation/input/input-programming.txt b/Documentation/input/input-programming.txt
--- a/Documentation/input/input-programming.txt	Thu Jul 25 13:56:59 2002
+++ b/Documentation/input/input-programming.txt	Thu Jul 25 13:56:59 2002
@@ -23,6 +23,7 @@
 static void button_interrupt(int irq, void *dummy, struct pt_regs *fp)
 {
 	input_report_key(&button_dev, BTN_1, inb(BUTTON_PORT) & 1);
+	input_sync(&button_dev);
 }
 
 static int __init button_init(void)
@@ -86,12 +87,21 @@
 which upon every interrupt from the button checks its state and reports it
 via the 
 
-	input_report_btn()
+	input_report_key()
 
 call to the input system. There is no need to check whether the interrupt
 routine isn't reporting two same value events (press, press for example) to
 the input system, because the input_report_* functions check that
 themselves.
+
+Then there is the
+
+	input_sync()
+
+call to tell those who receive the events that we've sent a complete report.
+This doesn't seem important in the one button case, but is quite important
+for for example mouse movement, where you don't want the X and Y values
+to be interpreted separately, because that'd result in a different movement.
 
 1.2 dev->open() and dev->close()
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/input.c	Thu Jul 25 13:56:59 2002
@@ -72,16 +72,9 @@
 {
 	struct input_handle *handle = dev->handle;
 
-/*
- * Wake up the device if it is sleeping.
- */
 	if (dev->pm_dev)
 		pm_access(dev->pm_dev);
 
-/*
- * Filter non-events, and bad input values out.
- */
-
 	if (type > EV_MAX || !test_bit(type, dev->evbit))
 		return;
 
@@ -89,6 +82,19 @@
 
 	switch (type) {
 
+		case EV_SYN:
+			switch (code) {
+				case SYN_CONFIG:
+					if (dev->event) dev->event(dev, type, code, value);
+					break;
+
+				case SYN_REPORT:
+					if (dev->sync) return;
+					dev->sync = 1;
+					break;
+			}
+			break;
+
 		case EV_KEY:
 
 			if (code > KEY_MAX || !test_bit(code, dev->keybit) || !!test_bit(code, dev->key) == value)
@@ -185,9 +191,8 @@
 			break;
 	}
 
-/*
- * Distribute the event to handler modules.
- */
+	if (type != EV_SYN) 
+		dev->sync = 0;
 
 	while (handle) {
 		if (handle->open)
@@ -200,6 +205,7 @@
 {
 	struct input_dev *dev = (void *) data;
 	input_event(dev, EV_KEY, dev->repeat_key, 2);
+	input_sync(dev);
 	mod_timer(&dev->timer, jiffies + dev->rep[REP_PERIOD]);
 }
 
@@ -437,6 +443,12 @@
 	struct input_handler *handler = input_handler;
 	struct input_handle *handle;
 	struct input_device_id *id;
+
+/*
+ * Add the EV_SYN capability.
+ */
+
+	set_bit(EV_SYN, dev->evbit);
 
 /*
  * Initialize repeat timer to default values.
diff -Nru a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
--- a/drivers/input/joystick/a3d.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/a3d.c	Thu Jul 25 13:56:59 2002
@@ -130,6 +130,8 @@
 			input_report_key(dev, BTN_LEFT,   data[3] & 2);
 			input_report_key(dev, BTN_MIDDLE, data[3] & 4);
 
+			input_sync(dev);
+
 			a3d->axes[0] = ((signed char)((data[11] << 6) | (data[12] << 3) | (data[13]))) + 128;
 			a3d->axes[1] = ((signed char)((data[14] << 6) | (data[15] << 3) | (data[16]))) + 128;
 			a3d->axes[2] = ((signed char)((data[17] << 6) | (data[18] << 3) | (data[19]))) + 128;
@@ -164,6 +166,8 @@
 			input_report_key(dev, BTN_THUMB,   data[8] & 2);
 			input_report_key(dev, BTN_TOP,     data[8] & 4);
 			input_report_key(dev, BTN_PINKIE,  data[7] & 1);
+
+			input_sync(dev);
 
 			return;
 	}
diff -Nru a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
--- a/drivers/input/joystick/adi.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/adi.c	Thu Jul 25 13:56:59 2002
@@ -249,6 +249,8 @@
 
 	for (i = 63; i < adi->buttons; i++)
 		input_report_key(dev, *key++, adi_get_bits(adi, 1));
+	
+	input_sync(dev);
 
 	return 0;
 }
diff -Nru a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
--- a/drivers/input/joystick/amijoy.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/amijoy.c	Thu Jul 25 13:56:59 2002
@@ -67,6 +67,8 @@
 			input_report_abs(amijoy_dev + i, ABS_X, ((data >> 1) & 1) - ((data >> 9) & 1));
 			data = ~(data ^ (data << 1));
 			input_report_abs(amijoy_dev + i, ABS_Y, ((data >> 1) & 1) - ((data >> 9) & 1));
+
+			input_sync(amijoy_dev + i);
 		}
 }
 
diff -Nru a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
--- a/drivers/input/joystick/analog.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/analog.c	Thu Jul 25 13:56:59 2002
@@ -215,6 +215,8 @@
 			input_report_abs(dev, analog_hats[j++],
 				((buttons >> ((i << 2) + 8)) & 1) - ((buttons >> ((i << 2) + 6)) & 1));
 		}
+
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c
--- a/drivers/input/joystick/cobra.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/cobra.c	Thu Jul 25 13:56:59 2002
@@ -136,6 +136,8 @@
 			for (j = 0; cobra_btn[j]; j++)
 				input_report_key(dev, cobra_btn[j], data[i] & (0x20 << j));
 
+			input_sync(dev);
+
 		}
 
 	mod_timer(&cobra->timer, jiffies + COBRA_REFRESH_TIME);	
diff -Nru a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
--- a/drivers/input/joystick/db9.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/db9.c	Thu Jul 25 13:56:59 2002
@@ -266,6 +266,8 @@
 			break;
 		}
 
+	input_sync(dev);
+
 	mod_timer(&db9->timer, jiffies + DB9_REFRESH_TIME);
 }
 
diff -Nru a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
--- a/drivers/input/joystick/gamecon.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/gamecon.c	Thu Jul 25 13:56:59 2002
@@ -328,6 +328,8 @@
 
 				for (j = 0; j < 10; j++)
 					input_report_key(dev + i, gc_n64_btn[j], s & data[gc_n64_bytes[j]]);
+
+				input_sync(dev + i);
 			}
 		}
 	}
@@ -356,6 +358,8 @@
 			if (s & gc->pads[GC_SNES])
 				for (j = 0; j < 8; j++)
 					input_report_key(dev + i, gc_snes_btn[j], s & data[gc_snes_bytes[j]]);
+
+			input_sync(dev + i);
 		}
 	}
 
@@ -379,6 +383,8 @@
 
 			if (s & gc->pads[GC_MULTI2])
 				input_report_key(dev + i, BTN_THUMB, s & data[5]);
+
+			input_sync(dev + i);
 		}
 	}
 
@@ -398,6 +404,7 @@
 
 				input_report_key(dev + i, BTN_THUMBL, ~data[0] & 0x04);
 				input_report_key(dev + i, BTN_THUMBR, ~data[0] & 0x02);
+				input_sync(dev + i);
 
 			case GC_PSX_NEGCON:
 			case GC_PSX_ANALOG:
@@ -414,6 +421,8 @@
 				input_report_key(dev + i, BTN_START,  ~data[0] & 0x08);
 				input_report_key(dev + i, BTN_SELECT, ~data[0] & 0x01);
 
+				input_sync(dev + i);
+
 				break;
 
 			case GC_PSX_NORMAL:
@@ -426,6 +435,8 @@
 
 				input_report_key(dev + i, BTN_START,  ~data[0] & 0x08);
 				input_report_key(dev + i, BTN_SELECT, ~data[0] & 0x01);
+
+				input_sync(dev + i);
 
 				break;
 		}
diff -Nru a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
--- a/drivers/input/joystick/gf2k.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/gf2k.c	Thu Jul 25 13:56:59 2002
@@ -197,6 +197,8 @@
 
 	for (i = 0; i < gf2k_pads[gf2k->id]; i++)
 		input_report_key(dev, gf2k_btn_pad[i], (t >> i) & 1);
+
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
--- a/drivers/input/joystick/grip.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/grip.c	Thu Jul 25 13:56:59 2002
@@ -276,6 +276,8 @@
 
 
 		}
+
+		input_sync(dev);
 	}
 
 	mod_timer(&grip->timer, jiffies + GRIP_REFRESH_TIME);
diff -Nru a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
--- a/drivers/input/joystick/grip_mp.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/grip_mp.c	Thu Jul 25 13:56:59 2002
@@ -515,6 +515,10 @@
 	input_report_abs(dev, ABS_X, grip->xaxes[slot]);
 	input_report_abs(dev, ABS_Y, grip->yaxes[slot]);
 
+	/* Tell the receiver of the events to process them */
+
+	input_sync(dev);
+
 	grip->dirty[slot] = 0;
 }
 
diff -Nru a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c
--- a/drivers/input/joystick/guillemot.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/guillemot.c	Thu Jul 25 13:56:59 2002
@@ -147,6 +147,8 @@
 			input_report_key(dev, guillemot->type->btn[i], (data[2 + (i >> 3)] >> (i & 7)) & 1);
 	}
 
+	input_sync(dev);
+
 	mod_timer(&guillemot->timer, jiffies + GUILLEMOT_REFRESH_TIME);
 }
 
diff -Nru a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
--- a/drivers/input/joystick/iforce/iforce-packets.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/iforce/iforce-packets.c	Thu Jul 25 13:56:59 2002
@@ -214,10 +214,13 @@
 				}
 			}
 
+			input_sync(dev);
+
 			break;
 
 		case 0x02:	/* status report */
 			input_report_key(dev, BTN_DEAD, data[0] & 0x02);
+			input_sync(dev);
 
 			/* Check if an effect was just started or stopped */
 			i = data[1] & 0x7f;
diff -Nru a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c
--- a/drivers/input/joystick/interact.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/interact.c	Thu Jul 25 13:56:59 2002
@@ -176,6 +176,8 @@
 		}
 	}
 
+	input_sync(dev);
+
 	mod_timer(&interact->timer, jiffies + INTERACT_REFRESH_TIME);
 
 }
diff -Nru a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c
--- a/drivers/input/joystick/magellan.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/magellan.c	Thu Jul 25 13:56:59 2002
@@ -107,6 +107,8 @@
 			for (i = 0; i < 9; i++) input_report_key(dev, magellan_buttons[i], (t >> i) & 1);
 			break;
 	}
+
+	input_sync(dev);
 }
 
 static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
diff -Nru a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
--- a/drivers/input/joystick/sidewinder.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/sidewinder.c	Thu Jul 25 13:56:59 2002
@@ -323,6 +323,8 @@
 			input_report_key(dev, BTN_BASE4, !GB(38,1));
 			input_report_key(dev, BTN_BASE5, !GB(37,1));
 
+			input_sync(dev);
+
 			return 0;
 
 		case SW_ID_GP:
@@ -336,6 +338,8 @@
 
 				for (j = 0; j < 10; j++)
 					input_report_key(dev + i, sw_btn[SW_ID_GP][j], !GB(i*15+j+4,1));
+
+				input_sync(dev + i);
 			}
 
 			return 0;
@@ -356,6 +360,8 @@
 			for (j = 0; j < 9; j++)
 				input_report_key(dev, sw_btn[SW_ID_PP][j], !GB(j,1));
 
+			input_sync(dev);
+
 			return 0;
 
 		case SW_ID_FSP:
@@ -377,6 +383,8 @@
 			input_report_key(dev, BTN_MODE,   GB(38,1));
 			input_report_key(dev, BTN_SELECT, GB(39,1));
 
+			input_sync(dev);
+
 			return 0;
 
 		case SW_ID_FFW:
@@ -389,6 +397,8 @@
 
 			for (j = 0; j < 8; j++)
 				input_report_key(dev, sw_btn[SW_ID_FFW][j], !GB(j+22,1));
+
+			input_sync(dev);
 
 			return 0;
 	}
diff -Nru a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
--- a/drivers/input/joystick/spaceball.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/spaceball.c	Thu Jul 25 13:56:59 2002
@@ -137,6 +137,8 @@
 			printk(KERN_ERR "spaceball: Bad command. [%s]\n", spaceball->data + 1);
 			break;
 	}
+
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c
--- a/drivers/input/joystick/spaceorb.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/spaceorb.c	Thu Jul 25 13:56:59 2002
@@ -124,6 +124,8 @@
 			printk("]\n");
 			break;
 	}
+
+	input_sync(dev);
 }
 
 static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
diff -Nru a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c
--- a/drivers/input/joystick/stinger.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/stinger.c	Thu Jul 25 13:56:59 2002
@@ -85,6 +85,8 @@
 	input_report_abs(dev, ABS_X, (data[1] & 0x3F) - ((data[0] & 0x01) << 6));
 	input_report_abs(dev, ABS_Y, ((data[0] & 0x02) << 5) - (data[2] & 0x3F));
 
+	input_sync(dev);
+
 	return;
 }
 
diff -Nru a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c
--- a/drivers/input/joystick/tmdc.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/tmdc.c	Thu Jul 25 13:56:59 2002
@@ -214,6 +214,8 @@
 						((data[j][tmdc_byte_d[k]] >> (i + tmdc->btno[j][k])) & 1));
 				l += tmdc->btnc[j][k];
 			}
+
+			input_sync(dev);
 	}
 
 	tmdc->bads += bad;
diff -Nru a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c
--- a/drivers/input/joystick/turbografx.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/turbografx.c	Thu Jul 25 13:56:59 2002
@@ -101,6 +101,8 @@
 			input_report_key(dev, BTN_THUMB2,  (data2 & TGFX_THUMB2 ));
 			input_report_key(dev, BTN_TOP,     (data2 & TGFX_TOP    ));
 			input_report_key(dev, BTN_TOP2,    (data2 & TGFX_TOP2   ));
+
+			input_sync(dev);
 		}
 
 	mod_timer(&tgfx->timer, jiffies + TGFX_REFRESH_TIME);
diff -Nru a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c
--- a/drivers/input/joystick/twidjoy.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/twidjoy.c	Thu Jul 25 13:56:59 2002
@@ -127,6 +127,8 @@
 
 		input_report_abs(dev, ABS_X, -abs_x);
 		input_report_abs(dev, ABS_Y, +abs_y);
+
+		input_sync(dev);
 	}
 
 	return;
diff -Nru a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
--- a/drivers/input/joystick/warrior.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/joystick/warrior.c	Thu Jul 25 13:56:59 2002
@@ -76,18 +76,19 @@
 			input_report_key(dev, BTN_THUMB,   (data[3] >> 1) & 1);
 			input_report_key(dev, BTN_TOP,     (data[3] >> 2) & 1);
 			input_report_key(dev, BTN_TOP2,    (data[3] >> 3) & 1);
-			return;
+			break;
 		case 3:					/* XY-axis info->data */
 			input_report_abs(dev, ABS_X, ((data[0] & 8) << 5) - (data[2] | ((data[0] & 4) << 5)));
 			input_report_abs(dev, ABS_Y, (data[1] | ((data[0] & 1) << 7)) - ((data[0] & 2) << 7));
-			return;
+			break;
 		case 5:					/* Throttle, spinner, hat info->data */
 			input_report_abs(dev, ABS_THROTTLE, (data[1] | ((data[0] & 1) << 7)) - ((data[0] & 2) << 7));
 			input_report_abs(dev, ABS_HAT0X, (data[3] & 2 ? 1 : 0) - (data[3] & 1 ? 1 : 0));
 			input_report_abs(dev, ABS_HAT0Y, (data[3] & 8 ? 1 : 0) - (data[3] & 4 ? 1 : 0));
 			input_report_rel(dev, REL_DIAL,  (data[2] | ((data[0] & 4) << 5)) - ((data[0] & 8) << 5));
-			return;
+			break;
 	}
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/input/keybdev.c b/drivers/input/keybdev.c
--- a/drivers/input/keybdev.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keybdev.c	Thu Jul 25 13:56:59 2002
@@ -132,11 +132,10 @@
 	struct input_handle *handle;	
 
 	for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
-
 		input_event(handle->dev, EV_LED, LED_SCROLLL, !!(led & 0x01));
 		input_event(handle->dev, EV_LED, LED_NUML,    !!(led & 0x02));
 		input_event(handle->dev, EV_LED, LED_CAPSL,   !!(led & 0x04));
-
+		input_sync(handle->dev);
 	}
 }
 
diff -Nru a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c
--- a/drivers/input/keyboard/amikbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/amikbd.c	Thu Jul 25 13:56:59 2002
@@ -88,10 +88,12 @@
 		if (scancode == KEY_CAPS) {	/* CapsLock is a toggle switch key on Amiga */
 			input_report_key(&amikbd_dev, scancode, 1);
 			input_report_key(&amikbd_dev, scancode, 0);
+			input_sync(&amikbd_dev);
 			return;
 		}
 		
 		input_report_key(&amikbd_dev, scancode, down);
+		input_sync(&amikbd_dev);
 
 		return;
 	}
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/atkbd.c	Thu Jul 25 13:56:59 2002
@@ -195,6 +195,7 @@
 			break;
 		default:
 			input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release);
+			input_sync(&atkbd->dev);
 	}
 		
 	atkbd->release = 0;
diff -Nru a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
--- a/drivers/input/keyboard/maple_keyb.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/maple_keyb.c	Thu Jul 25 13:56:59 2002
@@ -76,6 +76,8 @@
 		}
 	}
 
+	input_sync(dev);
+
 	memcpy(kbd->old, kbd->new, 8);
 }
 
diff -Nru a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c
--- a/drivers/input/keyboard/newtonkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/newtonkbd.c	Thu Jul 25 13:56:59 2002
@@ -72,6 +72,8 @@
 
 	else if (data == 0xe7) /* end of init sequence */
 		printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys);
+
+	input_sync(&nkbd->dev);
 }
 
 void nkbd_connect(struct serio *serio, struct serio_dev *dev)
diff -Nru a/drivers/input/keyboard/ps2serkbd.c b/drivers/input/keyboard/ps2serkbd.c
--- a/drivers/input/keyboard/ps2serkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/ps2serkbd.c	Thu Jul 25 13:56:59 2002
@@ -161,6 +161,7 @@
         break;
     default:
         input_report_key(&ps2serkbd->dev, ps2serkbd->keycode[code], !ps2serkbd->release);
+	input_sync(&ps2serkbd->dev);
     }
 
     ps2serkbd->release = 0;
diff -Nru a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
--- a/drivers/input/keyboard/sunkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/sunkbd.c	Thu Jul 25 13:56:59 2002
@@ -121,6 +121,7 @@
 		default:
 			if (sunkbd->keycode[data & SUNKBD_KEY]) {
                                 input_report_key(&sunkbd->dev, sunkbd->keycode[data & SUNKBD_KEY], !(data & SUNKBD_RELEASE));
+				input_sync(&sunkbd->dev);
                         } else {
                                 printk(KERN_WARNING "sunkbd.c: Unknown key (scancode %#x) %s.\n",
                                         data & SUNKBD_KEY, data & SUNKBD_RELEASE ? "released" : "pressed");
diff -Nru a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c
--- a/drivers/input/keyboard/xtkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/keyboard/xtkbd.c	Thu Jul 25 13:56:59 2002
@@ -75,6 +75,7 @@
 
 			if (xtkbd->keycode[data & XTKBD_KEY]) {
 				input_report_key(&xtkbd->dev, xtkbd->keycode[data & XTKBD_KEY], !(data & XTKBD_RELEASE));
+				input_sync(&xtkbd->dev);
 			} else {
 				printk(KERN_WARNING "xtkbd.c: Unknown key (scancode %#x) %s.\n",
 					data & XTKBD_KEY, data & XTKBD_RELEASE ? "released" : "pressed");
diff -Nru a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c
--- a/drivers/input/mouse/amimouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/amimouse.c	Thu Jul 25 13:56:59 2002
@@ -68,6 +68,8 @@
 	input_report_key(&amimouse_dev, BTN_LEFT,   ciaa.pra & 0x40);
 	input_report_key(&amimouse_dev, BTN_MIDDLE, potgor & 0x0100);
 	input_report_key(&amimouse_dev, BTN_RIGHT,  potgor & 0x0400);
+
+	input_sync(&amimouse_dev);
 }
 
 static int amimouse_open(struct input_dev *dev)
diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
--- a/drivers/input/mouse/inport.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/inport.c	Thu Jul 25 13:56:59 2002
@@ -139,6 +139,8 @@
 
 	outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
 	outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
+
+	input_sync(&inport_dev);
 }
 
 #ifndef MODULE
diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c
--- a/drivers/input/mouse/logibm.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/logibm.c	Thu Jul 25 13:56:59 2002
@@ -128,6 +128,8 @@
 	input_report_key(&logibm_dev, BTN_RIGHT,  buttons & 1);
 	input_report_key(&logibm_dev, BTN_MIDDLE, buttons & 2);
 	input_report_key(&logibm_dev, BTN_LEFT,   buttons & 4);
+	input_sync(&logibm_dev);
+
 	outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT);
 }
 
diff -Nru a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c
--- a/drivers/input/mouse/maplemouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/maplemouse.c	Thu Jul 25 13:56:59 2002
@@ -40,6 +40,7 @@
 	input_report_rel(dev, REL_X,      relx);
 	input_report_rel(dev, REL_Y,      rely);
 	input_report_rel(dev, REL_WHEEL,  relz);
+	input_sync(dev);
 }
 
 
diff -Nru a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
--- a/drivers/input/mouse/pc110pad.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/pc110pad.c	Thu Jul 25 13:56:59 2002
@@ -78,6 +78,7 @@
 		pc110pad_data[1] | ((pc110pad_data[0] << 3) & 0x80) | ((pc110pad_data[0] << 1) & 0x100));
 	input_report_abs(&pc110pad_dev, ABS_Y,
 		pc110pad_data[2] | ((pc110pad_data[0] << 4) & 0x80));
+	input_sync(&pc110pad_dev);
 
 	pc110pad_count = 0;
 }
@@ -90,8 +91,6 @@
 
 static int pc110pad_open(struct input_dev *dev)
 {
-	unsigned long flags;
-	
 	if (pc110pad_used++)
 		return 0;
 
diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/psmouse.c	Thu Jul 25 13:56:59 2002
@@ -167,6 +167,7 @@
 	input_report_rel(dev, REL_X, packet[1] ? (int) packet[1] - (int) ((packet[0] << 4) & 0x100) : 0);
 	input_report_rel(dev, REL_Y, packet[2] ? (int) ((packet[0] << 3) & 0x100) - (int) packet[2] : 0);
 
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c
--- a/drivers/input/mouse/rpcmouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/rpcmouse.c	Thu Jul 25 13:56:59 2002
@@ -63,6 +63,8 @@
 	input_report_key(&rpcmouse_dev, BTN_LEFT,   b & 0x10);
 	input_report_key(&rpcmouse_dev, BTN_MIDDLE, b & 0x20);
 	input_report_key(&rpcmouse_dev, BTN_RIGHT,  b & 0x40);
+
+	input_sync(&rpcmouse_dev);
 }
 
 static int __init rpcmouse_init(void)
diff -Nru a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
--- a/drivers/input/mouse/sermouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mouse/sermouse.c	Thu Jul 25 13:56:59 2002
@@ -89,6 +89,8 @@
 			break;
 	}
 
+	input_sync(dev);
+
 	if (++sermouse->count == (5 - ((sermouse->type == SERIO_SUN) << 1)))
 		sermouse->count = 0;
 }
@@ -187,6 +189,8 @@
 
 			break;
 	}
+
+	input_sync(dev);
 
 	sermouse->count++;
 }
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/mousedev.c	Thu Jul 25 13:56:59 2002
@@ -94,9 +94,10 @@
 	struct mousedev *mousedevs[3] = { handle->private, &mousedev_mix, NULL };
 	struct mousedev **mousedev = mousedevs;
 	struct mousedev_list *list;
-	int index, size;
+	int index, size, wake;
 
 	while (*mousedev) {
+		wake = 0;
 		list = (*mousedev)->list;
 		while (list) {
 			switch (type) {
@@ -158,16 +159,20 @@
 						case 2: return;
 					}
 					break;
-			}
-					
-			list->ready = 1;
-
-			kill_fasync(&list->fasync, SIGIO, POLL_IN);
 
+				case EV_SYN:
+					switch (code) {
+						case SYN_REPORT:
+							list->ready = 1;
+							kill_fasync(&list->fasync, SIGIO, POLL_IN);
+							wake = 1;
+							break;
+					}
+			}
 			list = list->next;
 		}
-
-		wake_up_interruptible(&((*mousedev)->wait));
+		if (wake)
+			wake_up_interruptible(&((*mousedev)->wait));
 		mousedev++;
 	}
 }
diff -Nru a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c
--- a/drivers/input/touchscreen/gunze.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/touchscreen/gunze.c	Thu Jul 25 13:56:59 2002
@@ -74,6 +74,7 @@
 	input_report_abs(dev, ABS_X, simple_strtoul(gunze->data + 1, NULL, 10) * 4);
 	input_report_abs(dev, ABS_Y, 3072 - simple_strtoul(gunze->data + 6, NULL, 10) * 3);
 	input_report_key(dev, BTN_TOUCH, gunze->data[0] == 'T');
+	input_sync(dev);
 }
 
 static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
diff -Nru a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c
--- a/drivers/input/touchscreen/h3600_ts_input.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/input/touchscreen/h3600_ts_input.c	Thu Jul 25 13:56:59 2002
@@ -109,6 +109,7 @@
 	struct input_dev *dev = (struct input_dev *) dev_id;
 
 	input_report_key(dev, KEY_ENTER, down);
+	input_sync(dev);
 }
 
 static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
@@ -122,6 +123,7 @@
 	 */ 	
 	input_report_key(dev, KEY_SUSPEND, 1);
 	input_report_key(dev, KEY_SUSPEND, down); 	
+	input_sync(dev);
 }
 
 #ifdef CONFIG_PM
@@ -267,6 +269,8 @@
 			/* Send a non input event elsewhere */
 			break;
         }
+
+	input_sync(dev);
 }
 
 /*
diff -Nru a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
--- a/drivers/macintosh/adbhid.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/macintosh/adbhid.c	Thu Jul 25 13:56:59 2002
@@ -163,6 +163,8 @@
 	else
 		printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode,
 		       up_flag ? "released" : "pressed");
+
+	input_sync(&adbhid[id]->input);
 }
 
 static void
@@ -259,6 +261,8 @@
 			 ((data[2]&0x7f) < 64 ? (data[2]&0x7f) : (data[2]&0x7f)-128 ));
 	input_report_rel(&adbhid[id]->input, REL_Y,
 			 ((data[1]&0x7f) < 64 ? (data[1]&0x7f) : (data[1]&0x7f)-128 ));
+
+	input_sync(&adbhid[id]->input);
 }
 
 static void
@@ -363,6 +367,8 @@
 	  }
 	  break;
 	}
+
+	input_sync(&adbhid[id]->input);
 }
 
 static struct adb_request led_request;
diff -Nru a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
--- a/drivers/macintosh/mac_hid.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/macintosh/mac_hid.c	Thu Jul 25 13:56:59 2002
@@ -162,6 +162,7 @@
 			 	input_report_key(&emumousebtn,
 						 keycode == mouse_button2_keycode ? BTN_MIDDLE : BTN_RIGHT,
 						 down);
+				input_sync(&emumousebtn);
 				return 1;
 			}
 			mouse_last_keycode = down ? keycode : 0;
diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
--- a/drivers/usb/input/aiptek.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/aiptek.c	Thu Jul 25 13:56:59 2002
@@ -161,6 +161,8 @@
 		input_report_key(dev, BTN_STYLUS2, data[5] & 0x10);
 	}
 
+	input_sync(dev);
+
 }
 
 struct aiptek_features aiptek_features[] = {
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/hid-core.c	Thu Jul 25 13:56:59 2002
@@ -903,6 +903,9 @@
 	for (n = 0; n < report->maxfield; n++)
 		hid_input_field(hid, report->field[n], data);
 
+	if (hid->claimed & HID_CLAIMED_INPUT)
+		hidinput_report_event(hid, report);
+
 	return 0;
 }
 
diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/hid-input.c	Thu Jul 25 13:56:59 2002
@@ -428,6 +428,11 @@
 		input_event(input, usage->type, usage->code, 0);
 }
 
+void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
+{
+	input_sync(&hid->input);
+}
+
 static int hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	struct hid_device *hid = dev->private;
diff -Nru a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/hid.h	Thu Jul 25 13:56:59 2002
@@ -416,11 +416,13 @@
 /* We ignore a few input applications that are not widely used */
 #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || ( a == 0x00010080) || ( a == 0x000c0001))
 extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
+extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
 extern int hidinput_connect(struct hid_device *);
 extern void hidinput_disconnect(struct hid_device *);
 #else
 #define IS_INPUT_APPLICATION(a) (0)
 static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) { }
+static inline void hidinput_report_event(struct hid_device *hid, struct hid_report *report) { }
 static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; }
 static inline void hidinput_disconnect(struct hid_device *hid) { }
 #endif
diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
--- a/drivers/usb/input/powermate.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/powermate.c	Thu Jul 25 13:56:59 2002
@@ -83,6 +83,7 @@
 	/* handle updates to device state */
 	input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01);
 	input_report_rel(&pm->input, REL_DIAL, pm->data[1]);
+	input_sync(&pm->input);
 }
 
 /* Decide if we need to issue a control message and do so. Must be called with pm->lock down */
diff -Nru a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c
--- a/drivers/usb/input/usbkbd.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/usbkbd.c	Thu Jul 25 13:56:59 2002
@@ -104,6 +104,8 @@
 		}
 	}
 
+	input_sync(&kbd->dev);
+
 	memcpy(kbd->old, kbd->new, 8);
 }
 
@@ -236,7 +238,7 @@
 
 	kbd->dev.name = kbd->name;
 	kbd->dev.phys = kbd->phys;	
-	kbd->dev.id.bus = BUS_USB;
+	kbd->dev.id.bustype = BUS_USB;
 	kbd->dev.id.vendor = dev->descriptor.idVendor;
 	kbd->dev.id.product = dev->descriptor.idProduct;
 	kbd->dev.id.version = dev->descriptor.bcdDevice;
diff -Nru a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c
--- a/drivers/usb/input/usbmouse.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/usbmouse.c	Thu Jul 25 13:56:59 2002
@@ -72,6 +72,8 @@
 	input_report_rel(dev, REL_X,     data[1]);
 	input_report_rel(dev, REL_Y,     data[2]);
 	input_report_rel(dev, REL_WHEEL, data[3]);
+
+	input_sync(dev);
 }
 
 static int usb_mouse_open(struct input_dev *dev)
@@ -145,7 +147,7 @@
 
 	mouse->dev.name = mouse->name;
 	mouse->dev.phys = mouse->phys;
-	mouse->dev.id.bus = BUS_USB;
+	mouse->dev.id.bustype = BUS_USB;
 	mouse->dev.id.vendor = dev->descriptor.idVendor;
 	mouse->dev.id.product = dev->descriptor.idProduct;
 	mouse->dev.id.version = dev->descriptor.bcdDevice;
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/wacom.c	Thu Jul 25 13:56:59 2002
@@ -136,6 +136,7 @@
 	}
 	
 	input_event(dev, EV_MSC, MSC_SERIAL, 0);
+	input_sync(dev);
 }
 
 static void wacom_graphire_irq(struct urb *urb)
@@ -189,6 +190,8 @@
 	input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
 
 	input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
+
+	input_sync(dev);
 }
 
 static void wacom_intuos_irq(struct urb *urb)
@@ -291,6 +294,8 @@
 	}
 	
 	input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+
+	input_sync(dev);
 }
 
 #define WACOM_INTUOS_TOOLS	(BIT(BTN_TOOL_BRUSH) | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS))
diff -Nru a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c
--- a/drivers/usb/input/xpad.c	Thu Jul 25 13:56:59 2002
+++ b/drivers/usb/input/xpad.c	Thu Jul 25 13:56:59 2002
@@ -158,6 +158,8 @@
 	/* "analog" buttons black, white */
 	input_report_key(dev, BTN_C, data[8]);
 	input_report_key(dev, BTN_Z, data[9]);
+
+	input_sync(dev);
 }
 
 static void xpad_irq_in(struct urb *urb)
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Thu Jul 25 13:56:59 2002
+++ b/include/linux/input.h	Thu Jul 25 13:56:59 2002
@@ -57,10 +57,10 @@
  */
 
 struct input_devinfo {
-	uint16_t bustype;
-	uint16_t vendor;
-	uint16_t product;
-	uint16_t version;
+	__u16 bustype;
+	__u16 vendor;
+	__u16 product;
+	__u16 version;
 };
 
 #define EVIOCGVERSION		_IOR('E', 0x01, int)			/* get driver version */
@@ -89,7 +89,7 @@
  * Event types
  */
 
-#define EV_RST			0x00
+#define EV_SYN			0x00
 #define EV_KEY			0x01
 #define EV_REL			0x02
 #define EV_ABS			0x03
@@ -103,6 +103,13 @@
 #define EV_MAX			0x1f
 
 /*
+ * Synchronization events.
+ */
+
+#define SYN_REPORT		0
+#define SYN_CONFIG		1
+
+/*
  * Keys and buttons
  */
 
@@ -769,6 +776,8 @@
 	struct pm_dev *pm_dev;
 	int state;
 
+	int sync;
+
 	int abs[ABS_MAX + 1];
 	int rep[REP_MAX + 1];
 
@@ -883,6 +892,7 @@
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
 
+#define input_sync(a)		input_event(a, EV_SYN, SYN_REPORT, 0)
 #define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))
 #define input_report_rel(a,b,c) input_event(a, EV_REL, b, c)
 #define input_report_abs(a,b,c) input_event(a, EV_ABS, b, c)

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


This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch14552
M'XL(`(OG/ST``]1=>7/C-I;_V_H4V$I5I]WQ@8,$@9[JKAS.9%R;3;K2R=9.
M;;9<(`G:'.L:BFK;"?/=]X&D1$HB)0+N=KESR!)%/1SOAW?Q/>`+]-M"9Z^/
M/LS^E>OH9O0%^L=LD;\^RN_2<7I]DY\MH[NSZ`^X_LML!M?/;V83?5[??1[>
MGJ?3^3(?P??O5![=H`\Z6[P^(F=L?25_F.O71[]\_\-O/W[SRVCTY@WZ[D9-
MK_5[G:,W;T;Y+/N@QO'B:Y7?C&?3LSQ3T\5$Y^HLFDV*]:T%Q9C"OSX)&/9Y
M03CV@B(B,2'*(SK&U!/<&]4=^WJK^]MT`NICSI@O"A_[%(\N$#GS/`]A>HZ#
M<^HCPE[[_#457V'Z&F/40Q9]Y?OH%(^^11]W%-^-(O3M`YK/YLNQRE"F_[W4
MB_P$J6F,]/U\G$9ICH#ZS2Q&LP3E>CQ.I]?H[B:%^=8?]#1?`(4DFTV00K'^
MD$8:A1KZ=0T=O8;?Z0S=J05*)_.QGL#M.D:GJ.3DU>)A&KT\-DT!B>__^^K]
M/W\Z0[_.EM&-7AC:V4-U(XJS%#[!=S<:)6FVR($VFJA;C98+;;J5YD`A7:#)
M#"Y`+\XB<\<\F\UU-GZ`_F?7NNXMD(2OWKT_IVBNHEN=+\Y&_XE\0GUO]*[!
MR^C4\I_1""L\>MO'OZ(:PZ("\7G9T?/Q[#H-)V=1C13,",/"(P7Q?.H5B?2#
M2&"1\(C'DK+'D*8^(3X'HI12;KJY'T4KBLM%>'Z3QF<W+31YF`2%QSU`$_,B
MS5G"$I](K<*#'33DJDZVB+;ZYG,IK/H&_]^&\6J4K>YY@:`%2V3B81&P6"=*
M89O^;1)NNHA]C/G@+D8W*CO_U^QAD:?1[7DT"S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q`H^UO8/V<97@N:CCPMZ('H,B!@1X7BQ*O[Q`/NHC3M1UV=YY
M+OAS7:>7!1\V\0;-/5K7R*+SQP:`GQ>+>O5'*_?Y3]3`E9J&7GTOQ_?/60E1
M&'SQ`+#"RC-UCFO>$-\0OO,22A*NQ\\D\3@3NM%;5]XXPC+1WQ?6BVKQ%?`Y
M<,VH$9<%.%_)OYMH(!X02P]L7JQZ7'P[8(+S8KQP5*5`:>4#<";*/S`%.5**
M=O>01"H.[',GI@QEB=:JC4V>I\&$G?6"VGC,JFF5B6NQ!S3I).9X"\>(-+HN
M]51<*ZJ1N#`W/.S+9.8\Y0G<.8[']$@S*IAA,MW>$7[>!LY]B!UC(H]9.\U@
MKH3]!5EP^:,L\=\OB(1,E@V3()_0C6+\/[7]?+]Y3OYX&_<:W%M[W#\VOI&&
,>7WW!8V2#C<=GP``
`
end

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add a input_sync() a method to tell which events belong together.
  2002-07-25 12:00 ` [cset] Add a input_sync() a method to tell which events belong together Vojtech Pavlik
@ 2002-07-25 12:03   ` Vojtech Pavlik
  2002-07-25 12:25     ` [cset] Move ps2serkbd.c functionality into atkbd.c, kill ps2serkbd.c Vojtech Pavlik
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 12:03 UTC (permalink / raw)
  To: torvalds, linux-kernel, linuxconsole-dev

Hi!

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
work.

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

ChangeSet@1.445, 2002-07-25 14:02:02+02:00, vojtech@twilight.ucw.cz
  Small cleanup in evdev.c, which copies the data directly from
  input struct to userspace.


 evdev.c |    8 +-------
 1 files changed, 1 insertion(+), 7 deletions(-)


diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c	Thu Jul 25 14:02:19 2002
+++ b/drivers/input/evdev.c	Thu Jul 25 14:02:19 2002
@@ -233,7 +233,6 @@
 	struct evdev_list *list = file->private_data;
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
-	struct input_devinfo id;
 	int retval, t, u;
 
 	if (!evdev->exist) return -ENODEV;
@@ -244,12 +243,7 @@
 			return put_user(EV_VERSION, (int *) arg);
 
 		case EVIOCGID:
-			id.bustype = dev->id.bustype;
-			id.vendor = dev->id.vendor;
-			id.product = dev->id.product;
-			id.version = dev->id.version;
-			return copy_to_user((void *) arg, &id, sizeof(struct input_devinfo));
-
+			return copy_to_user((void *) arg, &dev->id, sizeof(struct input_devinfo));
 		
 		case EVIOCGREP:
 			if ((retval = put_user(dev->rep[0], ((int *) arg) + 0))) return retval;

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


This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch14675
M'XL(`,OH/ST``[64;6^;,!#'7^-/<5*E*5T3L!T#@2E5MW;:IDU:E*JO(]=<
M`BO@"`Q1*C[\3!JU6]6T>P0+B_-QW/WO9Q_!58U5[+3ZFT&5DB/XJ&L3.V:3
MY=DJ-6ZC-JZZM?:YUM;NI;I`;^_M7=]X6;EN#+'K,VE4"BU6=>PP=WQO,=LU
MQL[\_8>K+V_GA$RG<)[*<H67:&`Z)497K<R3^DR:-->E:RI9U@4:Z2I==/>N
M':>4V]MGX9CZ0<<"*L).L80Q*1@FE(M)(,@^L;-'Z3^.$W*?,3_@D\YGW!?D
M`I@KA`^4>S3TN`],Q)3;<=(_*1P("R<,1I2\@W];Q#E1<%G(/`>5HRR;-60E
M8)M@ZZHA;-+,JJKT.L,:3(J02",AR2I4)M_"LM*%_7[7%JA-U2ACTX/&=KE>
M2X4N^0RV:!&1V4,CR.@W+T*HI.3TA<*3*NMYN&/$VU?P@PC"3EU@Q0@[C"9+
M%BEQG2@IPFAY2/+G8O9=Y93Y41]3L!UK3[J_S-U?9'Z0P6<S%WPL0D8[.@D#
M?\<C&_^,(XO]Z!=P#/\+CG,L=(O0E"5B@LD>K)ZE.ZF_PJC:[(9E8_:TZG\`
MV04?!\#L)$((R"?N<_OF.$Z%IJG*?A-L%T8O>K@'@U9G";P^!EFMAO#*_G)T
MFB5#J+-;U,O!?BOL,EK8Q:Q<ZN/C-P\GETI1W=1-,0VH"D,:C<EW>`,B?!P%
"````
`
end

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cset] Move ps2serkbd.c functionality into atkbd.c, kill ps2serkbd.c
  2002-07-25 12:03   ` Vojtech Pavlik
@ 2002-07-25 12:25     ` Vojtech Pavlik
  2002-07-25 14:11       ` [cset] Fix mouse wheel direction in psmouse.c Vojtech Pavlik
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 12:25 UTC (permalink / raw)
  To: torvalds, linux-kernel, linuxconsole-dev

On Thu, Jul 25, 2002 at 02:03:42PM +0200, Vojtech Pavlik wrote:

Hi!

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
work.

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

ChangeSet@1.446, 2002-07-25 14:23:58+02:00, vojtech@twilight.ucw.cz
  Add support for AT keyboards connected over a PS/2 to Serial
  converter to atkbd.c - trivial. Remove ps2serkbd, because it's
  not needed anymore.


 b/drivers/input/keyboard/Config.help |   12 -
 b/drivers/input/keyboard/Config.in   |    1 
 b/drivers/input/keyboard/Makefile    |    1 
 b/drivers/input/keyboard/atkbd.c     |   19 +-
 drivers/input/keyboard/ps2serkbd.c   |  299 -----------------------------------
 5 files changed, 14 insertions(+), 318 deletions(-)


diff -Nru a/drivers/input/keyboard/Config.help b/drivers/input/keyboard/Config.help
--- a/drivers/input/keyboard/Config.help	Thu Jul 25 14:24:31 2002
+++ b/drivers/input/keyboard/Config.help	Thu Jul 25 14:24:31 2002
@@ -7,7 +7,8 @@
 CONFIG_KEYBOARD_ATKBD
   Say Y here if you want to use the standard AT keyboard. Usually
   you'll need this, unless you have a different type keyboard (USB,
-  ADB or other).
+  ADB or other). This also works for AT keyboards connected over
+  a PS/2 to serial converter.
 
   If unsure, say Y.
 
@@ -24,15 +25,6 @@
   This driver is also available as a module ( = code which can be
   inserted in and removed from the running kernel whenever you want).
   The module will be called sunkbd.o. If you want to compile it as a
-  module, say M here and read <file:Documentation/modules.txt>.
-
-CONFIG_KEYBOARD_PS2SERKBD
-  Say Y here if you want to use a PS/2 to Serial converter with a
-  keyboard attached to it.
-
-  This driver is also available as a module ( = code which can be
-  inserted in and removed from the running kernel whenever you want).
-  The module will be called ps2serkbd.o. If you want to compile it as a
   module, say M here and read <file:Documentation/modules.txt>.
 
 CONFIG_KEYBOARD_XTKBD
diff -Nru a/drivers/input/keyboard/Config.in b/drivers/input/keyboard/Config.in
--- a/drivers/input/keyboard/Config.in	Thu Jul 25 14:24:31 2002
+++ b/drivers/input/keyboard/Config.in	Thu Jul 25 14:24:31 2002
@@ -6,7 +6,6 @@
 
 dep_tristate '  AT keyboard support' CONFIG_KEYBOARD_ATKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO
 dep_tristate '  Sun Type 4 and Type 5 keyboard support' CONFIG_KEYBOARD_SUNKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO
-dep_tristate '  PS/2 to Serial converter support' CONFIG_KEYBOARD_PS2SERKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO
 dep_tristate '  XT Keyboard support' CONFIG_KEYBOARD_XTKBD $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO
 dep_tristate '  Newton keyboard' CONFIG_KEYBOARD_NEWTON $CONFIG_INPUT $CONFIG_INPUT_KEYBOARD $CONFIG_SERIO
 
diff -Nru a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
--- a/drivers/input/keyboard/Makefile	Thu Jul 25 14:24:31 2002
+++ b/drivers/input/keyboard/Makefile	Thu Jul 25 14:24:31 2002
@@ -6,7 +6,6 @@
 
 obj-$(CONFIG_KEYBOARD_ATKBD)		+= atkbd.o
 obj-$(CONFIG_KEYBOARD_MAPLE)		+= maple_keyb.o
-obj-$(CONFIG_KEYBOARD_PS2SERKBD)	+= ps2serkbd.o
 obj-$(CONFIG_KEYBOARD_SUNKBD)		+= sunkbd.o
 obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
 obj-$(CONFIG_KEYBOARD_AMIGA)		+= amikbd.o
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Thu Jul 25 14:24:31 2002
+++ b/drivers/input/keyboard/atkbd.c	Thu Jul 25 14:24:31 2002
@@ -129,6 +129,7 @@
 	signed char ack;
 	unsigned char emul;
 	unsigned short id;
+	unsigned char write;
 };
 
 /*
@@ -146,7 +147,7 @@
 #endif
 
 	/* Interface error.  Request that the keyboard resend. */
-	if (flags & (SERIO_FRAME | SERIO_PARITY)) {
+	if ((flags & (SERIO_FRAME | SERIO_PARITY)) && atkbd->write) {
 		printk("atkbd.c: frame/parity error: %02x\n", flags);
 		serio_write(serio, ATKBD_CMD_RESEND);
 		return;
@@ -265,7 +266,7 @@
 	struct atkbd *atkbd = dev->private;
 	char param[2];
 
-	if (!atkbd->serio->write)
+	if (!atkbd->write)
 		return -1;
 
 	switch (type) {
@@ -449,15 +450,19 @@
 	struct atkbd *atkbd;
 	int i;
 
-	if ((serio->type & SERIO_TYPE) != SERIO_8042)
-		return;
+	if ((serio->type & SERIO_TYPE) != SERIO_8042 &&
+		(((serio->type & SERIO_TYPE) != SERIO_RS232) || (serio->type & SERIO_PROTO) != SERIO_PS2SER))
+		        return;
 
 	if (!(atkbd = kmalloc(sizeof(struct atkbd), GFP_KERNEL)))
 		return;
 
 	memset(atkbd, 0, sizeof(struct atkbd));
 
-	if (serio->write) {
+	if ((serio->type & SERIO_TYPE) == SERIO_8042 && serio->write)
+		atkbd->write = 1;
+
+	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);
 	} else  atkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
@@ -475,7 +480,7 @@
 		return;
 	}
 
-	if (serio->write) {
+	if (atkbd->write) {
 
 		if (atkbd_probe(atkbd)) {
 			serio_close(serio);
@@ -518,7 +523,7 @@
 
 	printk(KERN_INFO "input: %s on %s\n", atkbd->name, serio->phys);
 
-	if (serio->write)
+	if (atkbd->write)
 		atkbd_initialize(atkbd);
 }
 
diff -Nru a/drivers/input/keyboard/ps2serkbd.c b/drivers/input/keyboard/ps2serkbd.c
--- a/drivers/input/keyboard/ps2serkbd.c	Thu Jul 25 14:24:31 2002
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,299 +0,0 @@
-/*
- * based on: sunkbd.c and ps2serkbd.c
- *
- * $Id: ps2serkbd.c,v 1.5 2001/09/25 10:12:07 vojtech Exp $
- */
-
-/*
- * PS/2 keyboard via adapter at serial port driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or 
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/input.h>
-#include <linux/serio.h>
-#include <linux/tqueue.h>
-
-#define ATKBD_CMD_SETLEDS	0x10ed
-#define ATKBD_CMD_GSCANSET	0x11f0
-#define ATKBD_CMD_SSCANSET	0x10f0
-#define ATKBD_CMD_GETID		0x02f2
-#define ATKBD_CMD_ENABLE	0x00f4
-#define ATKBD_CMD_RESET_DIS	0x00f5
-#define ATKBD_CMD_SETALL_MB	0x00f8
-#define ATKBD_CMD_EX_ENABLE	0x10ea
-#define ATKBD_CMD_EX_SETLEDS	0x20eb
-
-#define ATKBD_RET_ACK		0xfa
-#define ATKBD_RET_NAK		0xfe
-
-#define ATKBD_KEY_UNKNOWN	  0
-#define ATKBD_KEY_BAT		251
-#define ATKBD_KEY_EMUL0		252
-#define ATKBD_KEY_EMUL1		253
-#define ATKBD_KEY_RELEASE	254
-#define ATKBD_KEY_NULL		255
-
-static unsigned char ps2serkbd_set2_keycode[512] = {
-    0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41, 85,
-    0, 56, 42, 0, 29, 16, 2, 89, 0, 0, 44, 31, 30, 17, 3, 90,
-    0, 46, 45, 32, 18, 5, 4, 91, 0, 57, 47, 33, 20, 19, 6, 0,
-    0, 49, 48, 35, 34, 21, 7, 0, 0, 0, 50, 36, 22, 8, 9, 0,
-    0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,
-    122, 89, 40,120, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 0,
-    85, 86, 90, 91, 92, 93, 14, 94, 95, 79, 0, 75, 71,121, 0,123,
-    82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
-    252, 0, 0, 65, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    252,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,
-    0, 0, 92, 90, 85, 0,137, 0, 0, 0, 0, 91, 89,144,115, 0,
-    136,100,255, 0, 97,149,164, 0,156, 0, 0,140,115, 0, 0,125,
-    0,150, 0,154,152,163,151,126,112,166, 0,140, 0,147, 0,127,
-    159,167,139,160,163, 0, 0,116,158, 0,150,165, 0, 0, 0,142,
-    157, 0,114,166,168, 0, 0, 0,155, 0, 98,113, 0,148, 0,138,
-    0, 0, 0, 0, 0, 0,153,140, 0, 0, 96, 0, 0, 0,143, 0,
-    133, 0,116, 0,143, 0,174,133, 0,107, 0,105,102, 0, 0,112,
-    110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119
-};
-
-/*
- * Per-keyboard data.
- */
-
-struct ps2serkbd {
-    unsigned char keycode[512];
-    struct input_dev dev;
-    struct serio *serio;
-    char name[64];
-    char phys[32];
-    struct tq_struct tq;
-    unsigned char cmdbuf[4];
-    unsigned char cmdcnt;
-    unsigned char set;
-    char release;
-    char ack;
-    char emul;
-    char error;
-    unsigned short id;
-};
-
-/*
- * ps2serkbd_interrupt() is called by the low level driver when a character
- * is received.
- */
-
-static void ps2serkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
-{
-    static int event_count=0;
-    struct ps2serkbd* ps2serkbd = serio->private;
-    int code=data;
-
-#if 0
-    printk(KERN_WARNING "ps2serkbd.c(%8d): (scancode %#x)\n", event_count, data);
-#endif
-    event_count++;
-
-    switch (code) {
-    case ATKBD_RET_ACK:
-        ps2serkbd->ack = 1;
-        return;
-    case ATKBD_RET_NAK:
-        ps2serkbd->ack = -1;
-        return;
-    }
-
-    if (ps2serkbd->cmdcnt) {
-        ps2serkbd->cmdbuf[--ps2serkbd->cmdcnt] = code;
-        return;
-    }
-
-    switch (ps2serkbd->keycode[code]) {
-    case ATKBD_KEY_BAT:
-        queue_task(&ps2serkbd->tq, &tq_immediate);
-        mark_bh(IMMEDIATE_BH);
-        return;
-    case ATKBD_KEY_EMUL0:
-        ps2serkbd->emul = 1;
-        return;
-    case ATKBD_KEY_EMUL1:
-        ps2serkbd->emul = 2;
-        return;
-    case ATKBD_KEY_RELEASE:
-        ps2serkbd->release = 1;
-        return;
-    }
-
-    if (ps2serkbd->emul) {
-        if (--ps2serkbd->emul) return;
-        code |= 0x100;
-    }
-
-    switch (ps2serkbd->keycode[code]) {
-    case ATKBD_KEY_NULL:
-        break;
-    case ATKBD_KEY_UNKNOWN:
-        printk(KERN_WARNING "ps2serkbd.c: Unknown key (set %d, scancode %#x) %s.\n",
-        ps2serkbd->set, code, ps2serkbd->release ? "released" : "pressed");
-        break;
-    default:
-        input_report_key(&ps2serkbd->dev, ps2serkbd->keycode[code], !ps2serkbd->release);
-	input_sync(&ps2serkbd->dev);
-    }
-
-    ps2serkbd->release = 0;
-}
-
-/*
- * ps2serkbd_event() handles events from the input module.
- */
-
-static int ps2serkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
-{
-    switch (type) {
-
-    case EV_LED:
-
-        return 0;
-    }
-
-    return -1;
-}
-
-static int ps2serkbd_initialize(struct ps2serkbd *ps2serkbd) 
-{
-    return 0;
-}
-
-static void ps2serkbd_reinit(void *data) 
-{
-}
-
-
-static void ps2serkbd_connect(struct serio *serio, struct serio_dev *dev)
-{
-    struct ps2serkbd *ps2serkbd;
-    int i;
-
-    if ((serio->type & SERIO_TYPE) != SERIO_RS232)
-        return;
-
-    if ((serio->type & SERIO_PROTO) && (serio->type & SERIO_PROTO) != SERIO_PS2SER)
-        return;
-
-
-    if (!(ps2serkbd = kmalloc(sizeof(struct ps2serkbd), GFP_KERNEL)))
-        return;
-
-    memset(ps2serkbd, 0, sizeof(struct ps2serkbd));
-
-    ps2serkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
-    ps2serkbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
-
-    ps2serkbd->serio = serio;
-
-    ps2serkbd->dev.keycode = ps2serkbd->keycode;
-    ps2serkbd->dev.event = ps2serkbd_event;
-    ps2serkbd->dev.private = ps2serkbd;
-
-    ps2serkbd->tq.routine = ps2serkbd_reinit;
-    ps2serkbd->tq.data = ps2serkbd;
-
-    serio->private = ps2serkbd;
-
-    if (serio_open(serio, dev)) {
-        kfree(ps2serkbd);
-        return;
-    }
-
-    if (ps2serkbd_initialize(ps2serkbd) < 0) {
-        serio_close(serio);
-        kfree(ps2serkbd);
-        return;
-    }
-
-    ps2serkbd->set = 4;
-
-    if (ps2serkbd->set == 4) {
-        ps2serkbd->dev.ledbit[0] |= 0;
-        sprintf(ps2serkbd->name, "AT Set 2 Extended keyboard\n");
-    }
-    memcpy(ps2serkbd->keycode, ps2serkbd_set2_keycode, sizeof(ps2serkbd->keycode));
-
-    sprintf(ps2serkbd->phys, "%s/input0", serio->phys);
-
-    ps2serkbd->dev.name = ps2serkbd->name;
-    ps2serkbd->dev.phys = ps2serkbd->phys;
-    ps2serkbd->dev.id.bustype = BUS_RS232; 
-    ps2serkbd->dev.id.vendor = SERIO_PS2SER;
-    ps2serkbd->dev.id.product = ps2serkbd->set;
-    ps2serkbd->dev.id.version = ps2serkbd->id;
-
-    for (i = 0; i < 512; i++)
-        if (ps2serkbd->keycode[i] && ps2serkbd->keycode[i] <= 250)
-            set_bit(ps2serkbd->keycode[i], ps2serkbd->dev.keybit);
-
-    input_register_device(&ps2serkbd->dev);
-}
-
-/*
- * ps2serkbd_disconnect() unregisters and closes behind us.
- */
-
-static void ps2serkbd_disconnect(struct serio *serio)
-{
-    struct ps2serkbd *ps2serkbd = serio->private;
-    input_unregister_device(&ps2serkbd->dev);
-    serio_close(serio);
-    kfree(ps2serkbd);
-}
-
-static struct serio_dev ps2serkbd_dev = {
-interrupt:
-    ps2serkbd_interrupt,
-connect:
-    ps2serkbd_connect,
-disconnect:
-    ps2serkbd_disconnect
-};
-
-/*
- * The functions for insering/removing us as a module.
- */
-
-int __init ps2serkbd_init(void)
-{
-    serio_register_device(&ps2serkbd_dev);
-    return 0;
-}
-
-void __exit ps2serkbd_exit(void)
-{
-    serio_unregister_device(&ps2serkbd_dev);
-}
-
-module_init(ps2serkbd_init);
-module_exit(ps2serkbd_exit);

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


This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch20801
M'XL(`/_M/ST``\U8;6_B1A#^C'_%G$Y*@ZZ8?;?-B>BXD+;H>@J"W(>3*E6+
MO007L)%M$J6U^ML[M@GA2-+PTIQ*HJRQAV=F9YY]9LA;^)*:I%6[B?_(C#^Q
MWL(O<9JU:MEM.`NO)YF]]&]M_T^\/XACO-^<Q'/37%DW1]-F&"V6F87/^SKS
M)W!CDK15HS9?W\GN%J95&US\_.77SL"RVFTXG^CHV@Q-!NVVE<7)C9X%Z0>=
M369Q9&>)CM*YR;3MQ_-\;9HS0AC^2.IP(E5.%1%.[M.`4BVH"0@3KA+6*K`/
M6^%OXSA,T@*-Y;@*S^H"M8500%B3.$TF@8H6XRWIOB.L10@\`POO)#2(]1'^
MVTV<6SYT@@#2Y6(1)QF,XP0Z5S`U=Z-8)T$*?AQ%QL],`#'F&S3TATV&0<#0
M)*&>X<?1`I]D^!#OZFPZ"FP?&I`EX0T:V#`P<_PH+%*&U<>G/\+(^'J9&@BS
M'U($B.(,(F,"]*&CNWF<&-OZ!))QAUG]API:C3U?ED4TL<Z>RV@>8(1(H8I6
MS?LM-U=;6%6/<,J)*TA./9?2?#0*/,.("2A7GL./PRZ8P;B4B"V5MW^DYW$T
M#J_M,-J.52K'D[FG#>$&$SNF2HT]YUCX=;B*>](Y.-R)F2VV`Q8.7N74=3!2
MYHT-,2(0\G@'ZY"%\@C?/^3/>FK&X<QLQTN(0T7N&5?[RC7:%=)%0AR)O@Z6
M%V=V_V#7)VR;O#0G@A*5&S8RRA6^UAYC@@?/.O@89I^,69BD&9B9P</?M/&B
ML>'@[VVLC3U0=)H+IB0M)?CE8A7:_-I<.MX!Y:CC`G6<N)P[I8[S1RHN7U)Q
M!@WZ.C*^K;.HH17K+Z&1W):_J(G]'>IQ@-)V*0%J]?`OLP`ZW8^`C23.)B:I
MVW`U"5/0LS2&VSB9IB\U&01X:#-IV68>FHQM=9D#W@[,"J/#>;6KI!X+O\$I
MX?)#.4604]^+4I7V[T6I,#J$4![\JWS<:^<!-=Y/U(]$7U>82_1237__XPH7
MDU?5?G8K\?UN7Z'"]Z/D_@7>9X([#AO;'96*B9QPI51974KW+R_%KN!\_]F^
MG.B_G><?A#8MJ%`-IKM18969`YC0PT."7*@MHS2\CK`+^!.=P&T29N8]=A;A
ME:VE7&KA&$Y/QS-]G<()G`XO!KW+WW\:=#Y?0`[5NWYGT+OZ6J_#R4GU=:1Q
M5D+5X2_L'<HMP*JE!'OSC8W5%9)A#^L)R8&OW!4]*&Z<%=\NT6GEY>IK_Z(.
M;]JKMRX1#!U:M=KI3O:#(>.L#GD.3UKW!Y=7EQOF_2'#BWH=\6'U2DRV3"+,
MCU!EZRT6\6+`[:V`866ZVGVMMID-:`-];_U6@3Y*I7#*5%;+TR:2%77M5<MC
MD_+T'S!K'B`)>\_&QSM8:X-"^9=/*#^E+4YV4/[7&1>[9;9;SYWFC?T4@V0Y
DS6_IP`&5.T`<UO_<\2?&GZ;+>5N;0+ET+*U_``B&%^]1$@``
`
end

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cset] Fix mouse wheel direction in psmouse.c
  2002-07-25 12:25     ` [cset] Move ps2serkbd.c functionality into atkbd.c, kill ps2serkbd.c Vojtech Pavlik
@ 2002-07-25 14:11       ` Vojtech Pavlik
  2002-07-25 14:38         ` [cset] Add the EVIOCSABS ioctl for X people Vojtech Pavlik
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 14:11 UTC (permalink / raw)
  To: torvalds, linux-kernel, linuxconsole-dev

Hi!

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
work.

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

ChangeSet@1.447, 2002-07-25 16:08:56+02:00, vojtech@twilight.ucw.cz
  Because the Linux Input core follows the USB HID standard where it
  comes to directions of movement and rotation, a mouse wheel should
  be positive where it "rotates forward, away from the user". We had
  the opposite in psmouse.c. Fixed this.

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

 psmouse.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Thu Jul 25 16:09:18 2002
+++ b/drivers/input/mouse/psmouse.c	Thu Jul 25 16:09:18 2002
@@ -102,7 +102,7 @@
 			case 1: /* Mouse extra info */
 
 				input_report_rel(dev, packet[2] & 0x80 ? REL_HWHEEL : REL_WHEEL,
-					(int) (packet[2] & 7) - (int) (packet[2] & 8));
+					(int) (packet[2] & 8) - (int) (packet[2] & 7));
 				input_report_key(dev, BTN_SIDE, (packet[2] >> 4) & 1);
 				input_report_key(dev, BTN_EXTRA, (packet[2] >> 5) & 1);
 					
@@ -111,7 +111,7 @@
 			case 3: /* TouchPad extra info */
 
 				input_report_rel(dev, packet[2] & 0x08 ? REL_HWHEEL : REL_WHEEL,
-					(int) ((packet[2] >> 4) & 7) - (int) ((packet[2] >> 4) & 8));
+					(int) ((packet[2] >> 4) & 8) - (int) ((packet[2] >> 4) & 7));
 				packet[0] = packet[2] | 0x08;
 
 				break;
@@ -135,14 +135,14 @@
  */
 
 	if (psmouse->type == PSMOUSE_IMPS || psmouse->type == PSMOUSE_GENPS)
-		input_report_rel(dev, REL_WHEEL, (signed char) packet[3]);
+		input_report_rel(dev, REL_WHEEL, -(signed char) packet[3]);
 
 /*
  * Scroll wheel and buttons on IntelliMouse Explorer
  */
 
 	if (psmouse->type == PSMOUSE_IMEX) {
-		input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 7) - (int) (packet[3] & 8));
+		input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 8) - (int) (packet[3] & 7));
 		input_report_key(dev, BTN_SIDE, (packet[3] >> 4) & 1);
 		input_report_key(dev, BTN_EXTRA, (packet[3] >> 5) & 1);
 	}

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


This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##


begin 664 bkpatch22758
M'XL(`(X&0#T``[65;4_;,!#'7]>?X@32U@J:.(GS0*<B!G10K=*J(L2+"2$W
MN9",-(X2MX4I'WZ.6Q7&@#TPTDI6[^'G._M_Z3:<5UCV6@OQ36*8D&TX%97L
MM>0RS=+K1!KS<&F$WY5](H2RFXF8H;F.-J<W9IH7<TF4?\QEF,`"RZK7L@QG
M8Y%W!?9:D\')^>CCA)!^'XX2GE_C&4KH]XD4Y8)G477`99*)W)`ESZL92FZ$
M8E9O0FN;4EM]7,MWJ.O5ED>97X=69%F<61A1FP4>(^O"#AZ5_YCCVZYEVXX;
MU*[M^#8Y!LM@S`=JF]0W;1<LKT>#GNOM4+M'*3R#A1T+NI0<PO]MXHB$<(@A
MGU<(,D$8I?G\%H;-04,H2H189)E85MIY?G8(I\-CJ"3/(UY&L$Q0A:120=3F
MJ*($1&F)H4Q%7H&(8286.,-<@LJ`4DC>>':!*T>SI0)@!E4BYEFD(%.$0E2I
M3!>X8<.63E/P6)1+M:O*7O([B$LQTU4I3KEEP`5"PAM(8Q.%YJC\'(I*[V6$
M!GQ*;S%2`6EED,^@[L-SR?A>(Z3[EP\AE%.R_]R=U5&9-B)="=?499B;<M;R
MH([ET(#9-0T\ZM53?SIU@\@)8F2NC?@JMI(>HX'KU$[`+*8'XL6T9DC>L)=7
ML54OENO93/7B>'MZC/9^&2+G=T/$H,O>9(B4M(!GF5;?2M7W@V"H%UV!\3S+
M[@P8OE?B5MVF<:JT.)R-STQ[5P&:`3G!O/G9B'-U8U^@6R[U5XEM_/+E_8-Z
MCRVJCHX,5TNK>=II+CO0+GAX@_*K?0GO(.A`%YZP^YW.!X6PF$;HY2'B0>S^
M/K#.(](3[C70"310+ZV6[O6JQ$*4S9*U(USLPF0PNKHX'0Q&N]!M5^EUKLXR
M3'C9@376N=0LMNJ/N7_&^KE+YYGNG4WWFW^>,,'PIIK/^EZ`;CSU]\@/^0N@
%3.X&````
`
end


-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 14:11       ` [cset] Fix mouse wheel direction in psmouse.c Vojtech Pavlik
@ 2002-07-25 14:38         ` Vojtech Pavlik
  2002-07-25 14:47           ` Brad Hards
  2002-07-25 15:12           ` Larry McVoy
  0 siblings, 2 replies; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 14:38 UTC (permalink / raw)
  To: torvalds, linux-kernel, linuxconsole-dev

Hi!

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
work.

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

ChangeSet@1.448, 2002-07-25 16:36:05+02:00, vojtech@twilight.ucw.cz
  Add EVIOCSABS() ioctl to change the abs* informative
  values on input devices. This is something the X peoople
  really wanted.
  Rename input_devinfo to input_id, it's shorter and more 
  to the point.
  Remove superfluous printks in uinput.c
  Clean up return values in evdev.c ioctl. 

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

 drivers/input/evdev.c    |   53 ++++++++++++++++++++++++++++-------------------
 drivers/input/uinput.c   |   12 ----------
 include/linux/gameport.h |    2 -
 include/linux/input.h    |    9 ++++---
 include/linux/uinput.h   |    2 -
 5 files changed, 40 insertions(+), 38 deletions(-)


diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c	Thu Jul 25 16:36:22 2002
+++ b/drivers/input/evdev.c	Thu Jul 25 16:36:22 2002
@@ -233,7 +233,7 @@
 	struct evdev_list *list = file->private_data;
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
-	int retval, t, u;
+	int t, u;
 
 	if (!evdev->exist) return -ENODEV;
 
@@ -243,20 +243,20 @@
 			return put_user(EV_VERSION, (int *) arg);
 
 		case EVIOCGID:
-			return copy_to_user((void *) arg, &dev->id, sizeof(struct input_devinfo));
+			return copy_to_user((void *) arg, &dev->id, sizeof(struct input_id));
 		
 		case EVIOCGREP:
-			if ((retval = put_user(dev->rep[0], ((int *) arg) + 0))) return retval;
-			if ((retval = put_user(dev->rep[1], ((int *) arg) + 1))) return retval;
+			if (put_user(dev->rep[0], ((int *) arg) + 0)) return -EFAULT;
+			if (put_user(dev->rep[1], ((int *) arg) + 1)) return -EFAULT;
 			return 0;
 
 		case EVIOCSREP:
-			if ((retval = get_user(dev->rep[0], ((int *) arg) + 0))) return retval;
-			if ((retval = get_user(dev->rep[1], ((int *) arg) + 1))) return retval;
+			if (get_user(dev->rep[0], ((int *) arg) + 0)) return -EFAULT;
+			if (get_user(dev->rep[1], ((int *) arg) + 1)) return -EFAULT;
 			return 0;
 
 		case EVIOCGKEYCODE:
-			if ((retval = get_user(t, ((int *) arg) + 0))) return retval;
+			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax) return -EINVAL;
 			switch (dev->keycodesize) {
 				case 1: u = *(u8*)(dev->keycode + t); break;
@@ -264,13 +264,13 @@
 				case 4: u = *(u32*)(dev->keycode + t * 4); break;
 				default: return -EINVAL;
 			}
-			if ((retval = put_user(u, ((int *) arg) + 1))) return retval;
+			if (put_user(u, ((int *) arg) + 1)) return -EFAULT;
 			return 0;
 
 		case EVIOCSKEYCODE:
-			if ((retval = get_user(t, ((int *) arg) + 0))) return retval;
+			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax) return -EINVAL;
-			if ((retval = get_user(u, ((int *) arg) + 1))) return retval;
+			if (get_user(u, ((int *) arg) + 1)) return -EFAULT;
 			switch (dev->keycodesize) {
 				case 1: *(u8*)(dev->keycode + t) = u; break;
 				case 2: *(u16*)(dev->keycode + t * 2) = u; break;
@@ -284,13 +284,11 @@
 				struct ff_effect effect;
 				int err;
 
-				if (copy_from_user((void*)(&effect), (void*)arg, sizeof(effect))) {
+				if (copy_from_user((void*)(&effect), (void*)arg, sizeof(effect)))
 					return -EFAULT;
-				}
 				err = dev->upload_effect(dev, &effect);
-				if (put_user(effect.id, &(((struct ff_effect*)arg)->id))) {
+				if (put_user(effect.id, &(((struct ff_effect*)arg)->id)))
 					return -EFAULT;
-				}
 				return err;
 			}
 			else return -ENOSYS;
@@ -302,8 +300,8 @@
 			else return -ENOSYS;
 
 		case EVIOCGEFFECTS:
-			if ((retval = put_user(dev->ff_effects_max, (int*) arg)))
-				return retval;
+			if (put_user(dev->ff_effects_max, (int*) arg))
+				return -EFAULT;
 			return 0;
 
 		default:
@@ -380,11 +378,24 @@
 
 				int t = _IOC_NR(cmd) & ABS_MAX;
 
-				if ((retval = put_user(dev->abs[t],     ((int *) arg) + 0))) return retval;
-				if ((retval = put_user(dev->absmin[t],  ((int *) arg) + 1))) return retval;
-				if ((retval = put_user(dev->absmax[t],  ((int *) arg) + 2))) return retval;
-				if ((retval = put_user(dev->absfuzz[t], ((int *) arg) + 3))) return retval;
-				if ((retval = put_user(dev->absflat[t], ((int *) arg) + 4))) return retval;
+				if (put_user(dev->abs[t],     ((int *) arg) + 0)) return -EFAULT;
+				if (put_user(dev->absmin[t],  ((int *) arg) + 1)) return -EFAULT;
+				if (put_user(dev->absmax[t],  ((int *) arg) + 2)) return -EFAULT;
+				if (put_user(dev->absfuzz[t], ((int *) arg) + 3)) return -EFAULT;
+				if (put_user(dev->absflat[t], ((int *) arg) + 4)) return -EFAULT;
+
+				return 0;
+			}
+
+			if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {
+
+				int t = _IOC_NR(cmd) & ABS_MAX;
+
+				if (get_user(dev->abs[t],     ((int *) arg) + 0)) return -EFAULT;
+				if (get_user(dev->absmin[t],  ((int *) arg) + 1)) return -EFAULT;
+				if (get_user(dev->absmax[t],  ((int *) arg) + 2)) return -EFAULT;
+				if (get_user(dev->absfuzz[t], ((int *) arg) + 3)) return -EFAULT;
+				if (get_user(dev->absflat[t], ((int *) arg) + 4)) return -EFAULT;
 
 				return 0;
 			}
diff -Nru a/drivers/input/uinput.c b/drivers/input/uinput.c
--- a/drivers/input/uinput.c	Thu Jul 25 16:36:22 2002
+++ b/drivers/input/uinput.c	Thu Jul 25 16:36:22 2002
@@ -357,7 +357,6 @@
 	.read =		uinput_read,
 	.write =	uinput_write,
 	.poll =		uinput_poll,
-//	fasync:		uinput_fasync,
 	.ioctl =	uinput_ioctl,
 };
 
@@ -369,16 +368,7 @@
 
 static int __init uinput_init(void)
 {
-	int	retval;
-	
-	retval = misc_register(&uinput_misc);
-
-	if (!retval) {
-		printk(KERN_INFO "%s: User level driver support for input subsystem loaded\n", UINPUT_NAME);
-		printk(KERN_INFO "%s: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>\n", UINPUT_NAME);
-	}
-
-	return retval;
+	return misc_register(&uinput_misc);
 }
 
 static void __exit uinput_exit(void)
diff -Nru a/include/linux/gameport.h b/include/linux/gameport.h
--- a/include/linux/gameport.h	Thu Jul 25 16:36:22 2002
+++ b/include/linux/gameport.h	Thu Jul 25 16:36:22 2002
@@ -39,7 +39,7 @@
 	char *name;
 	char *phys;
 
-	struct input_devinfo id;
+	struct input_id id;
 
 	int io;
 	int speed;
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Thu Jul 25 16:36:22 2002
+++ b/include/linux/input.h	Thu Jul 25 16:36:22 2002
@@ -56,7 +56,7 @@
  * IOCTLs (0x00 - 0x7f)
  */
 
-struct input_devinfo {
+struct input_id {
 	__u16 bustype;
 	__u16 vendor;
 	__u16 product;
@@ -64,7 +64,7 @@
 };
 
 #define EVIOCGVERSION		_IOR('E', 0x01, int)			/* get driver version */
-#define EVIOCGID		_IOR('E', 0x02, struct input_devinfo)	/* get device ID */
+#define EVIOCGID		_IOR('E', 0x02, struct input_id)	/* get device ID */
 #define EVIOCGREP		_IOR('E', 0x03, int[2])			/* get repeat settings */
 #define EVIOCSREP		_IOW('E', 0x03, int[2])			/* get repeat settings */
 #define EVIOCGKEYCODE		_IOR('E', 0x04, int[2])			/* get keycode */
@@ -80,6 +80,7 @@
 
 #define EVIOCGBIT(ev,len)	_IOC(_IOC_READ, 'E', 0x20 + ev, len)	/* get event bits */
 #define EVIOCGABS(abs)		_IOR('E', 0x40 + abs, int[5])		/* get abs value/limits */
+#define EVIOCSABS(abs)		_IOW('E', 0xc0 + abs, int[5])		/* set abs value/limits */
 
 #define EVIOCSFF		_IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))	/* send a force effect to a force feedback device */
 #define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
@@ -754,7 +755,7 @@
 	char *name;
 	char *phys;
 	char *uniq;
-	struct input_devinfo id;
+	struct input_id id;
 
 	unsigned long evbit[NBITS(EV_MAX)];
 	unsigned long keybit[NBITS(KEY_MAX)];
@@ -829,7 +830,7 @@
 
 	unsigned long flags;
 
-	struct input_devinfo id;
+	struct input_id id;
 
 	unsigned long evbit[NBITS(EV_MAX)];
 	unsigned long keybit[NBITS(KEY_MAX)];
diff -Nru a/include/linux/uinput.h b/include/linux/uinput.h
--- a/include/linux/uinput.h	Thu Jul 25 16:36:22 2002
+++ b/include/linux/uinput.h	Thu Jul 25 16:36:22 2002
@@ -64,7 +64,7 @@
 #define UINPUT_MAX_NAME_SIZE	80
 struct uinput_user_dev {
 	char name[UINPUT_MAX_NAME_SIZE];
-	struct input_devinfo id;
+	struct input_id id;
         int ff_effects_max;
         int absmax[ABS_MAX + 1];
         int absmin[ABS_MAX + 1];

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


This BitKeeper patch contains the following changesets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X95H*?.#MZ>OTY*BY
MRL2J.1=[C!<TNT%GCR_'(KZNN_7_>WRM?>.IW$R]6MIH9]5W^-F<8ZV^PZ>O
9U:,^C[Z4U?"(!8Z;1`$U_@$GS:7VRQ<`````
`
end

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 14:38         ` [cset] Add the EVIOCSABS ioctl for X people Vojtech Pavlik
@ 2002-07-25 14:47           ` Brad Hards
  2002-07-25 15:08             ` Vojtech Pavlik
  2002-07-25 15:12           ` Larry McVoy
  1 sibling, 1 reply; 15+ messages in thread
From: Brad Hards @ 2002-07-25 14:47 UTC (permalink / raw)
  To: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Fri, 26 Jul 2002 00:38, Vojtech Pavlik wrote:
> Hi!
>
> You can import this changeset into BK by piping this whole message to:
> '| bk receive [path to repository]' or apply the patch as usual.
> 'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
> work.
>
> ===================================================================
>
> ChangeSet@1.448, 2002-07-25 16:36:05+02:00, vojtech@twilight.ucw.cz
>   Add EVIOCSABS() ioctl to change the abs* informative
>   values on input devices. This is something the X peoople
>   really wanted.
Grr. I was just working on modifying this ioctl() to return
something better than int[5], which is pretty ugly.

How about something along these lines (I have the rest of it - its
just trivial changes to evdev.c)?

I could live with curr, min and max instead of *_value, but it
would be nicer if it was a bit more descriptive.

Brad



diff -Naur -X dontdiff linux-2.5.27-eventapi/include/linux/input.h linux-2.5.27-eventapi2/include/linux/input.h
--- linux-2.5.27-eventapi/include/linux/input.h Tue Jul 23 21:36:37 2002
+++ linux-2.5.27-eventapi2/include/linux/input.h        Fri Jul 26 00:17:57 2002
@@ -63,6 +63,14 @@
        uint16_t version;
 };

+struct input_absinfo {
+       int curr_value;
+       int min_value;
+       int max_value;
+       int fuzz;
+       int flat;
+};
+
 #define EVIOCGVERSION          _IOR('E', 0x01, int)                    /* get driver version */
 #define EVIOCGID               _IOR('E', 0x02, struct input_devinfo)   /* get device ID */
 #define EVIOCGREP              _IOR('E', 0x03, int[2])                 /* get repeat settings */
@@ -79,7 +87,7 @@
 #define EVIOCGSND(len)         _IOC(_IOC_READ, 'E', 0x1a, len)         /* get all sounds status */

 #define EVIOCGBIT(ev,len)      _IOC(_IOC_READ, 'E', 0x20 + ev, len)    /* get event bits */
-#define EVIOCGABS(abs)         _IOR('E', 0x40 + abs, int[5])           /* get abs value/limits */
+#define EVIOCGABS(abs)         _IOR('E', 0x40 + abs, struct input_absinfo)     /* get abs value/limits */

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 14:47           ` Brad Hards
@ 2002-07-25 15:08             ` Vojtech Pavlik
  2002-07-28  7:32               ` Brad Hards
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 15:08 UTC (permalink / raw)
  To: Brad Hards; +Cc: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Fri, Jul 26, 2002 at 12:47:20AM +1000, Brad Hards wrote:

> > ChangeSet@1.448, 2002-07-25 16:36:05+02:00, vojtech@twilight.ucw.cz
> >   Add EVIOCSABS() ioctl to change the abs* informative
> >   values on input devices. This is something the X peoople
> >   really wanted.

> Grr. I was just working on modifying this ioctl() to return
> something better than int[5], which is pretty ugly.
> 
> How about something along these lines (I have the rest of it - its
> just trivial changes to evdev.c)?

No problem. Send me a patch that does it for both the EVIOSGABS and
EVIOCSABS and I'll take it. You can either just do it in evdev.c, or
change every driver to use the struct.

> I could live with curr, min and max instead of *_value, but it
> would be nicer if it was a bit more descriptive.

You can make it current, minimum, and maximum, if you wish.  I'm a
minimalist when it comes to naming, and I don't really think "_value" is
bringing much information here. All of them are values after all.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 14:38         ` [cset] Add the EVIOCSABS ioctl for X people Vojtech Pavlik
  2002-07-25 14:47           ` Brad Hards
@ 2002-07-25 15:12           ` Larry McVoy
  2002-07-25 15:23             ` Vojtech Pavlik
  1 sibling, 1 reply; 15+ messages in thread
From: Larry McVoy @ 2002-07-25 15:12 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel, linuxconsole-dev

On Thu, Jul 25, 2002 at 04:38:16PM +0200, Vojtech Pavlik wrote:
> 'bk pull http://linux-input.bkbits.net:8080/linux-input' should also

Make that 

	bk pull bk://linux-input.bkbits.net/linux-input
or
	bk pull http://linux-input.bkbits.net/linux-input

the 8080 port is for BK/Web.

Cheers,
-- 
---
Larry McVoy            	 lm at bitmover.com           http://www.bitmover.com/lm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 15:12           ` Larry McVoy
@ 2002-07-25 15:23             ` Vojtech Pavlik
  0 siblings, 0 replies; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-25 15:23 UTC (permalink / raw)
  To: Larry McVoy, Vojtech Pavlik, torvalds, linux-kernel, linuxconsole-dev

On Thu, Jul 25, 2002 at 08:12:02AM -0700, Larry McVoy wrote:
> On Thu, Jul 25, 2002 at 04:38:16PM +0200, Vojtech Pavlik wrote:
> > 'bk pull http://linux-input.bkbits.net:8080/linux-input' should also
> 
> Make that 
> 
> 	bk pull bk://linux-input.bkbits.net/linux-input
> or
> 	bk pull http://linux-input.bkbits.net/linux-input
> 
> the 8080 port is for BK/Web.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-25 15:08             ` Vojtech Pavlik
@ 2002-07-28  7:32               ` Brad Hards
  2002-07-28  8:08                 ` Vojtech Pavlik
  0 siblings, 1 reply; 15+ messages in thread
From: Brad Hards @ 2002-07-28  7:32 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel, linuxconsole-dev

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

On Fri, 26 Jul 2002 01:08, Vojtech Pavlik wrote:
> On Fri, Jul 26, 2002 at 12:47:20AM +1000, Brad Hards wrote:
> No problem. Send me a patch that does it for both the EVIOSGABS and
> EVIOCSABS and I'll take it. You can either just do it in evdev.c, or
> change every driver to use the struct.
I am just doing the evdev.c (ie the ABI) at this stage. I may look at the
internal representation later.
Patch against 2.5.29. Looks OK?

> > I could live with curr, min and max instead of *_value, but it
> > would be nicer if it was a bit more descriptive.
>
> You can make it current, minimum, and maximum, if you wish.  I'm a
> minimalist when it comes to naming, and I don't really think "_value" is
> bringing much information here. All of them are values after all.
"current" is a bad idea. I used curr_value.

Also, it is nice if you can retain the attributions (so I can get some
ego satisfaction, and so people know who to blame). This is generally
done by maintainers - any chance you can do this too?

Brad
-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.

[-- Attachment #2: absinfo-2.5.29.patch --]
[-- Type: text/x-diff, Size: 3119 bytes --]

diff -Naur -X dontdiff -x Config.in linux-2.5.29/drivers/input/evdev.c linux-2.5.29-eventabs/drivers/input/evdev.c
--- linux-2.5.29/drivers/input/evdev.c	Sat Jul 27 12:58:41 2002
+++ linux-2.5.29-eventabs/drivers/input/evdev.c	Sun Jul 28 17:29:00 2002
@@ -233,6 +233,7 @@
 	struct evdev_list *list = file->private_data;
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
+	struct input_absinfo abs;
 	int t, u;
 
 	if (!evdev->exist) return -ENODEV;
@@ -378,26 +379,19 @@
 
 				int t = _IOC_NR(cmd) & ABS_MAX;
 
-				if (put_user(dev->abs[t],     ((int *) arg) + 0)) return -EFAULT;
-				if (put_user(dev->absmin[t],  ((int *) arg) + 1)) return -EFAULT;
-				if (put_user(dev->absmax[t],  ((int *) arg) + 2)) return -EFAULT;
-				if (put_user(dev->absfuzz[t], ((int *) arg) + 3)) return -EFAULT;
-				if (put_user(dev->absflat[t], ((int *) arg) + 4)) return -EFAULT;
+				abs.curr_value = dev->abs[t];
+				abs.minimum = dev->absmin[t];
+				abs.maximum = dev->absmax[t];
+				abs.fuzz = dev->absfuzz[t];
+				abs.flat = dev->absflat[t];
+				return copy_to_user((void *) arg, &abs, sizeof(struct input_absinfo));
 
-				return 0;
 			}
 
 			if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {
 
-				int t = _IOC_NR(cmd) & ABS_MAX;
-
-				if (get_user(dev->abs[t],     ((int *) arg) + 0)) return -EFAULT;
-				if (get_user(dev->absmin[t],  ((int *) arg) + 1)) return -EFAULT;
-				if (get_user(dev->absmax[t],  ((int *) arg) + 2)) return -EFAULT;
-				if (get_user(dev->absfuzz[t], ((int *) arg) + 3)) return -EFAULT;
-				if (get_user(dev->absflat[t], ((int *) arg) + 4)) return -EFAULT;
-
-				return 0;
+				return copy_from_user(&abs, (void *) arg, sizeof(struct input_absinfo));
+				
 			}
 	}
 	return -EINVAL;
diff -Naur -X dontdiff -x Config.in linux-2.5.29/include/linux/input.h linux-2.5.29-eventabs/include/linux/input.h
--- linux-2.5.29/include/linux/input.h	Sat Jul 27 12:58:37 2002
+++ linux-2.5.29-eventabs/include/linux/input.h	Sun Jul 28 17:25:40 2002
@@ -63,6 +63,14 @@
 	__u16 version;
 };
 
+struct input_absinfo {
+	int curr_value;
+	int minimum;
+	int maximum;
+	int fuzz;
+	int flat;
+};
+
 #define EVIOCGVERSION		_IOR('E', 0x01, int)			/* get driver version */
 #define EVIOCGID		_IOR('E', 0x02, struct input_id)	/* get device ID */
 #define EVIOCGREP		_IOR('E', 0x03, int[2])			/* get repeat settings */
@@ -79,8 +87,8 @@
 #define EVIOCGSND(len)		_IOC(_IOC_READ, 'E', 0x1a, len)		/* get all sounds status */
 
 #define EVIOCGBIT(ev,len)	_IOC(_IOC_READ, 'E', 0x20 + ev, len)	/* get event bits */
-#define EVIOCGABS(abs)		_IOR('E', 0x40 + abs, int[5])		/* get abs value/limits */
-#define EVIOCSABS(abs)		_IOW('E', 0xc0 + abs, int[5])		/* set abs value/limits */
+#define EVIOCGABS(abs)		_IOR('E', 0x40 + abs, struct input_absinfo)		/* get abs value/limits */
+#define EVIOCSABS(abs)		_IOW('E', 0xc0 + abs, struct input_absinfo)		/* set abs value/limits */
 
 #define EVIOCSFF		_IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))	/* send a force effect to a force feedback device */
 #define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-28  7:32               ` Brad Hards
@ 2002-07-28  8:08                 ` Vojtech Pavlik
  2002-07-28  8:29                   ` Brad Hards
  0 siblings, 1 reply; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-28  8:08 UTC (permalink / raw)
  To: Brad Hards; +Cc: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Sun, Jul 28, 2002 at 05:32:53PM +1000, Brad Hards wrote:

> On Fri, 26 Jul 2002 01:08, Vojtech Pavlik wrote:
> > On Fri, Jul 26, 2002 at 12:47:20AM +1000, Brad Hards wrote:
> > No problem. Send me a patch that does it for both the EVIOSGABS and
> > EVIOCSABS and I'll take it. You can either just do it in evdev.c, or
> > change every driver to use the struct.
> I am just doing the evdev.c (ie the ABI) at this stage. I may look at the
> internal representation later.
> Patch against 2.5.29. Looks OK?

Yes.

> > > I could live with curr, min and max instead of *_value, but it
> > > would be nicer if it was a bit more descriptive.
> >
> > You can make it current, minimum, and maximum, if you wish.  I'm a
> > minimalist when it comes to naming, and I don't really think "_value" is
> > bringing much information here. All of them are values after all.
> "current" is a bad idea. I used curr_value.

How about just "value" then?

> Also, it is nice if you can retain the attributions (so I can get some
> ego satisfaction, and so people know who to blame). This is generally
> done by maintainers - any chance you can do this too?

I'm stil fighting with BK to use something else than my e-mail address
in the changesets. So far I've always put the author of the patch into
the BK comment at least, but still haven't found how to change the cset
author.

If you find out, please tell me. Or anybody else.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-28  8:08                 ` Vojtech Pavlik
@ 2002-07-28  8:29                   ` Brad Hards
  2002-07-28  8:39                     ` Vojtech Pavlik
  2002-07-28  8:51                     ` Russell King
  0 siblings, 2 replies; 15+ messages in thread
From: Brad Hards @ 2002-07-28  8:29 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel, linuxconsole-dev

On Sun, 28 Jul 2002 18:08, Vojtech Pavlik wrote:
> On Sun, Jul 28, 2002 at 05:32:53PM +1000, Brad Hards wrote:
> > "current" is a bad idea. I used curr_value.
> How about just "value" then?
If you want shorter, "curr" would be more understandable.
As you pointed out, all the structure elements are values.
Someone else might have a better name than "curr" though.

> I'm stil fighting with BK to use something else than my e-mail address
> in the changesets. So far I've always put the author of the patch into
> the BK comment at least, but still haven't found how to change the cset
> author.
It depends on an environment variable (see BK hacking howto in the
2.5 tree).
Like you, I am still strugling with BK. Hence the conventional
patches.

> If you find out, please tell me. Or anybody else.
>
> Thanks.
master.kernel.org:/home/torvalds/BK/tools apparently has some
scripts - I don't have access.

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-28  8:29                   ` Brad Hards
@ 2002-07-28  8:39                     ` Vojtech Pavlik
  2002-07-28  8:51                     ` Russell King
  1 sibling, 0 replies; 15+ messages in thread
From: Vojtech Pavlik @ 2002-07-28  8:39 UTC (permalink / raw)
  To: Brad Hards; +Cc: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Sun, Jul 28, 2002 at 06:29:02PM +1000, Brad Hards wrote:
> On Sun, 28 Jul 2002 18:08, Vojtech Pavlik wrote:
> > On Sun, Jul 28, 2002 at 05:32:53PM +1000, Brad Hards wrote:

> > > "current" is a bad idea. I used curr_value.
> > How about just "value" then?
> If you want shorter, "curr" would be more understandable.
> As you pointed out, all the structure elements are values.
> Someone else might have a better name than "curr" though.

I just want it simple.

> > I'm stil fighting with BK to use something else than my e-mail address
> > in the changesets. So far I've always put the author of the patch into
> > the BK comment at least, but still haven't found how to change the cset
> > author.
> It depends on an environment variable (see BK hacking howto in the
> 2.5 tree).

Cool, I've read this in the past, but didn't remember this one.

> Like you, I am still strugling with BK. Hence the conventional
> patches.
> 
> > If you find out, please tell me. Or anybody else.
> >
> > Thanks.
> master.kernel.org:/home/torvalds/BK/tools apparently has some
> scripts - I don't have access.

I don't either. 

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-28  8:29                   ` Brad Hards
  2002-07-28  8:39                     ` Vojtech Pavlik
@ 2002-07-28  8:51                     ` Russell King
  2002-07-28  9:12                       ` Brad Hards
  1 sibling, 1 reply; 15+ messages in thread
From: Russell King @ 2002-07-28  8:51 UTC (permalink / raw)
  To: Brad Hards; +Cc: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Sun, Jul 28, 2002 at 06:29:02PM +1000, Brad Hards wrote:
> master.kernel.org:/home/torvalds/BK/tools apparently has some
> scripts - I don't have access.

http://gkernel.bkbits.net/BK-kernel-tools

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [cset] Add the EVIOCSABS ioctl for X people.
  2002-07-28  8:51                     ` Russell King
@ 2002-07-28  9:12                       ` Brad Hards
  0 siblings, 0 replies; 15+ messages in thread
From: Brad Hards @ 2002-07-28  9:12 UTC (permalink / raw)
  To: Russell King; +Cc: Vojtech Pavlik, linux-kernel, linuxconsole-dev

On Sun, 28 Jul 2002 18:51, Russell King wrote:
> On Sun, Jul 28, 2002 at 06:29:02PM +1000, Brad Hards wrote:
> > master.kernel.org:/home/torvalds/BK/tools apparently has some
> > scripts - I don't have access.
>
> http://gkernel.bkbits.net/BK-kernel-tools
404s for me - seems to need a :8080 in there.

http://gkernel.bkbits.net:8080/BK-kernel-tools/src?nav=index.html

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-07-28  9:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20020725083716.A20717@ucw.cz>
2002-07-25 12:00 ` [cset] Add a input_sync() a method to tell which events belong together Vojtech Pavlik
2002-07-25 12:03   ` Vojtech Pavlik
2002-07-25 12:25     ` [cset] Move ps2serkbd.c functionality into atkbd.c, kill ps2serkbd.c Vojtech Pavlik
2002-07-25 14:11       ` [cset] Fix mouse wheel direction in psmouse.c Vojtech Pavlik
2002-07-25 14:38         ` [cset] Add the EVIOCSABS ioctl for X people Vojtech Pavlik
2002-07-25 14:47           ` Brad Hards
2002-07-25 15:08             ` Vojtech Pavlik
2002-07-28  7:32               ` Brad Hards
2002-07-28  8:08                 ` Vojtech Pavlik
2002-07-28  8:29                   ` Brad Hards
2002-07-28  8:39                     ` Vojtech Pavlik
2002-07-28  8:51                     ` Russell King
2002-07-28  9:12                       ` Brad Hards
2002-07-25 15:12           ` Larry McVoy
2002-07-25 15:23             ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).