← Documents Documentation/input/devices/alps.rst GitHub 원문 ↗

Linux 6.18.37 · Input

ALPS Touchpad Protocol

ALPS 터치패드 감지·명령 모드와 프로토콜 v1~v8의 좌표·버튼·멀티터치 패킷을 설명합니다.

Source pathDocumentation/input/devices/alps.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

alps.rst:1-390

ALPS 드라이버는 E6/E7 보고와 명령 모드 응답으로 장치 변형을 식별하고, 프로토콜 버전별 비트 배치로 touchpad와 trackstick 입력을 해석합니다. v3 이후에는 축 비트맵, 조각 조립, 형식 선택, APD 후속 패킷 등 서로 다른 멀티터치 방식이 도입되므로 버전 판정과 패킷 경계를 먼저 검증해야 합니다.

문서 개요
항목내용
SourceDocumentation/input/devices/alps.rst
분량390 source lines
감지E6/E7 report, EC Command Mode
프로토콜PS/2, ALPS v1~v8, DualPoint interleaved
멀티터치v3 bitmap, v4 3-fragment, v7 formats, v8 APD

원문 분량과 핵심 프로토콜 축을 요약합니다.

ALPS 처리 흐름
E6 응답으로 ALPS 장치 확인E7 및 EC 응답으로 모델·프로토콜 판정필요한 레지스터를 Command Mode에서 초기화버전별 패킷 길이와 동기 비트 확인Touchpad·trackstick 좌표와 버튼 분리비트맵·TWO/MULTI/NEW·APD 후속 패킷 결합입력 서브시스템에 위치·압력·접촉 수 보고

