Input: allow certain EV_ABS events to bypass all filtering

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Saturday, May 2, 2009 - 5:01 pm

Gitweb:     http://git.kernel.org/linus/61994a61bcedf328cb1d6e96c393fc91ce64563d
Commit:     61994a61bcedf328cb1d6e96c393fc91ce64563d
Parent:     4c57e379f4e318847dd06f60c7e1ff4d8bde1bdb
Author:     Henrik Rydberg <rydberg@euromail.se>
AuthorDate: Tue Apr 28 07:45:31 2009 -0700
Committer:  Dmitry Torokhov <dmitry.torokhov@gmail.com>
CommitDate: Tue Apr 28 09:36:16 2009 -0700

    Input: allow certain EV_ABS events to bypass all filtering
    
    With the upcoming multi-touch interface as an example, there is
    a need to make certain that all reported events actually get passed
    to the event handler. This patch equips the input core with the
    ability to bypass all filtering for certain EV_ABS events.
    
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/input/input.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 935a183..8ff92aa 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -29,6 +29,14 @@ MODULE_LICENSE("GPL");
 
 #define INPUT_DEVICES	256
 
+/*
+ * EV_ABS events which should not be cached are listed here.
+ */
+static unsigned int input_abs_bypass_init_data[] __initdata = {
+	0
+};
+static unsigned long input_abs_bypass[BITS_TO_LONGS(ABS_CNT)];
+
 static LIST_HEAD(input_dev_list);
 static LIST_HEAD(input_handler_list);
 
@@ -192,6 +200,11 @@ static void input_handle_event(struct input_dev *dev,
 	case EV_ABS:
 		if (is_event_supported(code, dev->absbit, ABS_MAX)) {
 
+			if (test_bit(code, input_abs_bypass)) {
+				disposition = INPUT_PASS_TO_HANDLERS;
+				break;
+			}
+
 			value = input_defuzz_abs_event(value,
 					dev->abs[code], dev->absfuzz[code]);
 
@@ -1634,10 +1647,20 @@ static const struct file_operations input_fops = {
 	.open = input_open_file,
 };
 
+static void __init input_init_abs_bypass(void)
+{
+	const unsigned int *p;
+
+	for (p = input_abs_bypass_init_data; *p; p++)
+		input_abs_bypass[BIT_WORD(*p)] |= BIT_MASK(*p);
+}
+
 static int __init input_init(void)
 {
 	int err;
 
+	input_init_abs_bypass();
+
 	err = class_register(&input_class);
 	if (err) {
 		printk(KERN_ERR "input: unable to register input_dev class\n");
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Input: allow certain EV_ABS events to bypass all filtering, Linux Kernel Mailing ..., (Sat May 2, 5:01 pm)