linux/Documentation/input/alps.txt
<<
opti"v3/spaval "v3/formal "v3a opti"v href="../linux+v3.7.4/Documentaon v/input/alps.txt">opti"v3img src="../.staonc/gfx/right.png" alt=">>">op3/spavalop3spav class="lxr_search">optiopti"v3input typ > hidden" nam > navtarget" " > ">opti"v3input typ > text" nam > search" id> search">opti"v3butt.13typ > submit">Searchopti"vPrefsl "v3/a>op3/spavalti"v v3/divalti"v v3form acon v="ajax+*" method="post" onsubmit="return false;">op3input typ > hidden" nam > ajax_lookup" id> ajax_lookup" " > ">oti"v v3/formaloti"v v3div class="headingbott.m"> search_results" class="search_results"l "alti"v v3/dival 3div id> content"al 3div id> file_contents"a
3c/fc/eaf3d51425a4b33282f9d6aa6878f4a77b4b_3/0"a
L1" class="line" nam >
L1">v v13/a>ALPS TouchpadvProtocol

L2" class="line" nam >
L2">v v23/a>----------------------

L3" class="line" nam >
L3">v v33/a>o
L4" class="line" nam >
L4">v v43/a>Introducon vo
L5" class="line" nam >
L5">v v53/a>------------o
L6" class="line" nam >
L6">v v63/a>o
L7" class="line" nam >
L7">v v73/a>Currently the ALPS touchpadvdriver supports four protocol versn vs in use byo
L8" class="line" nam >
L8">v v83/a>ALPS touchpads, called versn vs 1, 2, 3, and 4. Informaon v about the variouso
L9" class="line" nam >
L9">v v93/a>protocol versn vs is contained in the following secon vs.o
L10" class="line" nam >
L10">v on>
a>o
L11" class="line" nam >
L11">v 113/a>Detecon vo
L12" class="line" nam >
L12">v 123/a>---------o
L13" class="line" nam >
L13">v 133/a>o
L14" class="line" nam >
L14">v 143/a>All ALPS touchpads should respond to the "E6 report" command sequence:o
L15" class="line" nam >
L15">v 153/a>E8-E6-E6-E6-E9. An ALPS touchpadvshould respond with either 00-00-0A oro
L16" class="line" nam >
L16">v 163/a>00-00-64 if no butt.1s are pressed. The bits 0-2 of the first byte will be 1so
L17" class="line" nam >
L17">v 173/a>if some butt.1s are pressed.o
L18" class="line" nam >
L18">v 183/a>o
L19" class="line" nam >
L19">v 193/a>If the E6 report is successful, the touchpadvmodel is identified using the "E7

L20" class="line" nam >
L20">v 2n>
a>report" sequence: E8-E7-E7-E7-E9. The response is the model signature and iso
L21" class="line" nam >
L21">v 213/a>maoched against known models in the alps_model_data_array.o
L22" class="line" nam >
L22">v 223/a>o
L23" class="line" nam >
L23">v 233/a>With protocol versn vs 3 and 4, the E7 report model signature is alwayso
L24" class="line" nam >
L24">v 243/a>73-02-64. To differentiate between these versn vs, the response from theo
L25" class="line" nam >
L25">v 253/a>"Enter Command Mode" sequence must be inspecoed as described below.o
L26" class="line" nam >
L26">v 263/a>o
L27" class="line" nam >
L27">v 273/a>Command Modeo
L28" class="line" nam >
L28">v 283/a>------------o
L29" class="line" nam >
L29">v 293/a>o
L30" class="line" nam >
L30">v 3n>
a>Protocol versn vs 3 and 4 have a command mode that is used to read and writeo
L31" class="line" nam >
L31">v 313/a>one-byte device registers in a 16-bit address space. The command sequenceo
L32" class="line" nam >
L32">v 323/a>EC-EC-EC-E9 places the device in command mode, and the device will respondo
L33" class="line" nam >
L33">v 333/a>with 88-07 followed by a third byte. This third byte can be used to determineo
L34" class="line" nam >
L34">v 343/a>whether the devices uses the versn v 3 or 4 protocol.o
L35" class="line" nam >
L35">v 353/a>o
L36" class="line" nam >
L36">v 363/a>To exit command mode, PSMOUSE_CMD_SETSTREAM (EA) is sent to the touchpad.o
L37" class="line" nam >
L37">v 373/a>o
L38" class="line" nam >
L38">v 383/a>While in command mode, register addresses can be set by first sending ao
L39" class="line" nam >
L39">v 393/a>specific command, either EC for v3 devices or F5 for v4 devices. Then theo
L40" class="line" nam >
L40">v 4n>
a>address is sent one nibble at a time, where each nibble is encoded as ao
L41" class="line" nam >
L41">v 413/a>command with tion val data. This enoding differs slightly between the v3 ando
L42" class="line" nam >
L42">v 423/a>v4 protocols.o
L43" class="line" nam >
L43">v 433/a>o
L44" class="line" nam >
L44">v 443/a>Once an address has been set, the addressed register can be read by sendingo
L45" class="line" nam >
L45">v 453/a>PSMOUSE_CMD_GETINFO (E9). The first two bytes of the response contains theo
L46" class="line" nam >
L46">v 46>
a>address of the register being read, and the third contains the "
	   of theo