장치 감지에서 입력 이벤트 복원까지의 전체 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ----------------------
2 ALPS Touchpad Protocol
3 ----------------------
4
5 Introduction
6 ------------
7 Currently the ALPS touchpad driver supports seven protocol versions in use by
8 ALPS touchpads, called versions 1, 2, 3, 4, 5, 6, 7 and 8.
9
10 Since roughly mid-2010 several new ALPS touchpads have been released and
11 integrated into a variety of laptops and netbooks. These new touchpads
12 have enough behavior differences that the alps_model_data definition
13 table, describing the properties of the different versions, is no longer
14 adequate. The design choices were to re-define the alps_model_data
15 table, with the risk of regression testing existing devices, or isolate
16 the new devices outside of the alps_model_data table. The latter design
17 choice was made. The new touchpad signatures are named: "Rushmore",
18 "Pinnacle", and "Dolphin", which you will see in the alps.c code.
19 For the purposes of this document, this group of ALPS touchpads will
20 generically be called "new ALPS touchpads".
21
22 We experimented with probing the ACPI interface _HID (Hardware ID)/_CID
23 (Compatibility ID) definition as a way to uniquely identify the
24 different ALPS variants but there did not appear to be a 1:1 mapping.
25 In fact, it appeared to be an m:n mapping between the _HID and actual
26 hardware type.
27
28 Detection
29 ---------
30
31 All ALPS touchpads should respond to the "E6 report" command sequence:
32 E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or
33 00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s
34 if some buttons are pressed.
35
36 If the E6 report is successful, the touchpad model is identified using the "E7
37 report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
38 matched against known models in the alps_model_data_array.
39
40 For older touchpads supporting protocol versions 3 and 4, the E7 report
41 model signature is always 73-02-64. To differentiate between these
42 versions, the response from the "Enter Command Mode" sequence must be
43 inspected as described below.
44
45 The new ALPS touchpads have an E7 signature of 73-03-50 or 73-03-0A but
46 seem to be better differentiated by the EC Command Mode response.
47
48 Command Mode
49 ------------
50
51 Protocol versions 3 and 4 have a command mode that is used to read and write
52 one-byte device registers in a 16-bit address space. The command sequence
53 EC-EC-EC-E9 places the device in command mode, and the device will respond
54 with 88-07 followed by a third byte. This third byte can be used to determine
55 whether the devices uses the version 3 or 4 protocol.
56
57 To exit command mode, PSMOUSE_CMD_SETSTREAM (EA) is sent to the touchpad.
58
59 While in command mode, register addresses can be set by first sending a
60 specific command, either EC for v3 devices or F5 for v4 devices. Then the
61 address is sent one nibble at a time, where each nibble is encoded as a
62 command with optional data. This encoding differs slightly between the v3 and
63 v4 protocols.
64
65 Once an address has been set, the addressed register can be read by sending
66 PSMOUSE_CMD_GETINFO (E9). The first two bytes of the response contains the
67 address of the register being read, and the third contains the value of the
68 register. Registers are written by writing the value one nibble at a time
69 using the same encoding used for addresses.
70
71 For the new ALPS touchpads, the EC command is used to enter command
72 mode. The response in the new ALPS touchpads is significantly different,
73 and more important in determining the behavior. This code has been
74 separated from the original alps_model_data table and put in the
75 alps_identify function. For example, there seem to be two hardware init
76 sequences for the "Dolphin" touchpads as determined by the second byte
77 of the EC response.
78
79 Packet Format
80 -------------
81
82 In the following tables, the following notation is used::
83
84 CAPITALS = stick, miniscules = touchpad
85
86 ?'s can have different meanings on different models, such as wheel rotation,
87 extra buttons, stick buttons on a dualpoint, etc.
88
89 PS/2 packet format
90 ------------------
91
92 ::
93
94 byte 0: 0 0 YSGN XSGN 1 M R L
95 byte 1: X7 X6 X5 X4 X3 X2 X1 X0
96 byte 2: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
97
98 Note that the device never signals overflow condition.
99
100 For protocol version 2 devices when the trackpoint is used, and no fingers
101 are on the touchpad, the M R L bits signal the combined status of both the
102 pointingstick and touchpad buttons.
103
104 ALPS Absolute Mode - Protocol Version 1
105 ---------------------------------------
106
107 ::
108
109 byte 0: 1 0 0 0 1 x9 x8 x7
110 byte 1: 0 x6 x5 x4 x3 x2 x1 x0
111 byte 2: 0 ? ? l r ? fin ges
112 byte 3: 0 ? ? ? ? y9 y8 y7
113 byte 4: 0 y6 y5 y4 y3 y2 y1 y0
114 byte 5: 0 z6 z5 z4 z3 z2 z1 z0
115
116 ALPS Absolute Mode - Protocol Version 2
117 ---------------------------------------
118
119 ::
120
121 byte 0: 1 ? ? ? 1 PSM PSR PSL
122 byte 1: 0 x6 x5 x4 x3 x2 x1 x0
123 byte 2: 0 x10 x9 x8 x7 ? fin ges
124 byte 3: 0 y9 y8 y7 1 M R L
125 byte 4: 0 y6 y5 y4 y3 y2 y1 y0
126 byte 5: 0 z6 z5 z4 z3 z2 z1 z0
127
128 Protocol Version 2 DualPoint devices send standard PS/2 mouse packets for
129 the DualPoint Stick. The M, R and L bits signal the combined status of both
130 the pointingstick and touchpad buttons, except for Dell dualpoint devices
131 where the pointingstick buttons get reported separately in the PSM, PSR
132 and PSL bits.
133
134 Dualpoint device -- interleaved packet format
135 ---------------------------------------------
136
137 ::
138
139 byte 0: 1 1 0 0 1 1 1 1
140 byte 1: 0 x6 x5 x4 x3 x2 x1 x0
141 byte 2: 0 x10 x9 x8 x7 0 fin ges
142 byte 3: 0 0 YSGN XSGN 1 1 1 1
143 byte 4: X7 X6 X5 X4 X3 X2 X1 X0
144 byte 5: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
145 byte 6: 0 y9 y8 y7 1 m r l
146 byte 7: 0 y6 y5 y4 y3 y2 y1 y0
147 byte 8: 0 z6 z5 z4 z3 z2 z1 z0
148
149 Devices which use the interleaving format normally send standard PS/2 mouse
150 packets for the DualPoint Stick + ALPS Absolute Mode packets for the
151 touchpad, switching to the interleaved packet format when both the stick and
152 the touchpad are used at the same time.
153
154 ALPS Absolute Mode - Protocol Version 3
155 ---------------------------------------
156
157 ALPS protocol version 3 has three different packet formats. The first two are
158 associated with touchpad events, and the third is associated with trackstick
159 events.
160
161 The first type is the touchpad position packet::
162
163 byte 0: 1 ? x1 x0 1 1 1 1
164 byte 1: 0 x10 x9 x8 x7 x6 x5 x4
165 byte 2: 0 y10 y9 y8 y7 y6 y5 y4
166 byte 3: 0 M R L 1 m r l
167 byte 4: 0 mt x3 x2 y3 y2 y1 y0
168 byte 5: 0 z6 z5 z4 z3 z2 z1 z0
169
170 Note that for some devices the trackstick buttons are reported in this packet,
171 and on others it is reported in the trackstick packets.
172
173 The second packet type contains bitmaps representing the x and y axes. In the
174 bitmaps a given bit is set if there is a finger covering that position on the
175 given axis. Thus the bitmap packet can be used for low-resolution multi-touch
176 data, although finger tracking is not possible. This packet also encodes the
177 number of contacts (f1 and f0 in the table below)::
178
179 byte 0: 1 1 x1 x0 1 1 1 1
180 byte 1: 0 x8 x7 x6 x5 x4 x3 x2
181 byte 2: 0 y7 y6 y5 y4 y3 y2 y1
182 byte 3: 0 y10 y9 y8 1 1 1 1
183 byte 4: 0 x14 x13 x12 x11 x10 x9 y0
184 byte 5: 0 1 ? ? ? ? f1 f0
185
186 This packet only appears after a position packet with the mt bit set, and
187 usually only appears when there are two or more contacts (although
188 occasionally it's seen with only a single contact).
189
190 The final v3 packet type is the trackstick packet::
191
192 byte 0: 1 1 x7 y7 1 1 1 1
193 byte 1: 0 x6 x5 x4 x3 x2 x1 x0
194 byte 2: 0 y6 y5 y4 y3 y2 y1 y0
195 byte 3: 0 1 TP SW 1 M R L
196 byte 4: 0 z6 z5 z4 z3 z2 z1 z0
197 byte 5: 0 0 1 1 1 1 1 1
198
199 TP means Tap SW status when tap processing is enabled or Press status when press
200 processing is enabled. SW means scroll up when 4 buttons are available.
201
202 ALPS Absolute Mode - Protocol Version 4
203 ---------------------------------------
204
205 Protocol version 4 has an 8-byte packet format::
206
207 byte 0: 1 ? x1 x0 1 1 1 1
208 byte 1: 0 x10 x9 x8 x7 x6 x5 x4
209 byte 2: 0 y10 y9 y8 y7 y6 y5 y4
210 byte 3: 0 1 x3 x2 y3 y2 y1 y0
211 byte 4: 0 ? ? ? 1 ? r l
212 byte 5: 0 z6 z5 z4 z3 z2 z1 z0
213 byte 6: bitmap data (described below)
214 byte 7: bitmap data (described below)
215
216 The last two bytes represent a partial bitmap packet, with 3 full packets
217 required to construct a complete bitmap packet. Once assembled, the 6-byte
218 bitmap packet has the following format::
219
220 byte 0: 0 1 x7 x6 x5 x4 x3 x2
221 byte 1: 0 x1 x0 y4 y3 y2 y1 y0
222 byte 2: 0 0 ? x14 x13 x12 x11 x10
223 byte 3: 0 x9 x8 y9 y8 y7 y6 y5
224 byte 4: 0 0 0 0 0 0 0 0
225 byte 5: 0 0 0 0 0 0 0 y10
226
227 There are several things worth noting here.
228
229 1) In the bitmap data, bit 6 of byte 0 serves as a sync byte to
230 identify the first fragment of a bitmap packet.
231
232 2) The bitmaps represent the same data as in the v3 bitmap packets, although
233 the packet layout is different.
234
235 3) There doesn't seem to be a count of the contact points anywhere in the v4
236 protocol packets. Deriving a count of contact points must be done by
237 analyzing the bitmaps.
238
239 4) There is a 3 to 1 ratio of position packets to bitmap packets. Therefore
240 MT position can only be updated for every third ST position update, and
241 the count of contact points can only be updated every third packet as
242 well.
243
244 So far no v4 devices with tracksticks have been encountered.
245
246 ALPS Absolute Mode - Protocol Version 5
247 ---------------------------------------
248 This is basically Protocol Version 3 but with different logic for packet
249 decode. It uses the same alps_process_touchpad_packet_v3 call with a
250 specialized decode_fields function pointer to correctly interpret the
251 packets. This appears to only be used by the Dolphin devices.
252
253 For single-touch, the 6-byte packet format is::
254
255 byte 0: 1 1 0 0 1 0 0 0
256 byte 1: 0 x6 x5 x4 x3 x2 x1 x0
257 byte 2: 0 y6 y5 y4 y3 y2 y1 y0
258 byte 3: 0 M R L 1 m r l
259 byte 4: y10 y9 y8 y7 x10 x9 x8 x7
260 byte 5: 0 z6 z5 z4 z3 z2 z1 z0
261
262 For mt, the format is::
263
264 byte 0: 1 1 1 n3 1 n2 n1 x24
265 byte 1: 1 y7 y6 y5 y4 y3 y2 y1
266 byte 2: ? x2 x1 y12 y11 y10 y9 y8
267 byte 3: 0 x23 x22 x21 x20 x19 x18 x17
268 byte 4: 0 x9 x8 x7 x6 x5 x4 x3
269 byte 5: 0 x16 x15 x14 x13 x12 x11 x10
270
271 ALPS Absolute Mode - Protocol Version 6
272 ---------------------------------------
273
274 For trackstick packet, the format is::
275
276 byte 0: 1 1 1 1 1 1 1 1
277 byte 1: 0 X6 X5 X4 X3 X2 X1 X0
278 byte 2: 0 Y6 Y5 Y4 Y3 Y2 Y1 Y0
279 byte 3: ? Y7 X7 ? ? M R L
280 byte 4: Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
281 byte 5: 0 1 1 1 1 1 1 1
282
283 For touchpad packet, the format is::
284
285 byte 0: 1 1 1 1 1 1 1 1
286 byte 1: 0 0 0 0 x3 x2 x1 x0
287 byte 2: 0 0 0 0 y3 y2 y1 y0
288 byte 3: ? x7 x6 x5 x4 ? r l
289 byte 4: ? y7 y6 y5 y4 ? ? ?
290 byte 5: z7 z6 z5 z4 z3 z2 z1 z0
291
292 (v6 touchpad does not have middle button)
293
294 ALPS Absolute Mode - Protocol Version 7
295 ---------------------------------------
296
297 For trackstick packet, the format is::
298
299 byte 0: 0 1 0 0 1 0 0 0
300 byte 1: 1 1 * * 1 M R L
301 byte 2: X7 1 X5 X4 X3 X2 X1 X0
302 byte 3: Z6 1 Y6 X6 1 Y2 Y1 Y0
303 byte 4: Y7 0 Y5 Y4 Y3 1 1 0
304 byte 5: T&P 0 Z5 Z4 Z3 Z2 Z1 Z0
305
306 For touchpad packet, the format is::
307
308 packet-fmt b7 b6 b5 b4 b3 b2 b1 b0
309 byte 0: TWO & MULTI L 1 R M 1 Y0-2 Y0-1 Y0-0
310 byte 0: NEW L 1 X1-5 1 1 Y0-2 Y0-1 Y0-0
311 byte 1: Y0-10 Y0-9 Y0-8 Y0-7 Y0-6 Y0-5 Y0-4 Y0-3
312 byte 2: X0-11 1 X0-10 X0-9 X0-8 X0-7 X0-6 X0-5
313 byte 3: X1-11 1 X0-4 X0-3 1 X0-2 X0-1 X0-0
314 byte 4: TWO X1-10 TWO X1-9 X1-8 X1-7 X1-6 X1-5 X1-4
315 byte 4: MULTI X1-10 TWO X1-9 X1-8 X1-7 X1-6 Y1-5 1
316 byte 4: NEW X1-10 TWO X1-9 X1-8 X1-7 X1-6 0 0
317 byte 5: TWO & NEW Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 Y1-5 Y1-4
318 byte 5: MULTI Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 F-1 F-0
319
320 L: Left button
321 R / M: Non-clickpads: Right / Middle button
322 Clickpads: When > 2 fingers are down, and some fingers
323 are in the button area, then the 2 coordinates reported
324 are for fingers outside the button area and these report
325 extra fingers being present in the right / left button
326 area. Note these fingers are not added to the F field!
327 so if a TWO packet is received and R = 1 then there are
328 3 fingers down, etc.
329 TWO: 1: Two touches present, byte 0/4/5 are in TWO fmt
330 0: If byte 4 bit 0 is 1, then byte 0/4/5 are in MULTI fmt
331 otherwise byte 0 bit 4 must be set and byte 0/4/5 are
332 in NEW fmt
333 F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ...
334
335
336 ALPS Absolute Mode - Protocol Version 8
337 ---------------------------------------
338
339 Spoken by SS4 (73 03 14) and SS5 (73 03 28) hardware.
340
341 The packet type is given by the APD field, bits 4-5 of byte 3.
342
343 Touchpad packet (APD = 0x2)::
344
345 b7 b6 b5 b4 b3 b2 b1 b0
346 byte 0: SWM SWR SWL 1 1 0 0 X7
347 byte 1: 0 X6 X5 X4 X3 X2 X1 X0
348 byte 2: 0 Y6 Y5 Y4 Y3 Y2 Y1 Y0
349 byte 3: 0 T&P 1 0 1 0 0 Y7
350 byte 4: 0 Z6 Z5 Z4 Z3 Z2 Z1 Z0
351 byte 5: 0 0 0 0 0 0 0 0
352
353 SWM, SWR, SWL: Middle, Right, and Left button states
354
355 Touchpad 1 Finger packet (APD = 0x0)::
356
357 b7 b6 b5 b4 b3 b2 b1 b0
358 byte 0: SWM SWR SWL 1 1 X2 X1 X0
359 byte 1: X9 X8 X7 1 X6 X5 X4 X3
360 byte 2: 0 X11 X10 LFB Y3 Y2 Y1 Y0
361 byte 3: Y5 Y4 0 0 1 TAPF2 TAPF1 TAPF0
362 byte 4: Zv7 Y11 Y10 1 Y9 Y8 Y7 Y6
363 byte 5: Zv6 Zv5 Zv4 0 Zv3 Zv2 Zv1 Zv0
364
365 TAPF: ???
366 LFB: ???
367
368 Touchpad 2 Finger packet (APD = 0x1)::
369
370 b7 b6 b5 b4 b3 b2 b1 b0
371 byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4
372 byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
373 byte 2: AY11 AY10 AY9 CONT AY8 AY7 AY6 AY5
374 byte 3: 0 0 0 1 1 BX6 BX5 BX4
375 byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
376 byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5
377
378 CONT: A 3-or-4 Finger packet is to follow
379
380 Touchpad 3-or-4 Finger packet (APD = 0x3)::
381
382 b7 b6 b5 b4 b3 b2 b1 b0
383 byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4
384 byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
385 byte 2: AY11 AY10 AY9 OVF AY8 AY7 AY6 AY5
386 byte 3: 0 0 1 1 1 BX6 BX5 BX4
387 byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
388 byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5
389
390 OVF: 5th finger detected
391

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

