Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c461b91 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files
parents ef11e701 4f56ce92
Loading
Loading
Loading
Loading
+26 −18
Original line number Original line Diff line number Diff line
Multi-touch (MT) Protocol
Multi-touch (MT) Protocol
-------------------------
-------------------------
	Copyright (C) 2009	Henrik Rydberg <rydberg@euromail.se>
	Copyright (C) 2009-2010	Henrik Rydberg <rydberg@euromail.se>




Introduction
Introduction
@@ -169,12 +169,16 @@ described by adding the MINOR parameters, such that MAJOR and MINOR are the
major and minor axis of an ellipse. Finally, the orientation of the oval
major and minor axis of an ellipse. Finally, the orientation of the oval
shape can be describe with the ORIENTATION parameter.
shape can be describe with the ORIENTATION parameter.


For type A devices, further specification of the touch shape is possible
via ABS_MT_BLOB_ID.

The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
contact or a pen or something else.  Devices with more granular information
finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event
may specify general shapes as blobs, i.e., as a sequence of rectangular
may be used to track identified contacts over time [5].
shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices

that currently support it, the ABS_MT_TRACKING_ID event may be used to
In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are
report contact tracking from hardware [5].
implicitly handled by input core; drivers should instead call
input_mt_report_slot_state().




Event Semantics
Event Semantics
@@ -247,21 +251,24 @@ ABS_MT_TOOL_TYPE
The type of approaching tool. A lot of kernel drivers cannot distinguish
The type of approaching tool. A lot of kernel drivers cannot distinguish
between different tool types, such as a finger or a pen. In such cases, the
between different tool types, such as a finger or a pen. In such cases, the
event should be omitted. The protocol currently supports MT_TOOL_FINGER and
event should be omitted. The protocol currently supports MT_TOOL_FINGER and
MT_TOOL_PEN [2].
MT_TOOL_PEN [2]. For type B devices, this event is handled by input core;
drivers should instead use input_mt_report_slot_state().


ABS_MT_BLOB_ID
ABS_MT_BLOB_ID


The BLOB_ID groups several packets together into one arbitrarily shaped
The BLOB_ID groups several packets together into one arbitrarily shaped
contact. This is a low-level anonymous grouping for type A devices, and
contact. The sequence of points forms a polygon which defines the shape of
the contact. This is a low-level anonymous grouping for type A devices, and
should not be confused with the high-level trackingID [5]. Most type A
should not be confused with the high-level trackingID [5]. Most type A
devices do not have blob capability, so drivers can safely omit this event.
devices do not have blob capability, so drivers can safely omit this event.


ABS_MT_TRACKING_ID
ABS_MT_TRACKING_ID


The TRACKING_ID identifies an initiated contact throughout its life cycle
The TRACKING_ID identifies an initiated contact throughout its life cycle
[5]. This event is mandatory for type B devices. The value range of the
[5]. The value range of the TRACKING_ID should be large enough to ensure
TRACKING_ID should be large enough to ensure unique identification of a
unique identification of a contact maintained over an extended period of
contact maintained over an extended period of time.
time. For type B devices, this event is handled by input core; drivers
should instead use input_mt_report_slot_state().




Event Computation
Event Computation
@@ -308,18 +315,19 @@ and with ORIENTATION, one can detect twisting of fingers.
Notes
Notes
-----
-----


In order to stay compatible with existing applications, the data
In order to stay compatible with existing applications, the data reported
reported in a finger packet must not be recognized as single-touch
in a finger packet must not be recognized as single-touch events.
events. In addition, all finger data must bypass input filtering,

since subsequent events of the same type refer to different fingers.
For type A devices, all finger data bypasses input filtering, since
subsequent events of the same type refer to different fingers.


The first kernel driver to utilize the MT protocol is the bcm5974 driver,
For example usage of the type A protocol, see the bcm5974 driver. For
where examples can be found.
example usage of the type B protocol, see the hid-egalax driver.


[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
[1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the
difference between the contact position and the approaching tool position
difference between the contact position and the approaching tool position
could be used to derive tilt.
could be used to derive tilt.
[2] The list can of course be extended.
[2] The list can of course be extended.
[3] Multitouch X driver project: http://bitmath.org/code/multitouch/.
[3] The mtdev project: http://bitmath.org/code/mtdev/.
[4] See the section on event computation.
[4] See the section on event computation.
[5] See the section on finger tracking.
[5] See the section on finger tracking.
+1 −0
Original line number Original line Diff line number Diff line
@@ -1302,6 +1302,7 @@ static const struct hid_device_id hid_blacklist[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
+2 −0
Original line number Original line Diff line number Diff line
@@ -242,6 +242,8 @@ static const struct hid_device_id egalax_devices[] = {
			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) },
			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4) },
	{ }
	{ }
};
};
MODULE_DEVICE_TABLE(hid, egalax_devices);
MODULE_DEVICE_TABLE(hid, egalax_devices);
+1 −0
Original line number Original line Diff line number Diff line
@@ -198,6 +198,7 @@
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1	0x720c
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1	0x720c
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2	0x72a1
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2	0x72a1
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3	0x480e
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3	0x480e
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4	0x726b


#define USB_VENDOR_ID_ELECOM		0x056e
#define USB_VENDOR_ID_ELECOM		0x056e
#define USB_DEVICE_ID_ELECOM_BM084	0x0061
#define USB_DEVICE_ID_ELECOM_BM084	0x0061
+4 −0
Original line number Original line Diff line number Diff line
@@ -678,6 +678,10 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
#define EVIOC_MASK_SIZE(nr)	((nr) & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT))
#define EVIOC_MASK_SIZE(nr)	((nr) & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT))
	switch (EVIOC_MASK_SIZE(cmd)) {
	switch (EVIOC_MASK_SIZE(cmd)) {


	case EVIOCGPROP(0):
		return bits_to_user(dev->propbit, INPUT_PROP_MAX,
				    size, p, compat_mode);

	case EVIOCGKEY(0):
	case EVIOCGKEY(0):
		return bits_to_user(dev->key, KEY_MAX, size, p, compat_mode);
		return bits_to_user(dev->key, KEY_MAX, size, p, compat_mode);


Loading