Back to home page

OSCL-LXR

 
 

    


0001 Elantech Touchpad Driver
0002 ========================
0003 
0004         Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net>
0005 
0006         Extra information for hardware version 1 found and
0007         provided by Steve Havelka
0008 
0009         Version 2 (EeePC) hardware support based on patches
0010         received from Woody at Xandros and forwarded to me
0011         by user StewieGriffin at the eeeuser.com forum
0012 
0013 .. Contents
0014 
0015  1. Introduction
0016  2. Extra knobs
0017  3. Differentiating hardware versions
0018  4. Hardware version 1
0019     4.1 Registers
0020     4.2 Native relative mode 4 byte packet format
0021     4.3 Native absolute mode 4 byte packet format
0022  5. Hardware version 2
0023     5.1 Registers
0024     5.2 Native absolute mode 6 byte packet format
0025         5.2.1 Parity checking and packet re-synchronization
0026         5.2.2 One/Three finger touch
0027         5.2.3 Two finger touch
0028  6. Hardware version 3
0029     6.1 Registers
0030     6.2 Native absolute mode 6 byte packet format
0031         6.2.1 One/Three finger touch
0032         6.2.2 Two finger touch
0033  7. Hardware version 4
0034     7.1 Registers
0035     7.2 Native absolute mode 6 byte packet format
0036         7.2.1 Status packet
0037         7.2.2 Head packet
0038         7.2.3 Motion packet
0039  8. Trackpoint (for Hardware version 3 and 4)
0040     8.1 Registers
0041     8.2 Native relative mode 6 byte packet format
0042         8.2.1 Status Packet
0043 
0044 
0045 
0046 Introduction
0047 ~~~~~~~~~~~~
0048 
0049 Currently the Linux Elantech touchpad driver is aware of four different
0050 hardware versions unimaginatively called version 1,version 2, version 3
0051 and version 4. Version 1 is found in "older" laptops and uses 4 bytes per
0052 packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes
0053 per packet, and provides additional features such as position of two fingers,
0054 and width of the touch.  Hardware version 3 uses 6 bytes per packet (and
0055 for 2 fingers the concatenation of two 6 bytes packets) and allows tracking
0056 of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can
0057 combine a status packet with multiple head or motion packets. Hardware version
0058 4 allows tracking up to 5 fingers.
0059 
0060 Some Hardware version 3 and version 4 also have a trackpoint which uses a
0061 separate packet format. It is also 6 bytes per packet.
0062 
0063 The driver tries to support both hardware versions and should be compatible
0064 with the Xorg Synaptics touchpad driver and its graphical configuration
0065 utilities.
0066 
0067 Note that a mouse button is also associated with either the touchpad or the
0068 trackpoint when a trackpoint is available.  Disabling the Touchpad in xorg
0069 (TouchPadOff=0) will also disable the buttons associated with the touchpad.
0070 
0071 Additionally the operation of the touchpad can be altered by adjusting the
0072 contents of some of its internal registers. These registers are represented
0073 by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
0074 that can be read from and written to.
0075 
0076 Currently only the registers for hardware version 1 are somewhat understood.
0077 Hardware version 2 seems to use some of the same registers but it is not
0078 known whether the bits in the registers represent the same thing or might
0079 have changed their meaning.
0080 
0081 On top of that, some register settings have effect only when the touchpad is
0082 in relative mode and not in absolute mode. As the Linux Elantech touchpad
0083 driver always puts the hardware into absolute mode not all information
0084 mentioned below can be used immediately. But because there is no freely
0085 available Elantech documentation the information is provided here anyway for
0086 completeness sake.
0087 
0088 
0089 Extra knobs
0090 ~~~~~~~~~~~
0091 
0092 Currently the Linux Elantech touchpad driver provides three extra knobs under
0093 /sys/bus/serio/drivers/psmouse/serio? for the user.
0094 
0095 * debug
0096 
0097    Turn different levels of debugging ON or OFF.
0098 
0099    By echoing "0" to this file all debugging will be turned OFF.
0100 
0101    Currently a value of "1" will turn on some basic debugging and a value of
0102    "2" will turn on packet debugging. For hardware version 1 the default is
0103    OFF. For version 2 the default is "1".
0104 
0105    Turning packet debugging on will make the driver dump every packet
0106    received to the syslog before processing it. Be warned that this can
0107    generate quite a lot of data!
0108 
0109 * paritycheck
0110 
0111    Turns parity checking ON or OFF.
0112 
0113    By echoing "0" to this file parity checking will be turned OFF. Any
0114    non-zero value will turn it ON. For hardware version 1 the default is ON.
0115    For version 2 the default it is OFF.
0116 
0117    Hardware version 1 provides basic data integrity verification by
0118    calculating a parity bit for the last 3 bytes of each packet. The driver
0119    can check these bits and reject any packet that appears corrupted. Using
0120    this knob you can bypass that check.
0121 
0122    Hardware version 2 does not provide the same parity bits. Only some basic
0123    data consistency checking can be done. For now checking is disabled by
0124    default. Currently even turning it on will do nothing.
0125 
0126 * crc_enabled
0127 
0128    Sets crc_enabled to 0/1. The name "crc_enabled" is the official name of
0129    this integrity check, even though it is not an actual cyclic redundancy
0130    check.
0131 
0132    Depending on the state of crc_enabled, certain basic data integrity
0133    verification is done by the driver on hardware version 3 and 4. The
0134    driver will reject any packet that appears corrupted. Using this knob,
0135    The state of crc_enabled can be altered with this knob.
0136 
0137    Reading the crc_enabled value will show the active value. Echoing
0138    "0" or "1" to this file will set the state to "0" or "1".
0139 
0140 Differentiating hardware versions
0141 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0142 
0143 To detect the hardware version, read the version number as param[0].param[1].param[2]::
0144 
0145  4 bytes version: (after the arrow is the name given in the Dell-provided driver)
0146  02.00.22 => EF013
0147  02.06.00 => EF019
0148 
0149 In the wild, there appear to be more versions, such as 00.01.64, 01.00.21,
0150 02.00.00, 02.00.04, 02.00.06::
0151 
0152  6 bytes:
0153  02.00.30 => EF113
0154  02.08.00 => EF023
0155  02.08.XX => EF123
0156  02.0B.00 => EF215
0157  04.01.XX => Scroll_EF051
0158  04.02.XX => EF051
0159 
0160 In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There
0161 appears to be almost no difference, except for EF113, which does not report
0162 pressure/width and has different data consistency checks.
0163 
0164 Probably all the versions with param[0] <= 01 can be considered as
0165 4 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as
0166 4 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes.
0167 
0168 
0169 Hardware version 1
0170 ~~~~~~~~~~~~~~~~~~
0171 
0172 Registers
0173 ---------
0174 
0175 By echoing a hexadecimal value to a register it contents can be altered.
0176 
0177 For example::
0178 
0179    echo -n 0x16 > reg_10
0180 
0181 * reg_10::
0182 
0183    bit   7   6   5   4   3   2   1   0
0184          B   C   T   D   L   A   S   E
0185 
0186          E: 1 = enable smart edges unconditionally
0187          S: 1 = enable smart edges only when dragging
0188          A: 1 = absolute mode (needs 4 byte packets, see reg_11)
0189          L: 1 = enable drag lock (see reg_22)
0190          D: 1 = disable dynamic resolution
0191          T: 1 = disable tapping
0192          C: 1 = enable corner tap
0193          B: 1 = swap left and right button
0194 
0195 * reg_11::
0196 
0197    bit   7   6   5   4   3   2   1   0
0198          1   0   0   H   V   1   F   P
0199 
0200          P: 1 = enable parity checking for relative mode
0201          F: 1 = enable native 4 byte packet mode
0202          V: 1 = enable vertical scroll area
0203          H: 1 = enable horizontal scroll area
0204 
0205 * reg_20::
0206 
0207          single finger width?
0208 
0209 * reg_21::
0210 
0211          scroll area width (small: 0x40 ... wide: 0xff)
0212 
0213 * reg_22::
0214 
0215          drag lock time out (short: 0x14 ... long: 0xfe;
0216                              0xff = tap again to release)
0217 
0218 * reg_23::
0219 
0220          tap make timeout?
0221 
0222 * reg_24::
0223 
0224          tap release timeout?
0225 
0226 * reg_25::
0227 
0228          smart edge cursor speed (0x02 = slow, 0x03 = medium, 0x04 = fast)
0229 
0230 * reg_26::
0231 
0232          smart edge activation area width?
0233 
0234 
0235 Native relative mode 4 byte packet format
0236 -----------------------------------------
0237 
0238 byte 0::
0239 
0240    bit   7   6   5   4   3   2   1   0
0241          c   c  p2  p1   1   M   R   L
0242 
0243          L, R, M = 1 when Left, Right, Middle mouse button pressed
0244             some models have M as byte 3 odd parity bit
0245          when parity checking is enabled (reg_11, P = 1):
0246             p1..p2 = byte 1 and 2 odd parity bit
0247          c = 1 when corner tap detected
0248 
0249 byte 1::
0250 
0251    bit   7   6   5   4   3   2   1   0
0252         dx7 dx6 dx5 dx4 dx3 dx2 dx1 dx0
0253 
0254          dx7..dx0 = x movement;   positive = right, negative = left
0255          byte 1 = 0xf0 when corner tap detected
0256 
0257 byte 2::
0258 
0259    bit   7   6   5   4   3   2   1   0
0260         dy7 dy6 dy5 dy4 dy3 dy2 dy1 dy0
0261 
0262          dy7..dy0 = y movement;   positive = up,    negative = down
0263 
0264 byte 3::
0265 
0266    parity checking enabled (reg_11, P = 1):
0267 
0268       bit   7   6   5   4   3   2   1   0
0269             w   h  n1  n0  ds3 ds2 ds1 ds0
0270 
0271             normally:
0272                ds3..ds0 = scroll wheel amount and direction
0273                           positive = down or left
0274                           negative = up or right
0275             when corner tap detected:
0276                ds0 = 1 when top right corner tapped
0277                ds1 = 1 when bottom right corner tapped
0278                ds2 = 1 when bottom left corner tapped
0279                ds3 = 1 when top left corner tapped
0280             n1..n0 = number of fingers on touchpad
0281                only models with firmware 2.x report this, models with
0282                firmware 1.x seem to map one, two and three finger taps
0283                directly to L, M and R mouse buttons
0284             h = 1 when horizontal scroll action
0285             w = 1 when wide finger touch?
0286 
0287    otherwise (reg_11, P = 0):
0288 
0289       bit   7   6   5   4   3   2   1   0
0290            ds7 ds6 ds5 ds4 ds3 ds2 ds1 ds0
0291 
0292             ds7..ds0 = vertical scroll amount and direction
0293                        negative = up
0294                        positive = down
0295 
0296 
0297 Native absolute mode 4 byte packet format
0298 -----------------------------------------
0299 
0300 EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and
0301 when 1 finger is touching, the first 2 position reports must be discarded.
0302 This counting is reset whenever a different number of fingers is reported.
0303 
0304 byte 0::
0305 
0306    firmware version 1.x:
0307 
0308       bit   7   6   5   4   3   2   1   0
0309             D   U  p1  p2   1  p3   R   L
0310 
0311             L, R = 1 when Left, Right mouse button pressed
0312             p1..p3 = byte 1..3 odd parity bit
0313             D, U = 1 when rocker switch pressed Up, Down
0314 
0315    firmware version 2.x:
0316 
0317       bit   7   6   5   4   3   2   1   0
0318            n1  n0  p2  p1   1  p3   R   L
0319 
0320             L, R = 1 when Left, Right mouse button pressed
0321             p1..p3 = byte 1..3 odd parity bit
0322             n1..n0 = number of fingers on touchpad
0323 
0324 byte 1::
0325 
0326    firmware version 1.x:
0327 
0328       bit   7   6   5   4   3   2   1   0
0329             f   0  th  tw  x9  x8  y9  y8
0330 
0331             tw = 1 when two finger touch
0332             th = 1 when three finger touch
0333             f  = 1 when finger touch
0334 
0335    firmware version 2.x:
0336 
0337       bit   7   6   5   4   3   2   1   0
0338             .   .   .   .  x9  x8  y9  y8
0339 
0340 byte 2::
0341 
0342    bit   7   6   5   4   3   2   1   0
0343         x7  x6  x5  x4  x3  x2  x1  x0
0344 
0345          x9..x0 = absolute x value (horizontal)
0346 
0347 byte 3::
0348 
0349    bit   7   6   5   4   3   2   1   0
0350         y7  y6  y5  y4  y3  y2  y1  y0
0351 
0352          y9..y0 = absolute y value (vertical)
0353 
0354 
0355 Hardware version 2
0356 ~~~~~~~~~~~~~~~~~~
0357 
0358 
0359 Registers
0360 ---------
0361 
0362 By echoing a hexadecimal value to a register it contents can be altered.
0363 
0364 For example::
0365 
0366    echo -n 0x56 > reg_10
0367 
0368 * reg_10::
0369 
0370    bit   7   6   5   4   3   2   1   0
0371          0   1   0   1   0   1   D   0
0372 
0373          D: 1 = enable drag and drop
0374 
0375 * reg_11::
0376 
0377    bit   7   6   5   4   3   2   1   0
0378          1   0   0   0   S   0   1   0
0379 
0380          S: 1 = enable vertical scroll
0381 
0382 * reg_21::
0383 
0384          unknown (0x00)
0385 
0386 * reg_22::
0387 
0388          drag and drop release time out (short: 0x70 ... long 0x7e;
0389                                    0x7f = never i.e. tap again to release)
0390 
0391 
0392 Native absolute mode 6 byte packet format
0393 -----------------------------------------
0394 
0395 Parity checking and packet re-synchronization
0396 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0397 
0398 There is no parity checking, however some consistency checks can be performed.
0399 
0400 For instance for EF113::
0401 
0402         SA1= packet[0];
0403         A1 = packet[1];
0404         B1 = packet[2];
0405         SB1= packet[3];
0406         C1 = packet[4];
0407         D1 = packet[5];
0408         if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1
0409             (((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed)
0410             (((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2
0411             (((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4
0412             (((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed)
0413             (((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00))  ) // check Byte 5
0414                 // error detected
0415 
0416 For all the other ones, there are just a few constant bits::
0417 
0418         if( ((packet[0] & 0x0C) != 0x04) ||
0419             ((packet[3] & 0x0f) != 0x02) )
0420                 // error detected
0421 
0422 
0423 In case an error is detected, all the packets are shifted by one (and packet[0] is discarded).
0424 
0425 One/Three finger touch
0426 ^^^^^^^^^^^^^^^^^^^^^^
0427 
0428 byte 0::
0429 
0430    bit   7   6   5   4   3   2   1   0
0431          n1  n0  w3  w2   .   .   R   L
0432 
0433          L, R = 1 when Left, Right mouse button pressed
0434          n1..n0 = number of fingers on touchpad
0435 
0436 byte 1::
0437 
0438    bit   7   6   5   4   3   2   1   0
0439          p7  p6  p5  p4 x11 x10 x9  x8
0440 
0441 byte 2::
0442 
0443    bit   7   6   5   4   3   2   1   0
0444          x7  x6  x5  x4  x3  x2  x1  x0
0445 
0446          x11..x0 = absolute x value (horizontal)
0447 
0448 byte 3::
0449 
0450    bit   7   6   5   4   3   2   1   0
0451          n4  vf  w1  w0   .   .   .  b2
0452 
0453          n4 = set if more than 3 fingers (only in 3 fingers mode)
0454          vf = a kind of flag ? (only on EF123, 0 when finger is over one
0455               of the buttons, 1 otherwise)
0456          w3..w0 = width of the finger touch (not EF113)
0457          b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed:
0458                 0 = none
0459                 1 = Left
0460                 2 = Right
0461                 3 = Middle (Left and Right)
0462                 4 = Forward
0463                 5 = Back
0464                 6 = Another one
0465                 7 = Another one
0466 
0467 byte 4::
0468 
0469    bit   7   6   5   4   3   2   1   0
0470         p3  p1  p2  p0  y11 y10 y9  y8
0471 
0472          p7..p0 = pressure (not EF113)
0473 
0474 byte 5::
0475 
0476    bit   7   6   5   4   3   2   1   0
0477         y7  y6  y5  y4  y3  y2  y1  y0
0478 
0479          y11..y0 = absolute y value (vertical)
0480 
0481 
0482 Two finger touch
0483 ^^^^^^^^^^^^^^^^
0484 
0485 Note that the two pairs of coordinates are not exactly the coordinates of the
0486 two fingers, but only the pair of the lower-left and upper-right coordinates.
0487 So the actual fingers might be situated on the other diagonal of the square
0488 defined by these two points.
0489 
0490 byte 0::
0491 
0492    bit   7   6   5   4   3   2   1   0
0493         n1  n0  ay8 ax8  .   .   R   L
0494 
0495          L, R = 1 when Left, Right mouse button pressed
0496          n1..n0 = number of fingers on touchpad
0497 
0498 byte 1::
0499 
0500    bit   7   6   5   4   3   2   1   0
0501         ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
0502 
0503          ax8..ax0 = lower-left finger absolute x value
0504 
0505 byte 2::
0506 
0507    bit   7   6   5   4   3   2   1   0
0508         ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0
0509 
0510          ay8..ay0 = lower-left finger absolute y value
0511 
0512 byte 3::
0513 
0514    bit   7   6   5   4   3   2   1   0
0515          .   .  by8 bx8  .   .   .   .
0516 
0517 byte 4::
0518 
0519    bit   7   6   5   4   3   2   1   0
0520         bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
0521 
0522          bx8..bx0 = upper-right finger absolute x value
0523 
0524 byte 5::
0525 
0526    bit   7   6   5   4   3   2   1   0
0527         by7 by8 by5 by4 by3 by2 by1 by0
0528 
0529          by8..by0 = upper-right finger absolute y value
0530 
0531 Hardware version 3
0532 ~~~~~~~~~~~~~~~~~~
0533 
0534 Registers
0535 ---------
0536 
0537 * reg_10::
0538 
0539    bit   7   6   5   4   3   2   1   0
0540          0   0   0   0   R   F   T   A
0541 
0542          A: 1 = enable absolute tracking
0543          T: 1 = enable two finger mode auto correct
0544          F: 1 = disable ABS Position Filter
0545          R: 1 = enable real hardware resolution
0546 
0547 Native absolute mode 6 byte packet format
0548 -----------------------------------------
0549 
0550 1 and 3 finger touch shares the same 6-byte packet format, except that
0551 3 finger touch only reports the position of the center of all three fingers.
0552 
0553 Firmware would send 12 bytes of data for 2 finger touch.
0554 
0555 Note on debounce:
0556 In case the box has unstable power supply or other electricity issues, or
0557 when number of finger changes, F/W would send "debounce packet" to inform
0558 driver that the hardware is in debounce status.
0559 The debouce packet has the following signature::
0560 
0561     byte 0: 0xc4
0562     byte 1: 0xff
0563     byte 2: 0xff
0564     byte 3: 0x02
0565     byte 4: 0xff
0566     byte 5: 0xff
0567 
0568 When we encounter this kind of packet, we just ignore it.
0569 
0570 One/Three finger touch
0571 ^^^^^^^^^^^^^^^^^^^^^^
0572 
0573 byte 0::
0574 
0575    bit   7   6   5   4   3   2   1   0
0576         n1  n0  w3  w2   0   1   R   L
0577 
0578         L, R = 1 when Left, Right mouse button pressed
0579         n1..n0 = number of fingers on touchpad
0580 
0581 byte 1::
0582 
0583    bit   7   6   5   4   3   2   1   0
0584         p7  p6  p5  p4 x11 x10  x9  x8
0585 
0586 byte 2::
0587 
0588    bit   7   6   5   4   3   2   1   0
0589         x7  x6  x5  x4  x3  x2  x1  x0
0590 
0591         x11..x0 = absolute x value (horizontal)
0592 
0593 byte 3::
0594 
0595    bit   7   6   5   4   3   2   1   0
0596          0   0  w1  w0   0   0   1   0
0597 
0598          w3..w0 = width of the finger touch
0599 
0600 byte 4::
0601 
0602    bit   7   6   5   4   3   2   1   0
0603         p3  p1  p2  p0  y11 y10 y9  y8
0604 
0605         p7..p0 = pressure
0606 
0607 byte 5::
0608 
0609    bit   7   6   5   4   3   2   1   0
0610         y7  y6  y5  y4  y3  y2  y1  y0
0611 
0612         y11..y0 = absolute y value (vertical)
0613 
0614 Two finger touch
0615 ^^^^^^^^^^^^^^^^
0616 
0617 The packet format is exactly the same for two finger touch, except the hardware
0618 sends two 6 byte packets. The first packet contains data for the first finger,
0619 the second packet has data for the second finger. So for two finger touch a
0620 total of 12 bytes are sent.
0621 
0622 Hardware version 4
0623 ~~~~~~~~~~~~~~~~~~
0624 
0625 Registers
0626 ---------
0627 
0628 * reg_07::
0629 
0630    bit   7   6   5   4   3   2   1   0
0631          0   0   0   0   0   0   0   A
0632 
0633          A: 1 = enable absolute tracking
0634 
0635 Native absolute mode 6 byte packet format
0636 -----------------------------------------
0637 
0638 v4 hardware is a true multitouch touchpad, capable of tracking up to 5 fingers.
0639 Unfortunately, due to PS/2's limited bandwidth, its packet format is rather
0640 complex.
0641 
0642 Whenever the numbers or identities of the fingers changes, the hardware sends a
0643 status packet to indicate how many and which fingers is on touchpad, followed by
0644 head packets or motion packets. A head packet contains data of finger id, finger
0645 position (absolute x, y values), width, and pressure. A motion packet contains
0646 two fingers' position delta.
0647 
0648 For example, when status packet tells there are 2 fingers on touchpad, then we
0649 can expect two following head packets. If the finger status doesn't change,
0650 the following packets would be motion packets, only sending delta of finger
0651 position, until we receive a status packet.
0652 
0653 One exception is one finger touch. when a status packet tells us there is only
0654 one finger, the hardware would just send head packets afterwards.
0655 
0656 Status packet
0657 ^^^^^^^^^^^^^
0658 
0659 byte 0::
0660 
0661    bit   7   6   5   4   3   2   1   0
0662          .   .   .   .   0   1   R   L
0663 
0664          L, R = 1 when Left, Right mouse button pressed
0665 
0666 byte 1::
0667 
0668    bit   7   6   5   4   3   2   1   0
0669          .   .   . ft4 ft3 ft2 ft1 ft0
0670 
0671          ft4 ft3 ft2 ft1 ft0 ftn = 1 when finger n is on touchpad
0672 
0673 byte 2::
0674 
0675    not used
0676 
0677 byte 3::
0678 
0679    bit   7   6   5   4   3   2   1   0
0680          .   .   .   1   0   0   0   0
0681 
0682          constant bits
0683 
0684 byte 4::
0685 
0686    bit   7   6   5   4   3   2   1   0
0687          p   .   .   .   .   .   .   .
0688 
0689          p = 1 for palm
0690 
0691 byte 5::
0692 
0693    not used
0694 
0695 Head packet
0696 ^^^^^^^^^^^
0697 
0698 byte 0::
0699 
0700    bit   7   6   5   4   3   2   1   0
0701         w3  w2  w1  w0   0   1   R   L
0702 
0703         L, R = 1 when Left, Right mouse button pressed
0704         w3..w0 = finger width (spans how many trace lines)
0705 
0706 byte 1::
0707 
0708    bit   7   6   5   4   3   2   1   0
0709         p7  p6  p5  p4 x11 x10  x9  x8
0710 
0711 byte 2::
0712 
0713    bit   7   6   5   4   3   2   1   0
0714         x7  x6  x5  x4  x3  x2  x1  x0
0715 
0716         x11..x0 = absolute x value (horizontal)
0717 
0718 byte 3::
0719 
0720    bit   7   6   5   4   3   2   1   0
0721        id2 id1 id0   1   0   0   0   1
0722 
0723        id2..id0 = finger id
0724 
0725 byte 4::
0726 
0727    bit   7   6   5   4   3   2   1   0
0728         p3  p1  p2  p0  y11 y10 y9  y8
0729 
0730         p7..p0 = pressure
0731 
0732 byte 5::
0733 
0734    bit   7   6   5   4   3   2   1   0
0735         y7  y6  y5  y4  y3  y2  y1  y0
0736 
0737         y11..y0 = absolute y value (vertical)
0738 
0739 Motion packet
0740 ^^^^^^^^^^^^^
0741 
0742 byte 0::
0743 
0744    bit   7   6   5   4   3   2   1   0
0745        id2 id1 id0   w   0   1   R   L
0746 
0747        L, R = 1 when Left, Right mouse button pressed
0748        id2..id0 = finger id
0749        w = 1 when delta overflows (> 127 or < -128), in this case
0750        firmware sends us (delta x / 5) and (delta y  / 5)
0751 
0752 byte 1::
0753 
0754    bit   7   6   5   4   3   2   1   0
0755         x7  x6  x5  x4  x3  x2  x1  x0
0756 
0757         x7..x0 = delta x (two's complement)
0758 
0759 byte 2::
0760 
0761    bit   7   6   5   4   3   2   1   0
0762         y7  y6  y5  y4  y3  y2  y1  y0
0763 
0764         y7..y0 = delta y (two's complement)
0765 
0766 byte 3::
0767 
0768    bit   7   6   5   4   3   2   1   0
0769        id2 id1 id0   1   0   0   1   0
0770 
0771        id2..id0 = finger id
0772 
0773 byte 4::
0774 
0775    bit   7   6   5   4   3   2   1   0
0776         x7  x6  x5  x4  x3  x2  x1  x0
0777 
0778         x7..x0 = delta x (two's complement)
0779 
0780 byte 5::
0781 
0782    bit   7   6   5   4   3   2   1   0
0783         y7  y6  y5  y4  y3  y2  y1  y0
0784 
0785         y7..y0 = delta y (two's complement)
0786 
0787         byte 0 ~ 2 for one finger
0788         byte 3 ~ 5 for another
0789 
0790 
0791 Trackpoint (for Hardware version 3 and 4)
0792 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0793 
0794 Registers
0795 ---------
0796 
0797 No special registers have been identified.
0798 
0799 Native relative mode 6 byte packet format
0800 -----------------------------------------
0801 
0802 Status Packet
0803 ^^^^^^^^^^^^^
0804 
0805 byte 0::
0806 
0807    bit   7   6   5   4   3   2   1   0
0808          0   0  sx  sy   0   M   R   L
0809 
0810 byte 1::
0811 
0812    bit   7   6   5   4   3   2   1   0
0813        ~sx   0   0   0   0   0   0   0
0814 
0815 byte 2::
0816 
0817    bit   7   6   5   4   3   2   1   0
0818        ~sy   0   0   0   0   0   0   0
0819 
0820 byte 3::
0821 
0822    bit   7   6   5   4   3   2   1   0
0823          0   0 ~sy ~sx   0   1   1   0
0824 
0825 byte 4::
0826 
0827    bit   7   6   5   4   3   2   1   0
0828         x7  x6  x5  x4  x3  x2  x1  x0
0829 
0830 byte 5::
0831 
0832    bit   7   6   5   4   3   2   1   0
0833         y7  y6  y5  y4  y3  y2  y1  y0
0834 
0835 
0836          x and y are written in two's complement spread
0837              over 9 bits with sx/sy the relative top bit and
0838              x7..x0 and y7..y0 the lower bits.
0839          ~sx is the inverse of sx, ~sy is the inverse of sy.
0840          The sign of y is opposite to what the input driver
0841              expects for a relative movement