ALPS 프로토콜 계보와 새 장치 분리

1-27

ALPS 터치패드 드라이버는 문서에서 현재 사용 중인 일곱 프로토콜 버전을 지원한다고 설명하면서 버전 1, 2, 3, 4, 5, 6, 7, 8을 열거합니다. 즉 실제 번호 목록에는 여덟 버전이 포함됩니다.

2010년 중반 무렵부터 여러 노트북과 넷북에 통합된 새 ALPS 터치패드는 기존 `alps_model_data` 속성 표만으로 표현하기 어려울 만큼 동작 차이가 커졌습니다. 기존 표를 다시 정의하면 이미 지원하던 장치에 회귀 위험이 생기므로, 새 장치를 표 바깥에서 분리하는 설계를 선택했습니다.

새 터치패드 서명은 `alps.c` 코드에서 `Rushmore`, `Pinnacle`, `Dolphin`으로 불립니다. 이 문서에서는 이 그룹을 통칭해 새 ALPS 터치패드라고 합니다.

ACPI `_HID`(Hardware ID)와 `_CID`(Compatibility ID)로 변형을 고유 식별하는 방법도 시험했지만 실제 하드웨어 유형과 1:1로 대응하지 않았습니다. 관찰된 관계는 `_HID`와 하드웨어 유형 사이의 m:n 대응에 가까웠습니다.

ALPS 프로토콜 계보
범주식별 또는 버전드라이버 처리
기존 프로토콜v1, v2, v3, v4`alps_model_data` 중심
새 프로토콜 계열v5, v6, v7, v8추가 식별·디코드 경로
새 장치 서명Rushmore, Pinnacle, Dolphin`alps.c`에서 별도 취급
ACPI 식별`_HID`, `_CID`하드웨어와 m:n 관계라 단독 식별에 부적합

기존 모델 표와 새 서명 기반 장치의 구분입니다.

새 ALPS 장치 지원 결정
새 터치패드의 동작 차이 확인기존 `alps_model_data` 재정의의 회귀 위험 평가새 서명 기반 장치를 표 밖으로 분리`Rushmore`·`Pinnacle`·`Dolphin` 식별 경로 구현ACPI ID는 m:n 관계이므로 보조 정보로만 사용

회귀 위험을 줄이기 위해 기존 표와 새 장치를 분리한 설계 흐름입니다.

----------------------
ALPS Touchpad Protocol
----------------------

Introduction
------------
Currently the ALPS touchpad driver supports seven protocol versions in use by
ALPS touchpads, called versions 1, 2, 3, 4, 5, 6, 7 and 8.

Since roughly mid-2010 several new ALPS touchpads have been released and
integrated into a variety of laptops and netbooks.  These new touchpads
have enough behavior differences that the alps_model_data definition
table, describing the properties of the different versions, is no longer
adequate.  The design choices were to re-define the alps_model_data
table, with the risk of regression testing existing devices, or isolate
the new devices outside of the alps_model_data table.  The latter design
choice was made.  The new touchpad signatures are named: "Rushmore",
"Pinnacle", and "Dolphin", which you will see in the alps.c code.
For the purposes of this document, this group of ALPS touchpads will
generically be called "new ALPS touchpads".

We experimented with probing the ACPI interface _HID (Hardware ID)/_CID
(Compatibility ID) definition as a way to uniquely identify the
different ALPS variants but there did not appear to be a 1:1 mapping.
In fact, it appeared to be an m:n mapping between the _HID and actual
hardware type.

E6·E7 보고와 프로토콜 식별

28-47

모든 ALPS 터치패드는 `E8-E6-E6-E6-E9` E6 report 명령열에 응답해야 합니다. 버튼을 누르지 않은 상태의 정상 응답은 `00-00-0A` 또는 `00-00-64`이며, 버튼을 누르면 첫 바이트의 비트 0~2 일부가 1이 됩니다.

E6 보고가 성공하면 `E8-E7-E7-E7-E9` E7 report로 모델을 식별합니다. 응답은 모델 서명이며 `alps_model_data_array`의 알려진 모델과 비교합니다.

프로토콜 v3와 v4를 지원하는 구형 터치패드는 E7 서명이 모두 `73-02-64`이므로 E7만으로 구분할 수 없습니다. 아래 명령 모드 진입 응답의 세 번째 바이트를 검사해야 합니다.

새 ALPS 터치패드는 E7 서명 `73-03-50` 또는 `73-03-0A`를 사용하지만, 실제 변형 구분에는 EC 명령 모드 응답이 더 유용합니다.

ALPS 감지 명령과 응답
단계명령열정상 응답·판정
E6 report`E8-E6-E6-E6-E9``00-00-0A` 또는 `00-00-64`; byte0 bits 0-2는 버튼
E7 report`E8-E7-E7-E7-E9``alps_model_data_array`와 모델 서명 비교
구형 v3/v4E7 = `73-02-64`Enter Command Mode의 세 번째 바이트로 구분
새 ALPSE7 = `73-03-50` 또는 `73-03-0A`EC Command Mode 응답으로 세분

