@@ -111,6 +111,17 @@ config VIRTIO_INPUT
If unsure, say M.
+config VIRTIO_INPUT_MULTITOUCH_SLOTS
+ depends on VIRTIO_INPUT
+ int "Number of multitouch slots"
+ range 0 64
+ default 10
+ help
+ Define the number of multitouch slots used. Default to 10.
+ This parameter is unused if there is no multitouch capability.
+
+ 0 will disable the feature.
+
config VIRTIO_MMIO
tristate "Platform bus driver for memory mapped virtio devices"
depends on HAS_IOMEM && HAS_DMA
@@ -7,6 +7,7 @@
#include <uapi/linux/virtio_ids.h>
#include <uapi/linux/virtio_input.h>
+#include <linux/input/mt.h>
struct virtio_input {
struct virtio_device *vdev;
@@ -205,6 +206,7 @@ static int virtinput_probe(struct virtio_device *vdev)
unsigned long flags;
size_t size;
int abs, err;
+ bool is_mt = false;
if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
return -ENODEV;
@@ -287,9 +289,15 @@ static int virtinput_probe(struct virtio_device *vdev)
for (abs = 0; abs < ABS_CNT; abs++) {
if (!test_bit(abs, vi->idev->absbit))
continue;
+ if (input_is_mt_value(abs))
+ is_mt = true;
virtinput_cfg_abs(vi, abs);
}
}
+ if (is_mt)
+ input_mt_init_slots(vi->idev,
+ CONFIG_VIRTIO_INPUT_MULTITOUCH_SLOTS,
+ INPUT_MT_DIRECT);
virtio_device_ready(vdev);
vi->ready = true;