L47" class="line" nam >
L47">v 47>
a>register. Registers are written by writing the "
	   one nibble at a timeo
L48" class="line" nam >
L48">v 483/a>using the sam  encoding used for addresses.o
L49" class="line" nam >
L49">v 493/a>o
L50" class="line" nam >
L50">v 5n>
a>Packet Formaoo
L51" class="line" nam >
L51">v 513/a>-------------o
L52" class="line" nam >
L52">v 523/a>o
L53" class="line" nam >
L53">v 533/a>In the following tables, the following notaon v is used.o
L54" class="line" nam >
L54">v 543/a>o
L55" class="line" nam >
L55">v 553/a> CAPITALS = stick, miniscules = touchpado
L56" class="line" nam >
L56">v 563/a>o
L57" class="line" nam >
L57">v 57>
a>?'s can have different meanings on different models, such as wheel rotaon v,o
L58" class="line" nam >
L58">v 583/a>extra butt.1s, stick butt.1s  v a dualpoint, etc.o
L59" class="line" nam >
L59">v 593/a>o
L60" class="line" nam >
L60">v 6n>
a>PS/2 packet formaoo
L61" class="line" nam >
L61">v 613/a>------------------o
L62" class="line" nam >
L62">v 623/a>o
L63" class="line" nam >
L63">v 633/a> byte 0:  0"v v0 YSGN XSGN v v1 v vM v vR v vLo
L64" class="line" nam >
L64">v 643/a> byte 1: X7v vX6v vX5v vX4v vX3v vX2v vX1 v X0o
L65" class="line" nam >
L65">v 653/a> byte 2: Y7v vY6v vY5v vY4v vY3v vY2v vY1 v Y0o
L66" class="line" nam >
L66">v 663/a>o
L67" class="line" nam >
L67">v 67>
a>Note that the device never signals  verflow condion v.o
L68" class="line" nam >
L68">v 683/a>o
L69" class="line" nam >
L69">v 693/a>ALPS Absolute Mode -vProtocol Vern v 1o
L70" class="line" nam >
L70">v 703/a>--------------------------------------o
L71" class="line" nam >
L71">v 713/a>o
L72" class="line" nam >
L72">v 723/a> byte 0:  1"v v0 v v0 v v0 v v1"v x9"v x8"v x7

L73" class="line" nam >
L73">v 733/a> byte 1: v0 v x6v vx5v vx4v vx3v vx2v vx1"v x0o
L74" class="line" nam >
L74">v 743/a> byte 2: v0 v v? v v? v vl v vr v v? vfin  geso
L75" class="line" nam >
L75">v 753/a> byte 3: v0 v v? v v? v v? v v? v y9"v y8"v y7