존재 확인, 모델 서명, v3/v4 및 새 장치 구분에 쓰는 단계입니다.

ALPS 장치 감지
E6 report로 ALPS 응답 여부 확인버튼 비트와 정상 서명 검증E7 report로 모델 서명 획득알려진 모델 배열과 비교v3/v4 또는 새 서명이면 Command Mode 응답 추가 검사

장치 존재 확인에서 프로토콜 변형 선택까지의 순서입니다.

Detection
---------

All ALPS touchpads should respond to the "E6 report" command sequence:
E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or
00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s
if some buttons are pressed.

If the E6 report is successful, the touchpad model is identified using the "E7
report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
matched against known models in the alps_model_data_array.

For older touchpads supporting protocol versions 3 and 4, the E7 report
model signature is always 73-02-64. To differentiate between these
versions, the response from the "Enter Command Mode" sequence must be
inspected as described below.

The new ALPS touchpads have an E7 signature of 73-03-50 or 73-03-0A but
seem to be better differentiated by the EC Command Mode response.

v3·v4 명령 모드와 레지스터 접근

48-78

프로토콜 v3와 v4에는 16비트 주소 공간의 1바이트 장치 레지스터를 읽고 쓰는 명령 모드가 있습니다. `EC-EC-EC-E9`를 보내면 장치가 명령 모드에 들어가고 `88-07` 뒤에 세 번째 바이트를 응답합니다. 이 세 번째 바이트로 v3와 v4를 구분합니다.

명령 모드를 끝내려면 터치패드에 `PSMOUSE_CMD_SETSTREAM (EA)`를 보냅니다.

명령 모드에서 주소를 설정할 때 v3 장치는 `EC`, v4 장치는 `F5`를 먼저 보냅니다. 이어서 주소를 한 니블씩 전송하며 각 니블은 선택적 데이터를 포함한 명령으로 인코딩됩니다. v3와 v4의 인코딩은 조금 다릅니다.

주소를 설정한 뒤 `PSMOUSE_CMD_GETINFO (E9)`를 보내면 해당 레지스터를 읽습니다. 응답의 처음 두 바이트는 레지스터 주소이고 세 번째 바이트는 값입니다. 레지스터 쓰기도 주소와 같은 인코딩으로 값을 한 니블씩 전송합니다.

새 ALPS 터치패드는 `EC`로 명령 모드에 들어가지만 응답 형식이 기존 장치와 크게 다르고 동작 판정에 더 중요합니다. 이 식별 코드는 기존 `alps_model_data`에서 분리되어 `alps_identify`에 들어 있습니다. 예를 들어 `Dolphin`에는 EC 응답의 두 번째 바이트로 구별되는 두 하드웨어 초기화 순서가 있는 것으로 보입니다.

ALPS 명령 모드 제어
작업v3v4 또는 공통
진입`EC-EC-EC-E9``EC-EC-EC-E9`
진입 응답`88-07-xx`세 번째 바이트로 v3/v4 판정
주소 시작 명령`EC``F5`
주소·값 전송니블 단위 v3 인코딩니블 단위 v4 인코딩
레지스터 읽기`PSMOUSE_CMD_GETINFO (E9)`응답: 주소 2바이트 + 값 1바이트
종료`PSMOUSE_CMD_SETSTREAM (EA)`스트림 모드 복귀

진입·주소 설정·읽기·쓰기·종료 명령을 정리합니다.

레지스터 읽기
`EC-EC-EC-E9`로 명령 모드 진입응답으로 프로토콜 및 새 장치 변형 판정v3는 `EC`, v4는 `F5` 주소 시작 명령16비트 주소를 니블 단위로 인코딩해 전송`E9`로 읽고 주소 2바이트·값 1바이트 확인`EA`로 명령 모드 종료

16비트 주소를 설정하고 1바이트 값을 가져오는 절차입니다.

Command Mode
------------

Protocol versions 3 and 4 have a command mode that is used to read and write
one-byte device registers in a 16-bit address space. The command sequence
EC-EC-EC-E9 places the device in command mode, and the device will respond
with 88-07 followed by a third byte. This third byte can be used to determine
whether the devices uses the version 3 or 4 protocol.

To exit command mode, PSMOUSE_CMD_SETSTREAM (EA) is sent to the touchpad.

While in command mode, register addresses can be set by first sending a
specific command, either EC for v3 devices or F5 for v4 devices. Then the
address is sent one nibble at a time, where each nibble is encoded as a
command with optional data. This encoding differs slightly between the v3 and
v4 protocols.

Once an address has been set, the addressed register can be read by sending
PSMOUSE_CMD_GETINFO (E9). The first two bytes of the response contains the
address of the register being read, and the third contains the value of the
register. Registers are written by writing the value one nibble at a time
using the same encoding used for addresses.

For the new ALPS touchpads, the EC command is used to enter command
mode. The response in the new ALPS touchpads is significantly different,
and more important in determining the behavior.  This code has been
separated from the original alps_model_data table and put in the
alps_identify function.  For example, there seem to be two hardware init
sequences for the "Dolphin" touchpads as determined by the second byte
of the EC response.

비트 표기와 표준 PS/2 패킷

79-103

아래 패킷 표에서 대문자는 pointing stick 필드이고 소문자는 touchpad 필드입니다. `?` 비트는 모델에 따라 휠 회전, 추가 버튼, DualPoint stick 버튼 등 서로 다른 의미를 가질 수 있습니다.

표준 PS/2 3바이트 패킷
Byte/formatb7 → b0
byte 00 0 YSGN XSGN 1 M R L
byte 1X7 X6 X5 X4 X3 X2 X1 X0
byte 2Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0

원문 비트 배치를 바이트별 구조화 표로 다시 그렸습니다.

장치는 overflow 상태를 신호하지 않습니다.

프로토콜 v2 장치에서 trackpoint를 사용하고 터치패드에 손가락이 없으면 M·R·L 비트는 pointing stick과 touchpad 버튼의 결합 상태를 나타냅니다.

패킷 표기 규칙
표기의미
`X`, `Y`, `Z`, `M/R/L`Pointing stick 데이터
`x`, `y`, `z`, `m/r/l`Touchpad 데이터
`?`모델별 휠·추가 버튼·stick 버튼 등
`YSGN`, `XSGN`상대 이동 부호

비트 이름의 대소문자와 특수 표기의 의미입니다.

Packet Format
-------------

In the following tables, the following notation is used::

 CAPITALS = stick, miniscules = touchpad

?'s can have different meanings on different models, such as wheel rotation,
extra buttons, stick buttons on a dualpoint, etc.

PS/2 packet format
------------------

::

 byte 0:  0    0 YSGN XSGN    1    M    R    L
 byte 1: X7   X6   X5   X4   X3   X2   X1   X0
 byte 2: Y7   Y6   Y5   Y4   Y3   Y2   Y1   Y0

Note that the device never signals overflow condition.

For protocol version 2 devices when the trackpoint is used, and no fingers
are on the touchpad, the M R L bits signal the combined status of both the
pointingstick and touchpad buttons.

절대 모드 프로토콜 v1·v2

104-133
ALPS 절대 모드 v1
Byte/formatb7 → b0
byte 01 0 0 0 1 x9 x8 x7
byte 10 x6 x5 x4 x3 x2 x1 x0
byte 20 ? ? l r ? fin ges
byte 30 ? ? ? ? y9 y8 y7
byte 40 y6 y5 y4 y3 y2 y1 y0
byte 50 z6 z5 z4 z3 z2 z1 z0

v1의 6바이트 좌표·버튼·압력 비트 배치입니다.

ALPS 절대 모드 v2
Byte/formatb7 → b0
byte 01 ? ? ? 1 PSM PSR PSL
byte 10 x6 x5 x4 x3 x2 x1 x0
byte 20 x10 x9 x8 x7 ? fin ges
byte 30 y9 y8 y7 1 M R L
byte 40 y6 y5 y4 y3 y2 y1 y0
byte 50 z6 z5 z4 z3 z2 z1 z0

v2의 6바이트 터치패드와 DualPoint 버튼 비트 배치입니다.

