diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-05-08 21:29:27 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-05-08 21:29:27 -0400 |
commit | d585a021c0b10b0477d6b608c53e1feb8cde0507 (patch) | |
tree | 5ca059da1db7f15d4b29427644ad9c08270c885c /Documentation/input | |
parent | 84e5b0d00f8f84c4ae226be131d4bebbcee88bd3 (diff) | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
Merge commit 'v2.6.30-rc5' into next
Diffstat (limited to 'Documentation/input')
-rw-r--r-- | Documentation/input/bcm5974.txt | 65 | ||||
-rw-r--r-- | Documentation/input/multi-touch-protocol.txt | 140 |
2 files changed, 205 insertions, 0 deletions
diff --git a/Documentation/input/bcm5974.txt b/Documentation/input/bcm5974.txt new file mode 100644 index 000000000000..5e22dcf6d48d --- /dev/null +++ b/Documentation/input/bcm5974.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | BCM5974 Driver (bcm5974) | ||
2 | ------------------------ | ||
3 | Copyright (C) 2008-2009 Henrik Rydberg <rydberg@euromail.se> | ||
4 | |||
5 | The USB initialization and package decoding was made by Scott Shawcroft as | ||
6 | part of the touchd user-space driver project: | ||
7 | Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) | ||
8 | |||
9 | The BCM5974 driver is based on the appletouch driver: | ||
10 | Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) | ||
11 | Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) | ||
12 | Copyright (C) 2005 Stelian Pop (stelian@popies.net) | ||
13 | Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) | ||
14 | Copyright (C) 2005 Peter Osterlund (petero2@telia.com) | ||
15 | Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) | ||
16 | Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) | ||
17 | |||
18 | This driver adds support for the multi-touch trackpad on the new Apple | ||
19 | Macbook Air and Macbook Pro laptops. It replaces the appletouch driver on | ||
20 | those computers, and integrates well with the synaptics driver of the Xorg | ||
21 | system. | ||
22 | |||
23 | Known to work on Macbook Air, Macbook Pro Penryn and the new unibody | ||
24 | Macbook 5 and Macbook Pro 5. | ||
25 | |||
26 | Usage | ||
27 | ----- | ||
28 | |||
29 | The driver loads automatically for the supported usb device ids, and | ||
30 | becomes available both as an event device (/dev/input/event*) and as a | ||
31 | mouse via the mousedev driver (/dev/input/mice). | ||
32 | |||
33 | USB Race | ||
34 | -------- | ||
35 | |||
36 | The Apple multi-touch trackpads report both mouse and keyboard events via | ||
37 | different interfaces of the same usb device. This creates a race condition | ||
38 | with the HID driver, which, if not told otherwise, will find the standard | ||
39 | HID mouse and keyboard, and claim the whole device. To remedy, the usb | ||
40 | product id must be listed in the mouse_ignore list of the hid driver. | ||
41 | |||
42 | Debug output | ||
43 | ------------ | ||
44 | |||
45 | To ease the development for new hardware version, verbose packet output can | ||
46 | be switched on with the debug kernel module parameter. The range [1-9] | ||
47 | yields different levels of verbosity. Example (as root): | ||
48 | |||
49 | echo -n 9 > /sys/module/bcm5974/parameters/debug | ||
50 | |||
51 | tail -f /var/log/debug | ||
52 | |||
53 | echo -n 0 > /sys/module/bcm5974/parameters/debug | ||
54 | |||
55 | Trivia | ||
56 | ------ | ||
57 | |||
58 | The driver was developed at the ubuntu forums in June 2008 [1], and now has | ||
59 | a more permanent home at bitmath.org [2]. | ||
60 | |||
61 | Links | ||
62 | ----- | ||
63 | |||
64 | [1] http://ubuntuforums.org/showthread.php?t=840040 | ||
65 | [2] http://http://bitmath.org/code/ | ||
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt new file mode 100644 index 000000000000..9f09557aea39 --- /dev/null +++ b/Documentation/input/multi-touch-protocol.txt | |||
@@ -0,0 +1,140 @@ | |||
1 | Multi-touch (MT) Protocol | ||
2 | ------------------------- | ||
3 | Copyright (C) 2009 Henrik Rydberg <rydberg@euromail.se> | ||
4 | |||
5 | |||
6 | Introduction | ||
7 | ------------ | ||
8 | |||
9 | In order to utilize the full power of the new multi-touch devices, a way to | ||
10 | report detailed finger data to user space is needed. This document | ||
11 | describes the multi-touch (MT) protocol which allows kernel drivers to | ||
12 | report details for an arbitrary number of fingers. | ||
13 | |||
14 | |||
15 | Usage | ||
16 | ----- | ||
17 | |||
18 | Anonymous finger details are sent sequentially as separate packets of ABS | ||
19 | events. Only the ABS_MT events are recognized as part of a finger | ||
20 | packet. The end of a packet is marked by calling the input_mt_sync() | ||
21 | function, which generates a SYN_MT_REPORT event. The end of multi-touch | ||
22 | transfer is marked by calling the usual input_sync() function. | ||
23 | |||
24 | A set of ABS_MT events with the desired properties is defined. The events | ||
25 | are divided into categories, to allow for partial implementation. The | ||
26 | minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and | ||
27 | ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the | ||
28 | device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size | ||
29 | of the approaching finger. Anisotropy and direction may be specified with | ||
30 | ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. Devices with | ||
31 | more granular information may specify general shapes as blobs, i.e., as a | ||
32 | sequence of rectangular shapes grouped together by an | ||
33 | ABS_MT_BLOB_ID. Finally, the ABS_MT_TOOL_TYPE may be used to specify | ||
34 | whether the touching tool is a finger or a pen or something else. | ||
35 | |||
36 | |||
37 | Event Semantics | ||
38 | --------------- | ||
39 | |||
40 | The word "contact" is used to describe a tool which is in direct contact | ||
41 | with the surface. A finger, a pen or a rubber all classify as contacts. | ||
42 | |||
43 | ABS_MT_TOUCH_MAJOR | ||
44 | |||
45 | The length of the major axis of the contact. The length should be given in | ||
46 | surface units. If the surface has an X times Y resolution, the largest | ||
47 | possible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal. | ||
48 | |||
49 | ABS_MT_TOUCH_MINOR | ||
50 | |||
51 | The length, in surface units, of the minor axis of the contact. If the | ||
52 | contact is circular, this event can be omitted. | ||
53 | |||
54 | ABS_MT_WIDTH_MAJOR | ||
55 | |||
56 | The length, in surface units, of the major axis of the approaching | ||
57 | tool. This should be understood as the size of the tool itself. The | ||
58 | orientation of the contact and the approaching tool are assumed to be the | ||
59 | same. | ||
60 | |||
61 | ABS_MT_WIDTH_MINOR | ||
62 | |||
63 | The length, in surface units, of the minor axis of the approaching | ||
64 | tool. Omit if circular. | ||
65 | |||
66 | The above four values can be used to derive additional information about | ||
67 | the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates | ||
68 | the notion of pressure. The fingers of the hand and the palm all have | ||
69 | different characteristic widths [1]. | ||
70 | |||
71 | ABS_MT_ORIENTATION | ||
72 | |||
73 | The orientation of the ellipse. The value should describe half a revolution | ||
74 | clockwise around the touch center. The scale of the value is arbitrary, but | ||
75 | zero should be returned for an ellipse aligned along the Y axis of the | ||
76 | surface. As an example, an index finger placed straight onto the axis could | ||
77 | return zero orientation, something negative when twisted to the left, and | ||
78 | something positive when twisted to the right. This value can be omitted if | ||
79 | the touching object is circular, or if the information is not available in | ||
80 | the kernel driver. | ||
81 | |||
82 | ABS_MT_POSITION_X | ||
83 | |||
84 | The surface X coordinate of the center of the touching ellipse. | ||
85 | |||
86 | ABS_MT_POSITION_Y | ||
87 | |||
88 | The surface Y coordinate of the center of the touching ellipse. | ||
89 | |||
90 | ABS_MT_TOOL_TYPE | ||
91 | |||
92 | The type of approaching tool. A lot of kernel drivers cannot distinguish | ||
93 | between different tool types, such as a finger or a pen. In such cases, the | ||
94 | event should be omitted. The protocol currently supports MT_TOOL_FINGER and | ||
95 | MT_TOOL_PEN [2]. | ||
96 | |||
97 | ABS_MT_BLOB_ID | ||
98 | |||
99 | The BLOB_ID groups several packets together into one arbitrarily shaped | ||
100 | contact. This is a low-level anonymous grouping, and should not be confused | ||
101 | with the high-level contactID, explained below. Most kernel drivers will | ||
102 | not have this capability, and can safely omit the event. | ||
103 | |||
104 | |||
105 | Finger Tracking | ||
106 | --------------- | ||
107 | |||
108 | The kernel driver should generate an arbitrary enumeration of the set of | ||
109 | anonymous contacts currently on the surface. The order in which the packets | ||
110 | appear in the event stream is not important. | ||
111 | |||
112 | The process of finger tracking, i.e., to assign a unique contactID to each | ||
113 | initiated contact on the surface, is left to user space; preferably the | ||
114 | multi-touch X driver [3]. In that driver, the contactID stays the same and | ||
115 | unique until the contact vanishes (when the finger leaves the surface). The | ||
116 | problem of assigning a set of anonymous fingers to a set of identified | ||
117 | fingers is a euclidian bipartite matching problem at each event update, and | ||
118 | relies on a sufficiently rapid update rate. | ||
119 | |||
120 | Notes | ||
121 | ----- | ||
122 | |||
123 | In order to stay compatible with existing applications, the data | ||
124 | reported in a finger packet must not be recognized as single-touch | ||
125 | events. In addition, all finger data must bypass input filtering, | ||
126 | since subsequent events of the same type refer to different fingers. | ||
127 | |||
128 | The first kernel driver to utilize the MT protocol is the bcm5974 driver, | ||
129 | where examples can be found. | ||
130 | |||
131 | [1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the | ||
132 | difference between the contact position and the approaching tool position | ||
133 | could be used to derive tilt. | ||
134 | [2] The list can of course be extended. | ||
135 | [3] The multi-touch X driver is currently in the prototyping stage. At the | ||
136 | time of writing (April 2009), the MT protocol is not yet merged, and the | ||
137 | prototype implements finger matching, basic mouse support and two-finger | ||
138 | scrolling. The project aims at improving the quality of current multi-touch | ||
139 | functionality available in the synaptics X driver, and in addition | ||
140 | implement more advanced gestures. | ||