From 245bba13bfd84a4687517562943ee3cc5a10a0f1 Mon Sep 17 00:00:00 2001 From: "Yang, Dong" Date: Tue, 31 Mar 2020 09:47:43 +0800 Subject: [PATCH] input: passthrough virtio-input device 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 --- drivers/input/input.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/input/input.c b/drivers/input/input.c index a0d90022fcf73..ea5d0192e6cd5 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -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);