프로토콜 v2 DualPoint 장치는 DualPoint stick에 표준 PS/2 마우스 패킷을 사용합니다. 일반적으로 M·R·L은 pointing stick과 touchpad 버튼의 결합 상태입니다.

Dell DualPoint 장치는 예외로 pointing stick 버튼을 PSM·PSR·PSL 비트에 별도로 보고합니다.

v1·v2 필드 차이
항목v1v2
X 좌표x0..x9x0..x10
Y 좌표y0..y9y0..y9
압력z0..z6z0..z6
Stick 버튼모델별 `?`일반 M/R/L 결합, Dell은 PSM/PSR/PSL

좌표 폭과 DualPoint 버튼 보고 방식을 비교합니다.

ALPS Absolute Mode - Protocol Version 1
---------------------------------------

::

 byte 0:  1    0    0    0    1   x9   x8   x7
 byte 1:  0   x6   x5   x4   x3   x2   x1   x0
 byte 2:  0    ?    ?    l    r    ?  fin  ges
 byte 3:  0    ?    ?    ?    ?   y9   y8   y7
 byte 4:  0   y6   y5   y4   y3   y2   y1   y0
 byte 5:  0   z6   z5   z4   z3   z2   z1   z0

ALPS Absolute Mode - Protocol Version 2
---------------------------------------

::

 byte 0:  1    ?    ?    ?    1  PSM  PSR  PSL
 byte 1:  0   x6   x5   x4   x3   x2   x1   x0
 byte 2:  0  x10   x9   x8   x7    ?  fin  ges
 byte 3:  0   y9   y8   y7    1    M    R    L
 byte 4:  0   y6   y5   y4   y3   y2   y1   y0
 byte 5:  0   z6   z5   z4   z3   z2   z1   z0

Protocol Version 2 DualPoint devices send standard PS/2 mouse packets for
the DualPoint Stick. The M, R and L bits signal the combined status of both
the pointingstick and touchpad buttons, except for Dell dualpoint devices
where the pointingstick buttons get reported separately in the PSM, PSR
and PSL bits.

DualPoint 9바이트 인터리브 패킷

134-153
DualPoint 인터리브 패킷
Byte/formatb7 → b0
byte 01 1 0 0 1 1 1 1
byte 10 x6 x5 x4 x3 x2 x1 x0
byte 20 x10 x9 x8 x7 0 fin ges
byte 30 0 YSGN XSGN 1 1 1 1
byte 4X7 X6 X5 X4 X3 X2 X1 X0
byte 5Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
byte 60 y9 y8 y7 1 m r l
byte 70 y6 y5 y4 y3 y2 y1 y0
byte 80 z6 z5 z4 z3 z2 z1 z0

Touchpad 절대 좌표와 pointing stick 상대 이동을 한 9바이트 패킷에 결합합니다.

인터리브 형식을 사용하는 장치는 평소 DualPoint stick에 표준 PS/2 패킷을, touchpad에는 ALPS Absolute Mode 패킷을 따로 보냅니다.

Stick과 touchpad를 동시에 사용할 때만 두 입력을 결합한 인터리브 패킷 형식으로 전환합니다.

DualPoint 패킷 형식 선택
현재 stick과 touchpad 활성 상태 확인Stick만 사용하면 표준 PS/2 패킷Touchpad만 사용하면 ALPS 절대 모드 패킷둘을 동시에 사용하면 9바이트 인터리브 패킷대문자 필드와 소문자 필드를 각 입력 장치로 분리

입력원이 하나인지 둘인지에 따라 패킷을 선택합니다.

Dualpoint device -- interleaved packet format
---------------------------------------------

::

 byte 0:    1    1    0    0    1    1    1    1
 byte 1:    0   x6   x5   x4   x3   x2   x1   x0
 byte 2:    0  x10   x9   x8   x7    0  fin  ges
 byte 3:    0    0 YSGN XSGN    1    1    1    1
 byte 4:   X7   X6   X5   X4   X3   X2   X1   X0
 byte 5:   Y7   Y6   Y5   Y4   Y3   Y2   Y1   Y0
 byte 6:    0   y9   y8   y7    1    m    r    l
 byte 7:    0   y6   y5   y4   y3   y2   y1   y0
 byte 8:    0   z6   z5   z4   z3   z2   z1   z0

Devices which use the interleaving format normally send standard PS/2 mouse
packets for the DualPoint Stick + ALPS Absolute Mode packets for the
touchpad, switching to the interleaved packet format when both the stick and
the touchpad are used at the same time.

프로토콜 v3 위치·비트맵·trackstick 패킷

154-201

프로토콜 v3에는 세 패킷 형식이 있습니다. 앞의 두 형식은 touchpad 이벤트에, 마지막 형식은 trackstick 이벤트에 대응합니다.

ALPS v3 touchpad 위치 패킷
Byte/formatb7 → b0
byte 01 ? x1 x0 1 1 1 1
byte 10 x10 x9 x8 x7 x6 x5 x4
byte 20 y10 y9 y8 y7 y6 y5 y4
byte 30 M R L 1 m r l
byte 40 mt x3 x2 y3 y2 y1 y0
byte 50 z6 z5 z4 z3 z2 z1 z0

단일 위치, 압력, 버튼과 멀티터치 후속 비트 `mt`를 담습니다.

일부 장치는 trackstick 버튼을 이 위치 패킷에 보고하고 다른 장치는 trackstick 패킷에 보고합니다.

ALPS v3 축 비트맵 패킷
Byte/formatb7 → b0
byte 01 1 x1 x0 1 1 1 1
byte 10 x8 x7 x6 x5 x4 x3 x2
byte 20 y7 y6 y5 y4 y3 y2 y1
byte 30 y10 y9 y8 1 1 1 1
byte 40 x14 x13 x12 x11 x10 x9 y0
byte 50 1 ? ? ? ? f1 f0

손가락이 덮은 X·Y 축 위치 비트와 접촉 수 f1:f0를 담습니다.

축 비트맵에서 특정 비트가 1이면 해당 축 위치를 손가락이 덮고 있다는 뜻입니다. 저해상도 멀티터치 데이터는 얻을 수 있지만 개별 손가락 추적은 할 수 없습니다. `f1:f0`는 접촉 수를 인코딩합니다.

비트맵 패킷은 `mt` 비트가 설정된 위치 패킷 뒤에만 나타나며 보통 접촉이 둘 이상일 때 전송됩니다. 간혹 접촉 하나에서도 관찰됩니다.

ALPS v3 trackstick 패킷
Byte/formatb7 → b0
byte 01 1 x7 y7 1 1 1 1
byte 10 x6 x5 x4 x3 x2 x1 x0
byte 20 y6 y5 y4 y3 y2 y1 y0
byte 30 1 TP SW 1 M R L
byte 40 z6 z5 z4 z3 z2 z1 z0
byte 50 0 1 1 1 1 1 1

상대 X·Y, 압력 Z, 버튼과 TP/SW 상태를 담습니다.

TP는 tap 처리를 활성화했을 때 Tap SW 상태, press 처리를 활성화했을 때 Press 상태입니다. SW는 4개 버튼을 제공하는 장치에서 scroll up을 뜻합니다.

v3 멀티터치 보고
Touchpad 위치 패킷 수신`mt` 비트 검사`mt=1`이면 뒤따르는 축 비트맵 수신X·Y 비트맵으로 덮인 축 위치 계산`f1:f0`로 접촉 수 판정개별 손가락 추적 없이 저해상도 멀티터치 보고

위치 패킷과 후속 비트맵을 결합하는 순서입니다.

ALPS Absolute Mode - Protocol Version 3
---------------------------------------

ALPS protocol version 3 has three different packet formats. The first two are
associated with touchpad events, and the third is associated with trackstick
events.

The first type is the touchpad position packet::

 byte 0:    1    ?   x1   x0    1    1    1    1
 byte 1:    0  x10   x9   x8   x7   x6   x5   x4
 byte 2:    0  y10   y9   y8   y7   y6   y5   y4
 byte 3:    0    M    R    L    1    m    r    l
 byte 4:    0   mt   x3   x2   y3   y2   y1   y0
 byte 5:    0   z6   z5   z4   z3   z2   z1   z0

Note that for some devices the trackstick buttons are reported in this packet,
and on others it is reported in the trackstick packets.