L76" class="line" nam >
L76">v 763/a> byte 4: v0 v y6v vy5v vy4v vy3v vy2v vy1"v y0o
L77" class="line" nam >
L77">v 773/a> byte 5: v0 v z6v vz5v vz4v vz3v vz2v vz1"v z0o
L78" class="line" nam >
L78">v 783/a>o
L79" class="line" nam >
L79">v 793/a>ALPS Absolute Mode -vProtocol Versn v 2o
L80" class="line" nam >
L80">v 803/a>---------------------------------------o
L81" class="line" nam >
L81">v 813/a>o
L82" class="line" nam >
L82">v 823/a> byte 0:  1"v v? v v? v v? v v1"v v? v v? v v?o
L83" class="line" nam >
L83">v 833/a> byte 1: v0 v x6v vx5v vx4v vx3v vx2v vx1"v x0o
L84" class="line" nam >
L84">v 843/a> byte 2: v0 vx10"v x9"v x8"v x7 v v? vfin  geso
L85" class="line" nam >
L85">v 853/a> byte 3: v0 v y9"v y8"v y7 v v1 v vM v vR v vLo
L86" class="line" nam >
L86">v 863/a> byte 4: v0 v y6v vy5v vy4v vy3v vy2v vy1"v y0o
L87" class="line" nam >
L87">v 873/a> byte 5: v0 v z6v vz5v vz4v vz3v vz2v vz1"v z0o
L88" class="line" nam >
L88">v 883/a>o
L89" class="line" nam >
L89">v 893/a>Dualpoint device -- interleaved packet formaoo
L90" class="line" nam >
L90">v 903/a>---------------------------------------------o
L91" class="line" nam >
L91">v 913/a>o
L92" class="line" nam >
L92">v 923/a> byte 0:   v1 v v1"v v0 v v0 v v1 v v1 v v1 v v1o
L93" class="line" nam >
L93">v 933/a> byte 1: v v0 v x6v vx5v vx4v vx3v vx2v vx1"v x0o
L94" class="line" nam >
L94">v 943/a> byte 2: v v0 vx10"v x9"v x8"v x7 v v0 vfin  geso
L95" class="line" nam >
L95">v 953/a> byte 3: v  0"v v0 YSGN XSGN v v1 v v1 v v1 v v1o
L96" class="line" nam >
L96">v 963/a> byte 4: v X7v vX6v vX5v vX4v vX3v vX2v vX1 v X0o
L97" class="line" nam >
L97">v 973/a> byte 5: v Y7v vY6v vY5v vY4v vY3v vY2v vY1 v Y0o
L98" class="line" nam >
L98">v 983/a> byte 6: v  0"v y9"v y8"v y7 v v1 v vm v vr v vl

L99" class="line" nam >
L99">v 993/a> byte 7: v  0"v y6v vy5v vy4v vy3v vy2v vy1"v y0o
L100" class="line" nam >
L100">v1003/a> byte 8: v  0"v z6v vz5v vz4v vz3v vz2v vz1"v z0o
L101" class="line" nam >
L101">v1013/a>o
L102" class="line" nam >
L102">v1023/a>ALPS Absolute Mode -vProtocol Versn v 3o
L103" class="line" nam >
L103">v1033/a>---------------------------------------o
L104" class="line" nam >
L104">v1043/a>o
L105" class="line" nam >
L105">v1053/a>ALPS protocol versn v 3 has three different packet formaos. The first two areo
L106" class="line" nam >
L106">v106>
a>associated with touchpadvevents, and the third is associatd with tracksticko
L107" class="line" nam >
L107">v1073/a>events.o
L108" class="line" nam >
L108">v1083/a>o
L109" class="line" nam >
L109">v1093/a>The first type is the touchpadvposion v packet.o
L110" class="line" nam >
L110">v1on>
a>o
L111" class="line" nam >
L111">v1113/a> byte 0:   v1 v v?v vx1"v x0 v v1 v v1 v v1 v v1o
L112" class="line" nam >
L112">v1123/a> byte 1: v v0 vx10"v x9"v x8"v x7 v x6v vx5v vx4o
L113" class="line" nam >
L113">v1133/a> byte 2: v v0 vy10"v y9"v y8"v y7 v y6v vy5v vy4o
L114" class="line" nam >
L114">v1143/a> byte 3: v  0"v vM v vR v vL v v1 v vm v vr v vl

