요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
----------------------
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.
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.
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.
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.
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 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.
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.
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.
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
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)
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 ...
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
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ALPS 프로토콜 계보와 새 장치 분리
1-27ALPS 터치패드 드라이버는 문서에서 현재 사용 중인 일곱 프로토콜 버전을 지원한다고 설명하면서 버전 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 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 명령 모드 응답이 더 유용합니다.
존재 확인, 모델 서명, v3/v4 및 새 장치 구분에 쓰는 단계입니다.
장치 존재 확인에서 프로토콜 변형 선택까지의 순서입니다.
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 응답의 두 번째 바이트로 구별되는 두 하드웨어 초기화 순서가 있는 것으로 보입니다.
진입·주소 설정·읽기·쓰기·종료 명령을 정리합니다.
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 버튼 등 서로 다른 의미를 가질 수 있습니다.
원문 비트 배치를 바이트별 구조화 표로 다시 그렸습니다.
장치는 overflow 상태를 신호하지 않습니다.
프로토콜 v2 장치에서 trackpoint를 사용하고 터치패드에 손가락이 없으면 M·R·L 비트는 pointing stick과 touchpad 버튼의 결합 상태를 나타냅니다.
비트 이름의 대소문자와 특수 표기의 의미입니다.
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-133v1의 6바이트 좌표·버튼·압력 비트 배치입니다.
v2의 6바이트 터치패드와 DualPoint 버튼 비트 배치입니다.
프로토콜 v2 DualPoint 장치는 DualPoint stick에 표준 PS/2 마우스 패킷을 사용합니다. 일반적으로 M·R·L은 pointing stick과 touchpad 버튼의 결합 상태입니다.
Dell DualPoint 장치는 예외로 pointing stick 버튼을 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-153Touchpad 절대 좌표와 pointing stick 상대 이동을 한 9바이트 패킷에 결합합니다.
인터리브 형식을 사용하는 장치는 평소 DualPoint stick에 표준 PS/2 패킷을, touchpad에는 ALPS Absolute Mode 패킷을 따로 보냅니다.
Stick과 touchpad를 동시에 사용할 때만 두 입력을 결합한 인터리브 패킷 형식으로 전환합니다.
입력원이 하나인지 둘인지에 따라 패킷을 선택합니다.
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 이벤트에 대응합니다.
단일 위치, 압력, 버튼과 멀티터치 후속 비트 `mt`를 담습니다.
일부 장치는 trackstick 버튼을 이 위치 패킷에 보고하고 다른 장치는 trackstick 패킷에 보고합니다.
손가락이 덮은 X·Y 축 위치 비트와 접촉 수 f1:f0를 담습니다.
축 비트맵에서 특정 비트가 1이면 해당 축 위치를 손가락이 덮고 있다는 뜻입니다. 저해상도 멀티터치 데이터는 얻을 수 있지만 개별 손가락 추적은 할 수 없습니다. `f1:f0`는 접촉 수를 인코딩합니다.
비트맵 패킷은 `mt` 비트가 설정된 위치 패킷 뒤에만 나타나며 보통 접촉이 둘 이상일 때 전송됩니다. 간혹 접촉 하나에서도 관찰됩니다.
상대 X·Y, 압력 Z, 버튼과 TP/SW 상태를 담습니다.
TP는 tap 처리를 활성화했을 때 Tap SW 상태, press 처리를 활성화했을 때 Press 상태입니다. SW는 4개 버튼을 제공하는 장치에서 scroll up을 뜻합니다.
위치 패킷과 후속 비트맵을 결합하는 순서입니다.
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위치 패킷 뒤 2바이트씩 비트맵 조각을 실어 보냅니다.
마지막 두 바이트는 부분 비트맵입니다. 완전한 비트맵을 만들려면 전체 패킷 세 개에서 2바이트씩 모아 6바이트로 조립해야 합니다.
세 위치 패킷의 마지막 두 바이트를 조립한 축 비트맵입니다.
조각 동기화, 데이터 의미, 갱신 비율의 네 핵심 제약입니다.
현재까지 trackstick을 포함한 v4 장치는 발견되지 않았습니다.
세 위치 패킷에서 완전한 멀티터치 비트맵을 만드는 과정입니다.
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 장치에서만 쓰이는 것으로 보입니다.
Dolphin 단일 터치의 6바이트 좌표·버튼·압력 배치입니다.
Dolphin 멀티터치의 n 비트와 확장 X·Y 축 비트 배치입니다.
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대문자 X·Y·Z와 M/R/L 버튼의 6바이트 배치입니다.
소문자 X·Y·Z와 좌우 버튼의 6바이트 배치입니다.
v6 touchpad에는 가운데 버튼이 없습니다. Trackstick 패킷에는 M·R·L이 있지만 touchpad 패킷은 r·l만 명시합니다.
같은 선두 바이트를 쓰는 두 패킷의 필드 대소문자와 버튼 차이입니다.
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-335v7 trackstick의 X·Y·Z, 버튼 및 T&P 비트입니다.
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개를 뜻합니다.
TWO 비트와 byte4 bit0으로 패킷 변형을 결정합니다.
형식 선택과 클릭패드 추가 손가락 계산 순서입니다.
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 필드로 결정합니다.
기본 touchpad 좌표·압력과 SWM/SWR/SWL 버튼 상태입니다.
SWM, SWR, SWL은 각각 가운데, 오른쪽, 왼쪽 버튼 상태입니다.
12비트 X·Y, Zv, TAPF와 의미 미확정 LFB를 담습니다.
문서에서는 TAPF와 LFB의 의미를 `???`로 남겨 두어 아직 확정하지 않습니다.
접촉 A와 B의 좌표·압력 및 후속 패킷 표시 CONT를 담습니다.
`CONT=1`이면 3개 또는 4개 손가락 패킷이 뒤따릅니다.
추가 접촉 보고와 다섯 번째 손가락 검출 OVF를 담습니다.
`OVF=1`은 다섯 번째 손가락이 검출되었음을 뜻합니다. 원문 byte5의 마지막 두 필드는 모두 `BY5`로 표기되어 있으며 이 번역에서도 원문 좌표를 그대로 보존합니다.
Byte3 bits 4-5의 APD 값과 패킷 목적을 대응시킵니다.
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
요약·해설
alps.rst:1-390ALPS 드라이버는 E6/E7 보고와 명령 모드 응답으로 장치 변형을 식별하고, 프로토콜 버전별 비트 배치로 touchpad와 trackstick 입력을 해석합니다. v3 이후에는 축 비트맵, 조각 조립, 형식 선택, APD 후속 패킷 등 서로 다른 멀티터치 방식이 도입되므로 버전 판정과 패킷 경계를 먼저 검증해야 합니다.
원문 분량과 핵심 프로토콜 축을 요약합니다.
장치 감지에서 입력 이벤트 복원까지의 전체 순서입니다.