The second packet type contains bitmaps representing the x and y axes. In the
bitmaps a given bit is set if there is a finger covering that position on the
given axis. Thus the bitmap packet can be used for low-resolution multi-touch
data, although finger tracking is not possible.  This packet also encodes the
number of contacts (f1 and f0 in the table below)::

 byte 0:    1    1   x1   x0    1    1    1    1
 byte 1:    0   x8   x7   x6   x5   x4   x3   x2
 byte 2:    0   y7   y6   y5   y4   y3   y2   y1
 byte 3:    0  y10   y9   y8    1    1    1    1
 byte 4:    0  x14  x13  x12  x11  x10   x9   y0
 byte 5:    0    1    ?    ?    ?    ?   f1   f0

This packet only appears after a position packet with the mt bit set, and
usually only appears when there are two or more contacts (although
occasionally it's seen with only a single contact).

The final v3 packet type is the trackstick packet::

 byte 0:    1    1   x7   y7    1    1    1    1
 byte 1:    0   x6   x5   x4   x3   x2   x1   x0
 byte 2:    0   y6   y5   y4   y3   y2   y1   y0
 byte 3:    0    1   TP   SW    1    M    R    L
 byte 4:    0   z6   z5   z4   z3   z2   z1   z0
 byte 5:    0    0    1    1    1    1    1    1

TP means Tap SW status when tap processing is enabled or Press status when press
processing is enabled. SW means scroll up when 4 buttons are available.

프로토콜 v4 8바이트 패킷과 3조각 비트맵

202-245
ALPS v4 8바이트 패킷
Byte/formatb7 → b0
byte 01 ? x1 x0 1 1 1 1
byte 10 x10 x9 x8 x7 x6 x5 x4
byte 20 y10 y9 y8 y7 y6 y5 y4
byte 30 1 x3 x2 y3 y2 y1 y0
byte 40 ? ? ? 1 ? r l
byte 50 z6 z5 z4 z3 z2 z1 z0
byte 6bitmap data fragment
byte 7bitmap data fragment

위치 패킷 뒤 2바이트씩 비트맵 조각을 실어 보냅니다.

마지막 두 바이트는 부분 비트맵입니다. 완전한 비트맵을 만들려면 전체 패킷 세 개에서 2바이트씩 모아 6바이트로 조립해야 합니다.

ALPS v4 조립된 6바이트 비트맵
Byte/formatb7 → b0
byte 00 1 x7 x6 x5 x4 x3 x2
byte 10 x1 x0 y4 y3 y2 y1 y0
byte 20 0 ? x14 x13 x12 x11 x10
byte 30 x9 x8 y9 y8 y7 y6 y5
byte 40 0 0 0 0 0 0 0
byte 50 0 0 0 0 0 0 y10

세 위치 패킷의 마지막 두 바이트를 조립한 축 비트맵입니다.

v4 비트맵 해석 규칙
번호규칙
1비트맵 byte0 bit6이 첫 조각을 식별하는 sync bit
2패킷 배치는 다르지만 v3 비트맵과 같은 축 점유 데이터
3접촉 수 필드가 없어 비트맵 분석으로 수를 유도
4Position:bitmap 비율은 3:1; MT 위치와 접촉 수는 매 세 번째 패킷에 갱신

조각 동기화, 데이터 의미, 갱신 비율의 네 핵심 제약입니다.

현재까지 trackstick을 포함한 v4 장치는 발견되지 않았습니다.

v4 비트맵 조립
8바이트 위치 패킷에서 byte6·byte7 추출첫 조각의 byte0 bit6 sync 확인연속 패킷 세 개의 조각을 순서대로 수집6바이트 X·Y 비트맵 조립축 점유 패턴에서 접촉 위치와 수 유도세 번째 ST 갱신마다 MT 결과 갱신

세 위치 패킷에서 완전한 멀티터치 비트맵을 만드는 과정입니다.

ALPS Absolute Mode - Protocol Version 4
---------------------------------------

Protocol version 4 has an 8-byte packet format::

 byte 0:    1    ?   x1   x0    1    1    1    1
 byte 1:    0  x10   x9   x8   x7   x6   x5   x4
 byte 2:    0  y10   y9   y8   y7   y6   y5   y4
 byte 3:    0    1   x3   x2   y3   y2   y1   y0
 byte 4:    0    ?    ?    ?    1    ?    r    l
 byte 5:    0   z6   z5   z4   z3   z2   z1   z0
 byte 6:    bitmap data (described below)
 byte 7:    bitmap data (described below)

The last two bytes represent a partial bitmap packet, with 3 full packets
required to construct a complete bitmap packet.  Once assembled, the 6-byte
bitmap packet has the following format::

 byte 0:    0    1   x7   x6   x5   x4   x3   x2
 byte 1:    0   x1   x0   y4   y3   y2   y1   y0
 byte 2:    0    0    ?  x14  x13  x12  x11  x10
 byte 3:    0   x9   x8   y9   y8   y7   y6   y5
 byte 4:    0    0    0    0    0    0    0    0
 byte 5:    0    0    0    0    0    0    0  y10

There are several things worth noting here.

 1) In the bitmap data, bit 6 of byte 0 serves as a sync byte to
    identify the first fragment of a bitmap packet.

 2) The bitmaps represent the same data as in the v3 bitmap packets, although
    the packet layout is different.

 3) There doesn't seem to be a count of the contact points anywhere in the v4
    protocol packets. Deriving a count of contact points must be done by
    analyzing the bitmaps.

 4) There is a 3 to 1 ratio of position packets to bitmap packets. Therefore
    MT position can only be updated for every third ST position update, and
    the count of contact points can only be updated every third packet as
    well.

So far no v4 devices with tracksticks have been encountered.

프로토콜 v5 Dolphin 단일·멀티터치

246-270

프로토콜 v5는 기본적으로 v3와 같지만 패킷 디코드 논리가 다릅니다. `alps_process_touchpad_packet_v3` 호출을 그대로 사용하되 특수 `decode_fields` 함수 포인터로 필드를 올바르게 해석합니다. 이 형식은 Dolphin 장치에서만 쓰이는 것으로 보입니다.

ALPS v5 단일 터치
Byte/formatb7 → b0
byte 01 1 0 0 1 0 0 0
byte 10 x6 x5 x4 x3 x2 x1 x0
byte 20 y6 y5 y4 y3 y2 y1 y0
byte 30 M R L 1 m r l
byte 4y10 y9 y8 y7 x10 x9 x8 x7
byte 50 z6 z5 z4 z3 z2 z1 z0

Dolphin 단일 터치의 6바이트 좌표·버튼·압력 배치입니다.

ALPS v5 멀티터치
Byte/formatb7 → b0
byte 01 1 1 n3 1 n2 n1 x24
byte 11 y7 y6 y5 y4 y3 y2 y1
byte 2? x2 x1 y12 y11 y10 y9 y8
byte 30 x23 x22 x21 x20 x19 x18 x17
byte 40 x9 x8 x7 x6 x5 x4 x3
byte 50 x16 x15 x14 x13 x12 x11 x10

Dolphin 멀티터치의 n 비트와 확장 X·Y 축 비트 배치입니다.

v5 디코드 경로
요소역할
`alps_process_touchpad_packet_v3`공통 v3 계열 처리
`decode_fields`v5 비트 배치를 Dolphin 좌표로 해석
Single-touch formatx0..x10, y0..y10, z0..z6
Multi-touch format확장 X·Y 및 n 비트

v3 공통 처리와 Dolphin 전용 필드 해석의 역할을 구분합니다.

ALPS Absolute Mode - Protocol Version 5
---------------------------------------
This is basically Protocol Version 3 but with different logic for packet
decode.  It uses the same alps_process_touchpad_packet_v3 call with a
specialized decode_fields function pointer to correctly interpret the
packets.  This appears to only be used by the Dolphin devices.

For single-touch, the 6-byte packet format is::

 byte 0:    1    1    0    0    1    0    0    0
 byte 1:    0   x6   x5   x4   x3   x2   x1   x0
 byte 2:    0   y6   y5   y4   y3   y2   y1   y0
 byte 3:    0    M    R    L    1    m    r    l
 byte 4:   y10  y9   y8   y7  x10   x9   x8   x7
 byte 5:    0   z6   z5   z4   z3   z2   z1   z0

