Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
input: passthrough virtio-input device
Browse files Browse the repository at this point in the history
The virtio-input device event should be passthrough
and send to uplayer directly, since the events get
from host, and already handled in host input driver.

Tracked-On:
Signed-off-by: Yang, Dong <[email protected]>
  • Loading branch information
dyang23 committed Mar 31, 2020
1 parent c3a0958 commit 245bba1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,20 @@ static void input_handle_event(struct input_dev *dev,
{
int disposition = input_get_disposition(dev, type, code, &value);

if (dev->phys && !strncmp(dev->phys, "virtio", 6)) {
struct input_value *v;
if (!dev->vals)
return;

v = &dev->vals[dev->num_vals++];
v->type = type;
v->code = code;
v->value = value;
input_pass_values(dev, dev->vals, dev->num_vals);
dev->num_vals = 0;
return;
}

if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN)
add_input_randomness(type, code, value);

Expand Down

0 comments on commit 245bba1

Please sign in to comment.