Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233247
b: refs/heads/master
c: 9ae4345
h: refs/heads/master
i:
  233245: d2c29cc
  233243: 84194ed
  233239: 6967e0d
  233231: 9f70550
  233215: aee49e2
v: v3
  • Loading branch information
Dmitry Torokhov committed Feb 3, 2011
1 parent d53db1b commit c99b83a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ab7b5adfb923978a2cab7bd3fac9ccf7d21cc3f
refs/heads/master: 9ae4345a46bdb148e32a547e89ff29563a11e127
37 changes: 11 additions & 26 deletions trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ static int input_defuzz_abs_event(int value, int old_val, int fuzz)
* dev->event_lock held and interrupts disabled.
*/
static void input_pass_event(struct input_dev *dev,
struct input_handler *src_handler,
unsigned int type, unsigned int code, int value)
{
struct input_handler *handler;
Expand All @@ -95,15 +94,6 @@ static void input_pass_event(struct input_dev *dev,
continue;

handler = handle->handler;

/*
* If this is the handler that injected this
* particular event we want to skip it to avoid
* filters firing again and again.
*/
if (handler == src_handler)
continue;

if (!handler->filter) {
if (filtered)
break;
Expand Down Expand Up @@ -133,7 +123,7 @@ static void input_repeat_key(unsigned long data)
if (test_bit(dev->repeat_key, dev->key) &&
is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) {

input_pass_event(dev, NULL, EV_KEY, dev->repeat_key, 2);
input_pass_event(dev, EV_KEY, dev->repeat_key, 2);

if (dev->sync) {
/*
Expand All @@ -142,7 +132,7 @@ static void input_repeat_key(unsigned long data)
* Otherwise assume that the driver will send
* SYN_REPORT once it's done.
*/
input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1);
input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
}

if (dev->rep[REP_PERIOD])
Expand Down Expand Up @@ -175,7 +165,6 @@ static void input_stop_autorepeat(struct input_dev *dev)
#define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE)

static int input_handle_abs_event(struct input_dev *dev,
struct input_handler *src_handler,
unsigned int code, int *pval)
{
bool is_mt_event;
Expand Down Expand Up @@ -219,15 +208,13 @@ static int input_handle_abs_event(struct input_dev *dev,
/* Flush pending "slot" event */
if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) {
input_abs_set_val(dev, ABS_MT_SLOT, dev->slot);
input_pass_event(dev, src_handler,
EV_ABS, ABS_MT_SLOT, dev->slot);
input_pass_event(dev, EV_ABS, ABS_MT_SLOT, dev->slot);
}

return INPUT_PASS_TO_HANDLERS;
}

static void input_handle_event(struct input_dev *dev,
struct input_handler *src_handler,
unsigned int type, unsigned int code, int value)
{
int disposition = INPUT_IGNORE_EVENT;
Expand Down Expand Up @@ -280,8 +267,7 @@ static void input_handle_event(struct input_dev *dev,

case EV_ABS:
if (is_event_supported(code, dev->absbit, ABS_MAX))
disposition = input_handle_abs_event(dev, src_handler,
code, &value);
disposition = input_handle_abs_event(dev, code, &value);

break;

Expand Down Expand Up @@ -339,7 +325,7 @@ static void input_handle_event(struct input_dev *dev,
dev->event(dev, type, code, value);

if (disposition & INPUT_PASS_TO_HANDLERS)
input_pass_event(dev, src_handler, type, code, value);
input_pass_event(dev, type, code, value);
}

/**
Expand Down Expand Up @@ -368,7 +354,7 @@ void input_event(struct input_dev *dev,

spin_lock_irqsave(&dev->event_lock, flags);
add_input_randomness(type, code, value);
input_handle_event(dev, NULL, type, code, value);
input_handle_event(dev, type, code, value);
spin_unlock_irqrestore(&dev->event_lock, flags);
}
}
Expand Down Expand Up @@ -398,8 +384,7 @@ void input_inject_event(struct input_handle *handle,
rcu_read_lock();
grab = rcu_dereference(dev->grab);
if (!grab || grab == handle)
input_handle_event(dev, handle->handler,
type, code, value);
input_handle_event(dev, type, code, value);
rcu_read_unlock();

spin_unlock_irqrestore(&dev->event_lock, flags);
Expand Down Expand Up @@ -612,10 +597,10 @@ static void input_dev_release_keys(struct input_dev *dev)
for (code = 0; code <= KEY_MAX; code++) {
if (is_event_supported(code, dev->keybit, KEY_MAX) &&
__test_and_clear_bit(code, dev->key)) {
input_pass_event(dev, NULL, EV_KEY, code, 0);
input_pass_event(dev, EV_KEY, code, 0);
}
}
input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1);
input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
}
}

Expand Down Expand Up @@ -890,9 +875,9 @@ int input_set_keycode(struct input_dev *dev,
!is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
__test_and_clear_bit(old_keycode, dev->key)) {

input_pass_event(dev, NULL, EV_KEY, old_keycode, 0);
input_pass_event(dev, EV_KEY, old_keycode, 0);
if (dev->sync)
input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1);
input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
}

out:
Expand Down

0 comments on commit c99b83a

Please sign in to comment.