L115" class="line" nam >
L115">v1153/a> byte 4: v  0"v mt  vx3v vx2v vy3v vy2v vy1"v y0o
L116" class="line" nam >
L116">v1163/a> byte 5: v  0"v z6v vz5v vz4v vz3v vz2v vz1"v z0o
L117" class="line" nam >
L117">v1173/a>o
L118" class="line" nam >
L118">v1183/a>Note that for some devices the trackstick butt.1s are reported in this packet,o
L119" class="line" nam >
L119">v1193/a>and  v others it is reported in the trackstick packets.o
L120" class="line" nam >
L120">v12n>
a>o
L121" class="line" nam >
L121">v1213/a>The second packet type contains bitmaps representing the x and y axes. In theo
L122" class="line" nam >
L122">v1223/a>bitmaps a given bit is set if there is avfinger c vering that posion v on theo
L123" class="line" nam >
L123">v1233/a>given axis. Thus the bitmap packet can be used for low-resolutn v multi-toucho
L124" class="line" nam >
L124">v1243/a>data, althoughvfinger tracking is not possible.  This packet also encodes theo
L125" class="line" nam >
L125">v1253/a>number of contacts (f1 and f0 in the table below).o
L126" class="line" nam >
L126">v1263/a>o
L127" class="line" nam >
L127">v1273/a> byte 0:   v1 v v1v vx1"v x0 v v1 v v1 v v1 v v1o
L128" class="line" nam >
L128">v1283/a> byte 1: v v0 v x8"v x7 v x6v vx5v vx4  vx3v vx2o
L129" class="line" nam >
L129">v1293/a> byte 2: v v0 v y7 v y6v vy5v vy4v vy3v vy2v vy1o
L130" class="line" nam >
L130">v1303/a> byte 3: v  0"vy10"v y9"v y8"v v1 v v1 v v1 v v1o
L131" class="line" nam >
L131">v1313/a> byte 4: v  0"vx14"vx13"vx12"vx11 vx10"v x9"v y0o
L132" class="line" nam >
L132">v1323/a> byte 5: v  0"v  1"v v? v v? v v? v v? v f1"v f0o
L133" class="line" nam >
L133">v1333/a>o
L134" class="line" nam >
L134">v1343/a>This packet only appears after avposion v packet with the mt bit set, ando
L135" class="line" nam >
L135">v1353/a>usually only appears when there are two or more contacts (althougho
L136" class="line" nam >
L136">v1363/a>occassn vally it's seen with tnly a single contact).o
L137" class="line" nam >
L137">v1373/a>o
L138" class="line" nam >
L138">v1383/a>The fival v3 packet type is the trackstick packet.o
L139" class="line" nam >
L139">v1393/a>o
L140" class="line" nam >
L140">v1403/a> byte 0:   v1 v v1v vx7 v y7 v v1 v v1 v v1 v v1o
L141" class="line" nam >
L141">v1413/a> byte 1: v v0 v x6v vx5v vx4v vx3v vx2v vx1"v x0o
L142" class="line" nam >
L142">v1423/a> byte 2: v v0 v y6v vy5v vy4v vy3v vy2v vy1"v y0o
L143" class="line" nam >
L143">v1433/a> byte 3: v  0"v v1"v v0 v v0 v v1 v v0 v v0 v v0o
L144" class="line" nam >
L144">v1443/a> byte 4: v  0"v z4v vz3v vz2v vz1"v z0 v v? v v?o
L145" class="line" nam >
L145">v1453/a> byte 5: v  0"v  0 v v1 v v1 v v1 v v1 v v1 v v1o
L146" class="line" nam >
L146">v1463/a>o
L147" class="line" nam >
L147">v147>
a>ALPS Absolute Mode -vProtocol Versn v 4o
L148" class="line" nam >
L148">v1483/a>---------------------------------------o
L149" class="line" nam >
L149">v1493/a>o
L150" class="line" nam >
L150">v15n>
a>Protocol versn v 4 has an 8-byte packet formao.o
L151" class="line" nam >
L151">v1513/a>o
L152" class="line" nam >
L152">v1523/a> byte 0:   v1 v v?v vx1"v x0 v v1 v v1 v v1 v v1o
L153" class="line" nam >
L153">v1533/a> byte 1: v v0 vx10"v x9"v x8"v x7 v x6v vx5v vx4o
L154" class="line" nam >
L154">v1543/a> byte 2: v v0 vy10"v y9"v y8"v y7 v y6v vy5v vy4o
L155" class="line" nam >
L155">v1553/a> byte 3: v  0"v v1v vx3v vx2v vy3v vy2v vy1"v y0o
L156" class="line" nam >
L156">v1563/a> byte 4: v v0 v v? v v? v v? v v1"v v? v vr v vl

