summaryrefslogtreecommitdiff
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorVojtech Pavlik <vojtech@twilight.ucw.cz>2002-07-25 17:56:28 +0200
committerVojtech Pavlik <vojtech@twilight.ucw.cz>2002-07-25 17:56:28 +0200
commit2f39a6688e2e8d4f5fc12487a900b7cd2fc603b4 (patch)
treee253ae74e8f5d4207ad6157236d3659e81e94a6b /drivers/input/input.c
parent252efaf31b375a8b8870ffeee51b2fd1a7dd5d89 (diff)
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.
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 054dee43a95c..6f3d59aafe04 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -72,16 +72,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
{
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 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
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 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
break;
}
-/*
- * Distribute the event to handler modules.
- */
+ if (type != EV_SYN)
+ dev->sync = 0;
while (handle) {
if (handle->open)
@@ -200,6 +205,7 @@ static void input_repeat_key(unsigned long data)
{
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]);
}
@@ -439,6 +445,12 @@ void input_register_device(struct input_dev *dev)
struct input_device_id *id;
/*
+ * Add the EV_SYN capability.
+ */
+
+ set_bit(EV_SYN, dev->evbit);
+
+/*
* Initialize repeat timer to default values.
*/