<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>9. Elantech Touchpad Driver — The Linux Kernel documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="10. Iforce Protocol" href="iforce-protocol.html" />
<link rel="prev" title="8. EDT ft5x06 based Polytouch devices" href="edt-ft5x06.html" />
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
</a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>
<p class="blurb">6.18.50</p>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../subsystem-apis.html#human-interfaces">Human interfaces</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html">Input Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../hid/index.html">Human Interface Devices (HID)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../sound/index.html">Sound Subsystem Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../gpu/index.html">GPU Driver Developer’s Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../fb/index.html">Frame Buffer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../leds/index.html">LEDs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>
</div>
<script type="text/javascript"> <!--
var sbar = document.getElementsByClassName("sphinxsidebar")[0];
let currents = document.getElementsByClassName("current")
if (currents.length) {
sbar.scrollTop = currents[currents.length - 1].offsetTop;
}
--> </script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/input/devices/elantech.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="elantech-touchpad-driver">
<h1><span class="section-number">9. </span>Elantech Touchpad Driver<a class="headerlink" href="#elantech-touchpad-driver" title="Link to this heading">¶</a></h1>
<blockquote>
<div><p>Copyright (C) 2007-2008 Arjan Opmeer <<a class="reference external" href="mailto:arjan%40opmeer.net">arjan<span>@</span>opmeer<span>.</span>net</a>></p>
<p>Extra information for hardware version 1 found and
provided by Steve Havelka</p>
<p>Version 2 (EeePC) hardware support based on patches
received from Woody at Xandros and forwarded to me
by user StewieGriffin at the eeeuser.com forum</p>
</div></blockquote>
<section id="introduction">
<h2><span class="section-number">9.1. </span>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">¶</a></h2>
<p>Currently the Linux Elantech touchpad driver is aware of four different
hardware versions unimaginatively called version 1,version 2, version 3
and version 4. Version 1 is found in “older” laptops and uses 4 bytes per
packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes
per packet, and provides additional features such as position of two fingers,
and width of the touch. Hardware version 3 uses 6 bytes per packet (and
for 2 fingers the concatenation of two 6 bytes packets) and allows tracking
of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can
combine a status packet with multiple head or motion packets. Hardware version
4 allows tracking up to 5 fingers.</p>
<p>Some Hardware version 3 and version 4 also have a trackpoint which uses a
separate packet format. It is also 6 bytes per packet.</p>
<p>The driver tries to support both hardware versions and should be compatible
with the Xorg Synaptics touchpad driver and its graphical configuration
utilities.</p>
<p>Note that a mouse button is also associated with either the touchpad or the
trackpoint when a trackpoint is available. Disabling the Touchpad in xorg
(TouchPadOff=0) will also disable the buttons associated with the touchpad.</p>
<p>Additionally the operation of the touchpad can be altered by adjusting the
contents of some of its internal registers. These registers are represented
by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
that can be read from and written to.</p>
<p>Currently only the registers for hardware version 1 are somewhat understood.
Hardware version 2 seems to use some of the same registers but it is not
known whether the bits in the registers represent the same thing or might
have changed their meaning.</p>
<p>On top of that, some register settings have effect only when the touchpad is
in relative mode and not in absolute mode. As the Linux Elantech touchpad
driver always puts the hardware into absolute mode not all information
mentioned below can be used immediately. But because there is no freely
available Elantech documentation the information is provided here anyway for
completeness sake.</p>
</section>
<section id="extra-knobs">
<h2><span class="section-number">9.2. </span>Extra knobs<a class="headerlink" href="#extra-knobs" title="Link to this heading">¶</a></h2>
<p>Currently the Linux Elantech touchpad driver provides three extra knobs under
/sys/bus/serio/drivers/psmouse/serio? for the user.</p>
<ul>
<li><p>debug</p>
<blockquote>
<div><p>Turn different levels of debugging ON or OFF.</p>
<p>By echoing “0” to this file all debugging will be turned OFF.</p>
<p>Currently a value of “1” will turn on some basic debugging and a value of
“2” will turn on packet debugging. For hardware version 1 the default is
OFF. For version 2 the default is “1”.</p>
<p>Turning packet debugging on will make the driver dump every packet
received to the syslog before processing it. Be warned that this can
generate quite a lot of data!</p>
</div></blockquote>
</li>
<li><p>paritycheck</p>
<blockquote>
<div><p>Turns parity checking ON or OFF.</p>
<p>By echoing “0” to this file parity checking will be turned OFF. Any
non-zero value will turn it ON. For hardware version 1 the default is ON.
For version 2 the default it is OFF.</p>
<p>Hardware version 1 provides basic data integrity verification by
calculating a parity bit for the last 3 bytes of each packet. The driver
can check these bits and reject any packet that appears corrupted. Using
this knob you can bypass that check.</p>
<p>Hardware version 2 does not provide the same parity bits. Only some basic
data consistency checking can be done. For now checking is disabled by
default. Currently even turning it on will do nothing.</p>
</div></blockquote>
</li>
<li><p>crc_enabled</p>
<blockquote>
<div><p>Sets crc_enabled to 0/1. The name “crc_enabled” is the official name of
this integrity check, even though it is not an actual cyclic redundancy
check.</p>
<p>Depending on the state of crc_enabled, certain basic data integrity
verification is done by the driver on hardware version 3 and 4. The
driver will reject any packet that appears corrupted. Using this knob,
The state of crc_enabled can be altered with this knob.</p>
<p>Reading the crc_enabled value will show the active value. Echoing
“0” or “1” to this file will set the state to “0” or “1”.</p>
</div></blockquote>
</li>
</ul>
</section>
<section id="differentiating-hardware-versions">
<h2><span class="section-number">9.3. </span>Differentiating hardware versions<a class="headerlink" href="#differentiating-hardware-versions" title="Link to this heading">¶</a></h2>
<p>To detect the hardware version, read the version number as param[0].param[1].param[2]:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>4 bytes version: (after the arrow is the name given in the Dell-provided driver)
02.00.22 => EF013
02.06.00 => EF019
</pre></div>
</div>
<p>In the wild, there appear to be more versions, such as 00.01.64, 01.00.21,
02.00.00, 02.00.04, 02.00.06:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>6 bytes:
02.00.30 => EF113
02.08.00 => EF023
02.08.XX => EF123
02.0B.00 => EF215
04.01.XX => Scroll_EF051
04.02.XX => EF051
</pre></div>
</div>
<p>In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There
appears to be almost no difference, except for EF113, which does not report
pressure/width and has different data consistency checks.</p>
<p>Probably all the versions with param[0] <= 01 can be considered as
4 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as
4 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes.</p>
</section>
<section id="hardware-version-1">
<h2><span class="section-number">9.4. </span>Hardware version 1<a class="headerlink" href="#hardware-version-1" title="Link to this heading">¶</a></h2>
<section id="registers">
<h3><span class="section-number">9.4.1. </span>Registers<a class="headerlink" href="#registers" title="Link to this heading">¶</a></h3>
<p>By echoing a hexadecimal value to a register it contents can be altered.</p>
<p>For example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo -n 0x16 > reg_10
</pre></div>
</div>
<ul>
<li><p>reg_10:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
B C T D L A S E
E: 1 = enable smart edges unconditionally
S: 1 = enable smart edges only when dragging
A: 1 = absolute mode (needs 4 byte packets, see reg_11)
L: 1 = enable drag lock (see reg_22)
D: 1 = disable dynamic resolution
T: 1 = disable tapping
C: 1 = enable corner tap
B: 1 = swap left and right button
</pre></div>
</div>
</li>
<li><p>reg_11:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
1 0 0 H V 1 F P
P: 1 = enable parity checking for relative mode
F: 1 = enable native 4 byte packet mode
V: 1 = enable vertical scroll area
H: 1 = enable horizontal scroll area
</pre></div>
</div>
</li>
<li><p>reg_20:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>single finger width?
</pre></div>
</div>
</li>
<li><p>reg_21:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>scroll area width (small: 0x40 ... wide: 0xff)
</pre></div>
</div>
</li>
<li><p>reg_22:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>drag lock time out (short: 0x14 ... long: 0xfe;
0xff = tap again to release)
</pre></div>
</div>
</li>
<li><p>reg_23:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>tap make timeout?
</pre></div>
</div>
</li>
<li><p>reg_24:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>tap release timeout?
</pre></div>
</div>
</li>
<li><p>reg_25:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>smart edge cursor speed (0x02 = slow, 0x03 = medium, 0x04 = fast)
</pre></div>
</div>
</li>
<li><p>reg_26:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>smart edge activation area width?
</pre></div>
</div>
</li>
</ul>
</section>
<section id="native-relative-mode-4-byte-packet-format">
<h3><span class="section-number">9.4.2. </span>Native relative mode 4 byte packet format<a class="headerlink" href="#native-relative-mode-4-byte-packet-format" title="Link to this heading">¶</a></h3>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
c c p2 p1 1 M R L
L, R, M = 1 when Left, Right, Middle mouse button pressed
some models have M as byte 3 odd parity bit
when parity checking is enabled (reg_11, P = 1):
p1..p2 = byte 1 and 2 odd parity bit
c = 1 when corner tap detected
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
dx7 dx6 dx5 dx4 dx3 dx2 dx1 dx0
dx7..dx0 = x movement; positive = right, negative = left
byte 1 = 0xf0 when corner tap detected
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
dy7 dy6 dy5 dy4 dy3 dy2 dy1 dy0
dy7..dy0 = y movement; positive = up, negative = down
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>parity checking enabled (reg_11, P = 1):
bit 7 6 5 4 3 2 1 0
w h n1 n0 ds3 ds2 ds1 ds0
normally:
ds3..ds0 = scroll wheel amount and direction
positive = down or left
negative = up or right
when corner tap detected:
ds0 = 1 when top right corner tapped
ds1 = 1 when bottom right corner tapped
ds2 = 1 when bottom left corner tapped
ds3 = 1 when top left corner tapped
n1..n0 = number of fingers on touchpad
only models with firmware 2.x report this, models with
firmware 1.x seem to map one, two and three finger taps
directly to L, M and R mouse buttons
h = 1 when horizontal scroll action
w = 1 when wide finger touch?
otherwise (reg_11, P = 0):
bit 7 6 5 4 3 2 1 0
ds7 ds6 ds5 ds4 ds3 ds2 ds1 ds0
ds7..ds0 = vertical scroll amount and direction
negative = up
positive = down
</pre></div>
</div>
</section>
<section id="native-absolute-mode-4-byte-packet-format">
<h3><span class="section-number">9.4.3. </span>Native absolute mode 4 byte packet format<a class="headerlink" href="#native-absolute-mode-4-byte-packet-format" title="Link to this heading">¶</a></h3>
<p>EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and
when 1 finger is touching, the first 2 position reports must be discarded.
This counting is reset whenever a different number of fingers is reported.</p>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>firmware version 1.x:
bit 7 6 5 4 3 2 1 0
D U p1 p2 1 p3 R L
L, R = 1 when Left, Right mouse button pressed
p1..p3 = byte 1..3 odd parity bit
D, U = 1 when rocker switch pressed Up, Down
firmware version 2.x:
bit 7 6 5 4 3 2 1 0
n1 n0 p2 p1 1 p3 R L
L, R = 1 when Left, Right mouse button pressed
p1..p3 = byte 1..3 odd parity bit
n1..n0 = number of fingers on touchpad
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>firmware version 1.x:
bit 7 6 5 4 3 2 1 0
f 0 th tw x9 x8 y9 y8
tw = 1 when two finger touch
th = 1 when three finger touch
f = 1 when finger touch
firmware version 2.x:
bit 7 6 5 4 3 2 1 0
. . . . x9 x8 y9 y8
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x9..x0 = absolute x value (horizontal)
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y9..y0 = absolute y value (vertical)
</pre></div>
</div>
</section>
</section>
<section id="hardware-version-2">
<h2><span class="section-number">9.5. </span>Hardware version 2<a class="headerlink" href="#hardware-version-2" title="Link to this heading">¶</a></h2>
<section id="id1">
<h3><span class="section-number">9.5.1. </span>Registers<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h3>
<p>By echoing a hexadecimal value to a register it contents can be altered.</p>
<p>For example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo -n 0x56 > reg_10
</pre></div>
</div>
<ul>
<li><p>reg_10:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 1 0 1 0 1 D 0
D: 1 = enable drag and drop
</pre></div>
</div>
</li>
<li><p>reg_11:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
1 0 0 0 S 0 1 0
S: 1 = enable vertical scroll
</pre></div>
</div>
</li>
<li><p>reg_21:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>unknown (0x00)
</pre></div>
</div>
</li>
<li><p>reg_22:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>drag and drop release time out (short: 0x70 ... long 0x7e;
0x7f = never i.e. tap again to release)
</pre></div>
</div>
</li>
</ul>
</section>
<section id="native-absolute-mode-6-byte-packet-format">
<h3><span class="section-number">9.5.2. </span>Native absolute mode 6 byte packet format<a class="headerlink" href="#native-absolute-mode-6-byte-packet-format" title="Link to this heading">¶</a></h3>
<section id="parity-checking-and-packet-re-synchronization">
<h4><span class="section-number">9.5.2.1. </span>Parity checking and packet re-synchronization<a class="headerlink" href="#parity-checking-and-packet-re-synchronization" title="Link to this heading">¶</a></h4>
<p>There is no parity checking, however some consistency checks can be performed.</p>
<p>For instance for EF113:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>SA1= packet[0];
A1 = packet[1];
B1 = packet[2];
SB1= packet[3];
C1 = packet[4];
D1 = packet[5];
if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1
(((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed)
(((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2
(((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4
(((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed)
(((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00)) ) // check Byte 5
// error detected
</pre></div>
</div>
<p>For all the other ones, there are just a few constant bits:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>if( ((packet[0] & 0x0C) != 0x04) ||
((packet[3] & 0x0f) != 0x02) )
// error detected
</pre></div>
</div>
<p>In case an error is detected, all the packets are shifted by one (and packet[0] is discarded).</p>
</section>
<section id="one-three-finger-touch">
<h4><span class="section-number">9.5.2.2. </span>One/Three finger touch<a class="headerlink" href="#one-three-finger-touch" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
n1 n0 w3 w2 . . R L
L, R = 1 when Left, Right mouse button pressed
n1..n0 = number of fingers on touchpad
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p7 p6 p5 p4 x11 x10 x9 x8
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x11..x0 = absolute x value (horizontal)
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
n4 vf w1 w0 . . . b2
n4 = set if more than 3 fingers (only in 3 fingers mode)
vf = a kind of flag ? (only on EF123, 0 when finger is over one
of the buttons, 1 otherwise)
w3..w0 = width of the finger touch (not EF113)
b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed:
0 = none
1 = Left
2 = Right
3 = Middle (Left and Right)
4 = Forward
5 = Back
6 = Another one
7 = Another one
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p3 p1 p2 p0 y11 y10 y9 y8
p7..p0 = pressure (not EF113)
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y11..y0 = absolute y value (vertical)
</pre></div>
</div>
</section>
<section id="two-finger-touch">
<h4><span class="section-number">9.5.2.3. </span>Two finger touch<a class="headerlink" href="#two-finger-touch" title="Link to this heading">¶</a></h4>
<p>Note that the two pairs of coordinates are not exactly the coordinates of the
two fingers, but only the pair of the lower-left and upper-right coordinates.
So the actual fingers might be situated on the other diagonal of the square
defined by these two points.</p>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
n1 n0 ay8 ax8 . . R L
L, R = 1 when Left, Right mouse button pressed
n1..n0 = number of fingers on touchpad
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
ax8..ax0 = lower-left finger absolute x value
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0
ay8..ay0 = lower-left finger absolute y value
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
. . by8 bx8 . . . .
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
bx8..bx0 = upper-right finger absolute x value
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
by7 by8 by5 by4 by3 by2 by1 by0
by8..by0 = upper-right finger absolute y value
</pre></div>
</div>
</section>
</section>
</section>
<section id="hardware-version-3">
<h2><span class="section-number">9.6. </span>Hardware version 3<a class="headerlink" href="#hardware-version-3" title="Link to this heading">¶</a></h2>
<section id="id2">
<h3><span class="section-number">9.6.1. </span>Registers<a class="headerlink" href="#id2" title="Link to this heading">¶</a></h3>
<ul>
<li><p>reg_10:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 0 0 0 R F T A
A: 1 = enable absolute tracking
T: 1 = enable two finger mode auto correct
F: 1 = disable ABS Position Filter
R: 1 = enable real hardware resolution
</pre></div>
</div>
</li>
</ul>
</section>
<section id="id3">
<h3><span class="section-number">9.6.2. </span>Native absolute mode 6 byte packet format<a class="headerlink" href="#id3" title="Link to this heading">¶</a></h3>
<p>1 and 3 finger touch shares the same 6-byte packet format, except that
3 finger touch only reports the position of the center of all three fingers.</p>
<p>Firmware would send 12 bytes of data for 2 finger touch.</p>
<p>Note on debounce:
In case the box has unstable power supply or other electricity issues, or
when number of finger changes, F/W would send “debounce packet” to inform
driver that the hardware is in debounce status.
The debounce packet has the following signature:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>byte 0: 0xc4
byte 1: 0xff
byte 2: 0xff
byte 3: 0x02
byte 4: 0xff
byte 5: 0xff
</pre></div>
</div>
<p>When we encounter this kind of packet, we just ignore it.</p>
<section id="id4">
<h4><span class="section-number">9.6.2.1. </span>One/Three finger touch<a class="headerlink" href="#id4" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
n1 n0 w3 w2 0 1 R L
L, R = 1 when Left, Right mouse button pressed
n1..n0 = number of fingers on touchpad
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p7 p6 p5 p4 x11 x10 x9 x8
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x11..x0 = absolute x value (horizontal)
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 0 w1 w0 0 0 1 0
w3..w0 = width of the finger touch
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p3 p1 p2 p0 y11 y10 y9 y8
p7..p0 = pressure
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y11..y0 = absolute y value (vertical)
</pre></div>
</div>
</section>
<section id="id5">
<h4><span class="section-number">9.6.2.2. </span>Two finger touch<a class="headerlink" href="#id5" title="Link to this heading">¶</a></h4>
<p>The packet format is exactly the same for two finger touch, except the hardware
sends two 6 byte packets. The first packet contains data for the first finger,
the second packet has data for the second finger. So for two finger touch a
total of 12 bytes are sent.</p>
</section>
</section>
</section>
<section id="hardware-version-4">
<h2><span class="section-number">9.7. </span>Hardware version 4<a class="headerlink" href="#hardware-version-4" title="Link to this heading">¶</a></h2>
<section id="id6">
<h3><span class="section-number">9.7.1. </span>Registers<a class="headerlink" href="#id6" title="Link to this heading">¶</a></h3>
<ul>
<li><p>reg_07:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 A
A: 1 = enable absolute tracking
</pre></div>
</div>
</li>
</ul>
</section>
<section id="id7">
<h3><span class="section-number">9.7.2. </span>Native absolute mode 6 byte packet format<a class="headerlink" href="#id7" title="Link to this heading">¶</a></h3>
<p>v4 hardware is a true multitouch touchpad, capable of tracking up to 5 fingers.
Unfortunately, due to PS/2’s limited bandwidth, its packet format is rather
complex.</p>
<p>Whenever the numbers or identities of the fingers changes, the hardware sends a
status packet to indicate how many and which fingers is on touchpad, followed by
head packets or motion packets. A head packet contains data of finger id, finger
position (absolute x, y values), width, and pressure. A motion packet contains
two fingers’ position delta.</p>
<p>For example, when status packet tells there are 2 fingers on touchpad, then we
can expect two following head packets. If the finger status doesn’t change,
the following packets would be motion packets, only sending delta of finger
position, until we receive a status packet.</p>
<p>One exception is one finger touch. when a status packet tells us there is only
one finger, the hardware would just send head packets afterwards.</p>
<section id="status-packet">
<h4><span class="section-number">9.7.2.1. </span>Status packet<a class="headerlink" href="#status-packet" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
. . . . 0 1 R L
L, R = 1 when Left, Right mouse button pressed
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
. . . ft4 ft3 ft2 ft1 ft0
ft4 ft3 ft2 ft1 ft0 ftn = 1 when finger n is on touchpad
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>not used
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
. . . 1 0 0 0 0
constant bits
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p . . . . . . .
p = 1 for palm
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>not used
</pre></div>
</div>
</section>
<section id="head-packet">
<h4><span class="section-number">9.7.2.2. </span>Head packet<a class="headerlink" href="#head-packet" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
w3 w2 w1 w0 0 1 R L
L, R = 1 when Left, Right mouse button pressed
w3..w0 = finger width (spans how many trace lines)
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p7 p6 p5 p4 x11 x10 x9 x8
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x11..x0 = absolute x value (horizontal)
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
id2 id1 id0 1 0 0 0 1
id2..id0 = finger id
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
p3 p1 p2 p0 y11 y10 y9 y8
p7..p0 = pressure
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y11..y0 = absolute y value (vertical)
</pre></div>
</div>
</section>
<section id="motion-packet">
<h4><span class="section-number">9.7.2.3. </span>Motion packet<a class="headerlink" href="#motion-packet" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
id2 id1 id0 w 0 1 R L
L, R = 1 when Left, Right mouse button pressed
id2..id0 = finger id
w = 1 when delta overflows (> 127 or < -128), in this case
firmware sends us (delta x / 5) and (delta y / 5)
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x7..x0 = delta x (two's complement)
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y7..y0 = delta y (two's complement)
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
id2 id1 id0 1 0 0 1 0
id2..id0 = finger id
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x7..x0 = delta x (two's complement)
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y7..y0 = delta y (two's complement)
byte 0 ~ 2 for one finger
byte 3 ~ 5 for another
</pre></div>
</div>
</section>
</section>
</section>
<section id="trackpoint-for-hardware-version-3-and-4">
<h2><span class="section-number">9.8. </span>Trackpoint (for Hardware version 3 and 4)<a class="headerlink" href="#trackpoint-for-hardware-version-3-and-4" title="Link to this heading">¶</a></h2>
<section id="id8">
<h3><span class="section-number">9.8.1. </span>Registers<a class="headerlink" href="#id8" title="Link to this heading">¶</a></h3>
<p>No special registers have been identified.</p>
</section>
<section id="native-relative-mode-6-byte-packet-format">
<h3><span class="section-number">9.8.2. </span>Native relative mode 6 byte packet format<a class="headerlink" href="#native-relative-mode-6-byte-packet-format" title="Link to this heading">¶</a></h3>
<section id="id9">
<h4><span class="section-number">9.8.2.1. </span>Status Packet<a class="headerlink" href="#id9" title="Link to this heading">¶</a></h4>
<p>byte 0:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 0 sx sy 0 M R L
</pre></div>
</div>
<p>byte 1:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
~sx 0 0 0 0 0 0 0
</pre></div>
</div>
<p>byte 2:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
~sy 0 0 0 0 0 0 0
</pre></div>
</div>
<p>byte 3:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
0 0 ~sy ~sx 0 1 1 0
</pre></div>
</div>
<p>byte 4:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
</pre></div>
</div>
<p>byte 5:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
x and y are written in two's complement spread
over 9 bits with sx/sy the relative top bit and
x7..x0 and y7..y0 the lower bits.
~sx is the inverse of sx, ~sy is the inverse of sy.
The sign of y is opposite to what the input driver
expects for a relative movement
</pre></div>
</div>
</section>
</section>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©The kernel development community.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="../../_sources/input/devices/elantech.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>