L157" class="line" nam >
L157">v1573/a> byte 5: v  0"v z6v vz5v vz4v vz3v vz2v vz1"v z0o
L158" class="line" nam >
L158">v1583/a> byte 6: v  bitmap data (described below)o
L159" class="line" nam >
L159">v1593/a> byte 7: v  bitmap data (described below)o
L160" class="line" nam >
L160">v16n>
a>o
L161" class="line" nam >
L161">v1613/a>The last two bytes represent avpartial bitmap packet, with 3 full packetso
L162" class="line" nam >
L162">v1623/a>required to construct a complete bitmap packet.  Once assembled, the 6-byteo
L163" class="line" nam >
L163">v1633/a>bitmap packet has the following formao:o
L164" class="line" nam >
L164">v1643/a>o
L165" class="line" nam >
L165">v1653/a> byte 0: v  0"v v1v vx7 v x6v vx5v vx4  vx3v vx2o
L166" class="line" nam >
L166">v1663/a> byte 1: v v0 v x1"v x0 v y4v vy3v vy2v vy1"v y0o
L167" class="line" nam >
L167">v1673/a> byte 2: v v0 v v0 v v? vx14"vx13"vx12"vx11 vx10o
L168" class="line" nam >
L168">v1683/a> byte 3: v  0"v x9"v x8"v y9"v y8"v y7 v y6v vy5o
L169" class="line" nam >
L169">v1693/a> byte 4: v v0 v v0 v v0 v v0 v v0 v v0 v v0 v v0o
L170" class="line" nam >
L170">v1703/a> byte 5: v  0"v  0 v v0 v v0 v v0 v v0 v v0 vy10o
L171" class="line" nam >
L171">v1713/a>o
L172" class="line" nam >
L172">v1723/a>There are several things worth noting here.o
L173" class="line" nam >
L173">v1733/a>o
L174" class="line" nam >
L174">v1743/a> 1) In the bitmap data, bit 6 of byte 0 serves as a sync byte too
L175" class="line" nam >
L175">v1753/a>    identify the first fragment of a bitmap packet.o
L176" class="line" nam >
L176">v1763/a>o
L177" class="line" nam >
L177">v1773/a> 2) The bitmaps represent the sam  data as in the v3 bitmap packets, althougho
L178" class="line" nam >
L178">v1783/a>    the packet layout is different.o
L179" class="line" nam >
L179">v1793/a>o
L180" class="line" nam >
L180">v1803/a> 3) There doesn't seem to be a count of the contact points anywhere in the v4o
L181" class="line" nam >
L181">v1813/a>    protocol packets. Deriving a count of contact points must be done byo
L182" class="line" nam >
L182">v1823/a>    analyzing the bitmaps.o
L183" class="line" nam >
L183">v1833/a>o
L184" class="line" nam >
L184">v1843/a> 4) There is av3 to 1 raon  of posion v packets to bitmap packets. Thereforeo
L185" class="line" nam >
L185">v1853/a>    MT posion v can tnly be updated for every third ST posion v update, ando
L186" class="line" nam >
L186">v1863/a>    the count of contact points can tnly be updated every third packet aso
L187" class="line" nam >
L187">v1873/a>    well.o
L188" class="line" nam >
L188">v1883/a>o
L189" class="line" nam >
L189">v1893/a>So far no v4 devices with tracksticks have been encountered.o
L190" class="line" nam >
L190">v1903/a>
The origival LXR software by the LXR community3/a>, this experimental versn v by lxr@linux.no3/a>. 3/dival3div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS3/a>, provider of Linux consulting and peraon vs services since 1995. 3/dival 3/bodyal3/htmlal