For mt, the format is::

 byte 0:    1    1    1    n3   1   n2   n1   x24
 byte 1:    1   y7   y6    y5  y4   y3   y2    y1
 byte 2:    ?   x2   x1   y12 y11  y10   y9    y8
 byte 3:    0  x23  x22   x21 x20  x19  x18   x17
 byte 4:    0   x9   x8    x7  x6   x5   x4    x3
 byte 5:    0  x16  x15   x14 x13  x12  x11   x10

프로토콜 v6 trackstick·touchpad

271-293
ALPS v6 trackstick
Byte/formatb7 → b0
byte 01 1 1 1 1 1 1 1
byte 10 X6 X5 X4 X3 X2 X1 X0
byte 20 Y6 Y5 Y4 Y3 Y2 Y1 Y0
byte 3? Y7 X7 ? ? M R L
byte 4Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
byte 50 1 1 1 1 1 1 1

대문자 X·Y·Z와 M/R/L 버튼의 6바이트 배치입니다.

ALPS v6 touchpad
Byte/formatb7 → b0
byte 01 1 1 1 1 1 1 1
byte 10 0 0 0 x3 x2 x1 x0
byte 20 0 0 0 y3 y2 y1 y0
byte 3? x7 x6 x5 x4 ? r l
byte 4? y7 y6 y5 y4 ? ? ?
byte 5z7 z6 z5 z4 z3 z2 z1 z0

소문자 X·Y·Z와 좌우 버튼의 6바이트 배치입니다.

v6 touchpad에는 가운데 버튼이 없습니다. Trackstick 패킷에는 M·R·L이 있지만 touchpad 패킷은 r·l만 명시합니다.

v6 입력원 구분
입력원좌표·압력버튼
TrackstickX0..X7, Y0..Y7, Z0..Z7M, R, L
Touchpadx0..x7, y0..y7, z0..z7r, l; middle 없음

같은 선두 바이트를 쓰는 두 패킷의 필드 대소문자와 버튼 차이입니다.

ALPS Absolute Mode - Protocol Version 6
---------------------------------------

For trackstick packet, the format is::

 byte 0:    1    1    1    1    1    1    1    1
 byte 1:    0   X6   X5   X4   X3   X2   X1   X0
 byte 2:    0   Y6   Y5   Y4   Y3   Y2   Y1   Y0
 byte 3:    ?   Y7   X7    ?    ?    M    R    L
 byte 4:   Z7   Z6   Z5   Z4   Z3   Z2   Z1   Z0
 byte 5:    0    1    1    1    1    1    1    1

For touchpad packet, the format is::

 byte 0:    1    1    1    1    1    1    1    1
 byte 1:    0    0    0    0   x3   x2   x1   x0
 byte 2:    0    0    0    0   y3   y2   y1   y0
 byte 3:    ?   x7   x6   x5   x4    ?    r    l
 byte 4:    ?   y7   y6   y5   y4    ?    ?    ?
 byte 5:   z7   z6   z5   z4   z3   z2   z1   z0

(v6 touchpad does not have middle button)

프로토콜 v7 TWO·MULTI·NEW 형식

294-335
ALPS v7 trackstick
Byte/formatb7 → b0
byte 00 1 0 0 1 0 0 0
byte 11 1 * * 1 M R L
byte 2X7 1 X5 X4 X3 X2 X1 X0
byte 3Z6 1 Y6 X6 1 Y2 Y1 Y0
byte 4Y7 0 Y5 Y4 Y3 1 1 0
byte 5T&P 0 Z5 Z4 Z3 Z2 Z1 Z0

v7 trackstick의 X·Y·Z, 버튼 및 T&P 비트입니다.

ALPS v7 touchpad 형식별 비트
Byte/formatb7 → b0
byte 0 TWO & MULTIL 1 R M 1 Y0-2 Y0-1 Y0-0
byte 0 NEWL 1 X1-5 1 1 Y0-2 Y0-1 Y0-0
byte 1Y0-10 Y0-9 Y0-8 Y0-7 Y0-6 Y0-5 Y0-4 Y0-3
byte 2X0-11 1 X0-10 X0-9 X0-8 X0-7 X0-6 X0-5
byte 3X1-11 1 X0-4 X0-3 1 X0-2 X0-1 X0-0
byte 4 TWOX1-10 TWO X1-9 X1-8 X1-7 X1-6 X1-5 X1-4
byte 4 MULTIX1-10 TWO X1-9 X1-8 X1-7 X1-6 Y1-5 1
byte 4 NEWX1-10 TWO X1-9 X1-8 X1-7 X1-6 0 0
byte 5 TWO & NEWY1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 Y1-5 Y1-4
byte 5 MULTIY1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 F-1 F-0

TWO, MULTI, NEW에 따라 달라지는 byte0·4·5를 포함한 전체 행입니다.

L은 왼쪽 버튼입니다. 비클릭패드의 R/M은 오른쪽·가운데 버튼입니다. 클릭패드에서 손가락이 2개보다 많고 일부가 버튼 영역에 있으면 보고되는 두 좌표는 버튼 영역 바깥 손가락이고 R/L은 버튼 영역의 추가 손가락 존재를 나타냅니다.

버튼 영역의 추가 손가락은 F 필드에 더하지 않습니다. 따라서 TWO 패킷에서 `R=1`이면 실제로 손가락 세 개가 내려가 있는 식입니다.

`TWO=1`이면 두 접촉이 있으며 byte0·4·5는 TWO 형식입니다. `TWO=0`일 때 byte4 bit0이 1이면 MULTI 형식이고, 아니면 byte0 bit4가 설정되어야 하며 NEW 형식입니다.

F는 손가락 수에서 3을 뺀 값입니다. F=0은 손가락 3개, F=1은 4개를 뜻합니다.

v7 touchpad 형식 선택
조건형식접촉 해석
`TWO=1`TWO두 좌표; R/L은 버튼 영역 추가 손가락 가능
`TWO=0`, byte4 bit0=1MULTIF+3개의 손가락
`TWO=0`, byte4 bit0=0, byte0 bit4=1NEW새 좌표 형식

TWO 비트와 byte4 bit0으로 패킷 변형을 결정합니다.

v7 패킷 디코드
Byte4의 TWO 비트 확인`TWO=1`이면 TWO 행으로 byte0·4·5 해석`TWO=0`이면 byte4 bit0으로 MULTI/NEW 선택MULTI에서는 F+3으로 손가락 수 계산클릭패드 R/L을 버튼 영역 추가 손가락으로 반영추가 버튼 영역 손가락은 F에 중복 합산하지 않음

형식 선택과 클릭패드 추가 손가락 계산 순서입니다.

ALPS Absolute Mode - Protocol Version 7
---------------------------------------

For trackstick packet, the format is::

 byte 0:    0    1    0    0    1    0    0    0
 byte 1:    1    1    *    *    1    M    R    L
 byte 2:   X7    1   X5   X4   X3   X2   X1   X0
 byte 3:   Z6    1   Y6   X6    1   Y2   Y1   Y0
 byte 4:   Y7    0   Y5   Y4   Y3    1    1    0
 byte 5:  T&P    0   Z5   Z4   Z3   Z2   Z1   Z0

