Skip to content

Commit

Permalink
Input: allow certain EV_ABS events to bypass all filtering
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henrik Rydberg authored and Dmitry Torokhov committed Apr 28, 2009
1 parent 4c57e37 commit 61994a6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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]);

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 61994a6

Please sign in to comment.