For touchpad packet, the format is::

         packet-fmt     b7     b6     b5     b4     b3     b2     b1     b0
 byte 0: TWO & MULTI     L      1      R      M      1   Y0-2   Y0-1   Y0-0
 byte 0: NEW             L      1   X1-5      1      1   Y0-2   Y0-1   Y0-0
 byte 1:             Y0-10   Y0-9   Y0-8   Y0-7   Y0-6   Y0-5   Y0-4   Y0-3
 byte 2:             X0-11      1  X0-10   X0-9   X0-8   X0-7   X0-6   X0-5
 byte 3:             X1-11      1   X0-4   X0-3      1   X0-2   X0-1   X0-0
 byte 4: TWO         X1-10    TWO   X1-9   X1-8   X1-7   X1-6   X1-5   X1-4
 byte 4: MULTI       X1-10    TWO   X1-9   X1-8   X1-7   X1-6   Y1-5      1
 byte 4: NEW         X1-10    TWO   X1-9   X1-8   X1-7   X1-6      0      0
 byte 5: TWO & NEW   Y1-10      0   Y1-9   Y1-8   Y1-7   Y1-6   Y1-5   Y1-4
 byte 5: MULTI       Y1-10      0   Y1-9   Y1-8   Y1-7   Y1-6    F-1    F-0

 L:         Left button
 R / M:     Non-clickpads: Right / Middle button
            Clickpads: When > 2 fingers are down, and some fingers
            are in the button area, then the 2 coordinates reported
            are for fingers outside the button area and these report
            extra fingers being present in the right / left button
            area. Note these fingers are not added to the F field!
            so if a TWO packet is received and R = 1 then there are
            3 fingers down, etc.
 TWO:       1: Two touches present, byte 0/4/5 are in TWO fmt
            0: If byte 4 bit 0 is 1, then byte 0/4/5 are in MULTI fmt
               otherwise byte 0 bit 4 must be set and byte 0/4/5 are
               in NEW fmt
 F:         Number of fingers - 3, 0 means 3 fingers, 1 means 4 ...

프로토콜 v8 APD별 손가락 패킷

336-390

프로토콜 v8은 SS4(`73 03 14`)와 SS5(`73 03 28`) 하드웨어가 사용합니다. 패킷 유형은 byte3의 비트 4~5인 APD 필드로 결정합니다.

ALPS v8 touchpad APD=0x2
Byte/formatb7 → b0
byte 0SWM SWR SWL 1 1 0 0 X7
byte 10 X6 X5 X4 X3 X2 X1 X0
byte 20 Y6 Y5 Y4 Y3 Y2 Y1 Y0
byte 30 T&P 1 0 1 0 0 Y7
byte 40 Z6 Z5 Z4 Z3 Z2 Z1 Z0
byte 50 0 0 0 0 0 0 0

기본 touchpad 좌표·압력과 SWM/SWR/SWL 버튼 상태입니다.

SWM, SWR, SWL은 각각 가운데, 오른쪽, 왼쪽 버튼 상태입니다.

ALPS v8 한 손가락 APD=0x0
Byte/formatb7 → b0
byte 0SWM SWR SWL 1 1 X2 X1 X0
byte 1X9 X8 X7 1 X6 X5 X4 X3
byte 20 X11 X10 LFB Y3 Y2 Y1 Y0
byte 3Y5 Y4 0 0 1 TAPF2 TAPF1 TAPF0
byte 4Zv7 Y11 Y10 1 Y9 Y8 Y7 Y6
byte 5Zv6 Zv5 Zv4 0 Zv3 Zv2 Zv1 Zv0

12비트 X·Y, Zv, TAPF와 의미 미확정 LFB를 담습니다.

문서에서는 TAPF와 LFB의 의미를 `???`로 남겨 두어 아직 확정하지 않습니다.

ALPS v8 두 손가락 APD=0x1
Byte/formatb7 → b0
byte 0SWM SWR SWL 1 1 AX6 AX5 AX4
byte 1AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
byte 2AY11 AY10 AY9 CONT AY8 AY7 AY6 AY5
byte 30 0 0 1 1 BX6 BX5 BX4
byte 4BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
byte 5BY11 BY10 BY9 0 BY8 BY7 BY5 BY5

접촉 A와 B의 좌표·압력 및 후속 패킷 표시 CONT를 담습니다.

`CONT=1`이면 3개 또는 4개 손가락 패킷이 뒤따릅니다.

ALPS v8 세·네 손가락 APD=0x3
Byte/formatb7 → b0
byte 0SWM SWR SWL 1 1 AX6 AX5 AX4
byte 1AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0
byte 2AY11 AY10 AY9 OVF AY8 AY7 AY6 AY5
byte 30 0 1 1 1 BX6 BX5 BX4
byte 4BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0
byte 5BY11 BY10 BY9 0 BY8 BY7 BY5 BY5

추가 접촉 보고와 다섯 번째 손가락 검출 OVF를 담습니다.

`OVF=1`은 다섯 번째 손가락이 검출되었음을 뜻합니다. 원문 byte5의 마지막 두 필드는 모두 `BY5`로 표기되어 있으며 이 번역에서도 원문 좌표를 그대로 보존합니다.

v8 APD 패킷 선택
APD패킷특수 필드
`0x0`Touchpad 1 FingerTAPF, LFB (의미 미확정)
`0x1`Touchpad 2 FingerCONT: 3/4손가락 후속 패킷
`0x2`기본 TouchpadT&P, SWM/SWR/SWL
`0x3`Touchpad 3-or-4 FingerOVF: 다섯 번째 손가락

Byte3 bits 4-5의 APD 값과 패킷 목적을 대응시킵니다.

v8 멀티패킷 접촉 보고
Byte3 bits 4-5에서 APD 추출`APD=0x0`이면 한 손가락 좌표 해석`APD=0x1`이면 두 접촉 A/B 해석`CONT=1`이면 뒤따르는 `APD=0x3` 패킷 대기`APD=0x3`에서 3·4손가락 정보 결합`OVF=1`이면 다섯 번째 손가락 존재 보고

APD 값과 CONT·OVF를 사용해 손가락 수를 확장하는 흐름입니다.

ALPS Absolute Mode - Protocol Version 8
---------------------------------------

Spoken by SS4 (73 03 14) and SS5 (73 03 28) hardware.

The packet type is given by the APD field, bits 4-5 of byte 3.

Touchpad packet (APD = 0x2)::

           b7   b6   b5   b4   b3   b2   b1   b0
 byte 0:  SWM  SWR  SWL    1    1    0    0   X7
 byte 1:    0   X6   X5   X4   X3   X2   X1   X0
 byte 2:    0   Y6   Y5   Y4   Y3   Y2   Y1   Y0
 byte 3:    0  T&P    1    0    1    0    0   Y7
 byte 4:    0   Z6   Z5   Z4   Z3   Z2   Z1   Z0
 byte 5:    0    0    0    0    0    0    0    0

SWM, SWR, SWL: Middle, Right, and Left button states

Touchpad 1 Finger packet (APD = 0x0)::

           b7   b6   b5   b4   b3   b2   b1   b0
 byte 0:  SWM  SWR  SWL    1    1   X2   X1   X0
 byte 1:   X9   X8   X7    1   X6   X5   X4   X3
 byte 2:    0  X11  X10  LFB   Y3   Y2   Y1   Y0
 byte 3:   Y5   Y4    0    0    1 TAPF2 TAPF1 TAPF0
 byte 4:  Zv7  Y11  Y10    1   Y9   Y8   Y7   Y6
 byte 5:  Zv6  Zv5  Zv4    0  Zv3  Zv2  Zv1  Zv0

TAPF: ???
LFB:  ???

Touchpad 2 Finger packet (APD = 0x1)::

           b7   b6   b5   b4   b3   b2   b1   b0
 byte 0:  SWM  SWR  SWL    1    1  AX6  AX5  AX4
 byte 1: AX11 AX10  AX9  AX8  AX7  AZ1  AY4  AZ0
 byte 2: AY11 AY10  AY9  CONT AY8  AY7  AY6  AY5
 byte 3:    0    0    0    1    1  BX6  BX5  BX4
 byte 4: BX11 BX10  BX9  BX8  BX7  BZ1  BY4  BZ0
 byte 5: BY11 BY10  BY9    0  BY8  BY7  BY5  BY5

CONT: A 3-or-4 Finger packet is to follow

Touchpad 3-or-4 Finger packet (APD = 0x3)::

           b7   b6   b5   b4   b3   b2   b1   b0
 byte 0:  SWM  SWR  SWL    1    1  AX6  AX5  AX4
 byte 1: AX11 AX10  AX9  AX8  AX7  AZ1  AY4  AZ0
 byte 2: AY11 AY10  AY9  OVF  AY8  AY7  AY6  AY5
 byte 3:    0    0    1    1    1  BX6  BX5  BX4
 byte 4: BX11 BX10  BX9  BX8  BX7  BZ1  BY4  BZ0
 byte 5: BY11 BY10  BY9    0  BY8  BY7  BY5  BY5

OVF: 5th finger detected