diff options
| author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
|---|---|---|
| committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
| commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
| tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /Documentation/input | |
| parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
| parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) | |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'Documentation/input')
| -rw-r--r-- | Documentation/input/cma3000_d0x.txt | 115 | ||||
| -rw-r--r-- | Documentation/input/elantech.txt | 123 | ||||
| -rw-r--r-- | Documentation/input/event-codes.txt | 262 | ||||
| -rw-r--r-- | Documentation/input/ff.txt | 4 | ||||
| -rw-r--r-- | Documentation/input/joystick-parport.txt | 2 | ||||
| -rw-r--r-- | Documentation/input/multi-touch-protocol.txt | 53 | ||||
| -rw-r--r-- | Documentation/input/ntrig.txt | 126 | ||||
| -rw-r--r-- | Documentation/input/rotary-encoder.txt | 15 | ||||
| -rw-r--r-- | Documentation/input/walkera0701.txt | 2 |
9 files changed, 656 insertions, 46 deletions
diff --git a/Documentation/input/cma3000_d0x.txt b/Documentation/input/cma3000_d0x.txt new file mode 100644 index 000000000000..29d088db4afd --- /dev/null +++ b/Documentation/input/cma3000_d0x.txt | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | Kernel driver for CMA3000-D0x | ||
| 2 | ============================ | ||
| 3 | |||
| 4 | Supported chips: | ||
| 5 | * VTI CMA3000-D0x | ||
| 6 | Datasheet: | ||
| 7 | CMA3000-D0X Product Family Specification 8281000A.02.pdf | ||
| 8 | <http://www.vti.fi/en/> | ||
| 9 | |||
| 10 | Author: Hemanth V <hemanthv@ti.com> | ||
| 11 | |||
| 12 | |||
| 13 | Description | ||
| 14 | ----------- | ||
| 15 | CMA3000 Tri-axis accelerometer supports Motion detect, Measurement and | ||
| 16 | Free fall modes. | ||
| 17 | |||
| 18 | Motion Detect Mode: Its the low power mode where interrupts are generated only | ||
| 19 | when motion exceeds the defined thresholds. | ||
| 20 | |||
| 21 | Measurement Mode: This mode is used to read the acceleration data on X,Y,Z | ||
| 22 | axis and supports 400, 100, 40 Hz sample frequency. | ||
| 23 | |||
| 24 | Free fall Mode: This mode is intended to save system resources. | ||
| 25 | |||
| 26 | Threshold values: Chip supports defining threshold values for above modes | ||
| 27 | which includes time and g value. Refer product specifications for more details. | ||
| 28 | |||
| 29 | CMA3000 chip supports mutually exclusive I2C and SPI interfaces for | ||
| 30 | communication, currently the driver supports I2C based communication only. | ||
| 31 | Initial configuration for bus mode is set in non volatile memory and can later | ||
| 32 | be modified through bus interface command. | ||
| 33 | |||
| 34 | Driver reports acceleration data through input subsystem. It generates ABS_MISC | ||
| 35 | event with value 1 when free fall is detected. | ||
| 36 | |||
| 37 | Platform data need to be configured for initial default values. | ||
| 38 | |||
| 39 | Platform Data | ||
| 40 | ------------- | ||
| 41 | fuzz_x: Noise on X Axis | ||
| 42 | |||
| 43 | fuzz_y: Noise on Y Axis | ||
| 44 | |||
| 45 | fuzz_z: Noise on Z Axis | ||
| 46 | |||
| 47 | g_range: G range in milli g i.e 2000 or 8000 | ||
| 48 | |||
| 49 | mode: Default Operating mode | ||
| 50 | |||
| 51 | mdthr: Motion detect g range threshold value | ||
| 52 | |||
| 53 | mdfftmr: Motion detect and free fall time threshold value | ||
| 54 | |||
| 55 | ffthr: Free fall g range threshold value | ||
| 56 | |||
| 57 | Input Interface | ||
| 58 | -------------- | ||
| 59 | Input driver version is 1.0.0 | ||
| 60 | Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0 | ||
| 61 | Input device name: "cma3000-accelerometer" | ||
| 62 | Supported events: | ||
| 63 | Event type 0 (Sync) | ||
| 64 | Event type 3 (Absolute) | ||
| 65 | Event code 0 (X) | ||
| 66 | Value 47 | ||
| 67 | Min -8000 | ||
| 68 | Max 8000 | ||
| 69 | Fuzz 200 | ||
| 70 | Event code 1 (Y) | ||
| 71 | Value -28 | ||
| 72 | Min -8000 | ||
| 73 | Max 8000 | ||
| 74 | Fuzz 200 | ||
| 75 | Event code 2 (Z) | ||
| 76 | Value 905 | ||
| 77 | Min -8000 | ||
| 78 | Max 8000 | ||
| 79 | Fuzz 200 | ||
| 80 | Event code 40 (Misc) | ||
| 81 | Value 0 | ||
| 82 | Min 0 | ||
| 83 | Max 1 | ||
| 84 | Event type 4 (Misc) | ||
| 85 | |||
| 86 | |||
| 87 | Register/Platform parameters Description | ||
| 88 | ---------------------------------------- | ||
| 89 | |||
| 90 | mode: | ||
| 91 | 0: power down mode | ||
| 92 | 1: 100 Hz Measurement mode | ||
| 93 | 2: 400 Hz Measurement mode | ||
| 94 | 3: 40 Hz Measurement mode | ||
| 95 | 4: Motion Detect mode (default) | ||
| 96 | 5: 100 Hz Free fall mode | ||
| 97 | 6: 40 Hz Free fall mode | ||
| 98 | 7: Power off mode | ||
| 99 | |||
| 100 | grange: | ||
| 101 | 2000: 2000 mg or 2G Range | ||
| 102 | 8000: 8000 mg or 8G Range | ||
| 103 | |||
| 104 | mdthr: | ||
| 105 | X: X * 71mg (8G Range) | ||
| 106 | X: X * 18mg (2G Range) | ||
| 107 | |||
| 108 | mdfftmr: | ||
| 109 | X: (X & 0x70) * 100 ms (MDTMR) | ||
| 110 | (X & 0x0F) * 2.5 ms (FFTMR 400 Hz) | ||
| 111 | (X & 0x0F) * 10 ms (FFTMR 100 Hz) | ||
| 112 | |||
| 113 | ffthr: | ||
| 114 | X: (X >> 2) * 18mg (2G Range) | ||
| 115 | X: (X & 0x0F) * 71 mg (8G Range) | ||
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt index 56941ae1f5db..db798af5ef98 100644 --- a/Documentation/input/elantech.txt +++ b/Documentation/input/elantech.txt | |||
| @@ -34,7 +34,8 @@ Contents | |||
| 34 | Currently the Linux Elantech touchpad driver is aware of two different | 34 | Currently the Linux Elantech touchpad driver is aware of two different |
| 35 | hardware versions unimaginatively called version 1 and version 2. Version 1 | 35 | hardware versions unimaginatively called version 1 and version 2. Version 1 |
| 36 | is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to | 36 | is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to |
| 37 | be introduced with the EeePC and uses 6 bytes per packet. | 37 | be introduced with the EeePC and uses 6 bytes per packet, and provides |
| 38 | additional features such as position of two fingers, and width of the touch. | ||
| 38 | 39 | ||
| 39 | The driver tries to support both hardware versions and should be compatible | 40 | The driver tries to support both hardware versions and should be compatible |
| 40 | with the Xorg Synaptics touchpad driver and its graphical configuration | 41 | with the Xorg Synaptics touchpad driver and its graphical configuration |
| @@ -94,18 +95,44 @@ Currently the Linux Elantech touchpad driver provides two extra knobs under | |||
| 94 | can check these bits and reject any packet that appears corrupted. Using | 95 | can check these bits and reject any packet that appears corrupted. Using |
| 95 | this knob you can bypass that check. | 96 | this knob you can bypass that check. |
| 96 | 97 | ||
| 97 | It is not known yet whether hardware version 2 provides the same parity | 98 | Hardware version 2 does not provide the same parity bits. Only some basic |
| 98 | bits. Hence checking is disabled by default. Currently even turning it on | 99 | data consistency checking can be done. For now checking is disabled by |
| 99 | will do nothing. | 100 | default. Currently even turning it on will do nothing. |
| 100 | |||
| 101 | 101 | ||
| 102 | ///////////////////////////////////////////////////////////////////////////// | 102 | ///////////////////////////////////////////////////////////////////////////// |
| 103 | 103 | ||
| 104 | 3. Differentiating hardware versions | ||
| 105 | ================================= | ||
| 106 | |||
| 107 | To detect the hardware version, read the version number as param[0].param[1].param[2] | ||
| 108 | |||
| 109 | 4 bytes version: (after the arrow is the name given in the Dell-provided driver) | ||
| 110 | 02.00.22 => EF013 | ||
| 111 | 02.06.00 => EF019 | ||
| 112 | In the wild, there appear to be more versions, such as 00.01.64, 01.00.21, | ||
| 113 | 02.00.00, 02.00.04, 02.00.06. | ||
| 114 | |||
| 115 | 6 bytes: | ||
| 116 | 02.00.30 => EF113 | ||
| 117 | 02.08.00 => EF023 | ||
| 118 | 02.08.XX => EF123 | ||
| 119 | 02.0B.00 => EF215 | ||
| 120 | 04.01.XX => Scroll_EF051 | ||
| 121 | 04.02.XX => EF051 | ||
| 122 | In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There | ||
| 123 | appears to be almost no difference, except for EF113, which does not report | ||
| 124 | pressure/width and has different data consistency checks. | ||
| 125 | |||
| 126 | Probably all the versions with param[0] <= 01 can be considered as | ||
| 127 | 4 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as | ||
| 128 | 4 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes. | ||
| 129 | |||
| 130 | ///////////////////////////////////////////////////////////////////////////// | ||
| 104 | 131 | ||
| 105 | 3. Hardware version 1 | 132 | 4. Hardware version 1 |
| 106 | ================== | 133 | ================== |
| 107 | 134 | ||
| 108 | 3.1 Registers | 135 | 4.1 Registers |
| 109 | ~~~~~~~~~ | 136 | ~~~~~~~~~ |
| 110 | 137 | ||
| 111 | By echoing a hexadecimal value to a register it contents can be altered. | 138 | By echoing a hexadecimal value to a register it contents can be altered. |
| @@ -168,7 +195,7 @@ For example: | |||
| 168 | smart edge activation area width? | 195 | smart edge activation area width? |
| 169 | 196 | ||
| 170 | 197 | ||
| 171 | 3.2 Native relative mode 4 byte packet format | 198 | 4.2 Native relative mode 4 byte packet format |
| 172 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 199 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 173 | 200 | ||
| 174 | byte 0: | 201 | byte 0: |
| @@ -226,9 +253,13 @@ byte 3: | |||
| 226 | positive = down | 253 | positive = down |
| 227 | 254 | ||
| 228 | 255 | ||
| 229 | 3.3 Native absolute mode 4 byte packet format | 256 | 4.3 Native absolute mode 4 byte packet format |
| 230 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 257 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 231 | 258 | ||
| 259 | EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and | ||
| 260 | when 1 finger is touching, the first 2 position reports must be discarded. | ||
| 261 | This counting is reset whenever a different number of fingers is reported. | ||
| 262 | |||
| 232 | byte 0: | 263 | byte 0: |
| 233 | firmware version 1.x: | 264 | firmware version 1.x: |
| 234 | 265 | ||
| @@ -279,11 +310,11 @@ byte 3: | |||
| 279 | ///////////////////////////////////////////////////////////////////////////// | 310 | ///////////////////////////////////////////////////////////////////////////// |
| 280 | 311 | ||
| 281 | 312 | ||
| 282 | 4. Hardware version 2 | 313 | 5. Hardware version 2 |
| 283 | ================== | 314 | ================== |
| 284 | 315 | ||
| 285 | 316 | ||
| 286 | 4.1 Registers | 317 | 5.1 Registers |
| 287 | ~~~~~~~~~ | 318 | ~~~~~~~~~ |
| 288 | 319 | ||
| 289 | By echoing a hexadecimal value to a register it contents can be altered. | 320 | By echoing a hexadecimal value to a register it contents can be altered. |
| @@ -316,16 +347,41 @@ For example: | |||
| 316 | 0x7f = never i.e. tap again to release) | 347 | 0x7f = never i.e. tap again to release) |
| 317 | 348 | ||
| 318 | 349 | ||
| 319 | 4.2 Native absolute mode 6 byte packet format | 350 | 5.2 Native absolute mode 6 byte packet format |
| 320 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 351 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 321 | 352 | 5.2.1 Parity checking and packet re-synchronization | |
| 322 | 4.2.1 One finger touch | 353 | There is no parity checking, however some consistency checks can be performed. |
| 354 | |||
| 355 | For instance for EF113: | ||
| 356 | SA1= packet[0]; | ||
| 357 | A1 = packet[1]; | ||
| 358 | B1 = packet[2]; | ||
| 359 | SB1= packet[3]; | ||
| 360 | C1 = packet[4]; | ||
| 361 | D1 = packet[5]; | ||
| 362 | if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1 | ||
| 363 | (((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed) | ||
| 364 | (((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2 | ||
| 365 | (((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4 | ||
| 366 | (((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed) | ||
| 367 | (((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00)) ) // check Byte 5 | ||
| 368 | // error detected | ||
| 369 | |||
| 370 | For all the other ones, there are just a few constant bits: | ||
| 371 | if( ((packet[0] & 0x0C) != 0x04) || | ||
| 372 | ((packet[3] & 0x0f) != 0x02) ) | ||
| 373 | // error detected | ||
| 374 | |||
| 375 | |||
| 376 | In case an error is detected, all the packets are shifted by one (and packet[0] is discarded). | ||
| 377 | |||
| 378 | 5.2.1 One/Three finger touch | ||
| 323 | ~~~~~~~~~~~~~~~~ | 379 | ~~~~~~~~~~~~~~~~ |
| 324 | 380 | ||
| 325 | byte 0: | 381 | byte 0: |
| 326 | 382 | ||
| 327 | bit 7 6 5 4 3 2 1 0 | 383 | bit 7 6 5 4 3 2 1 0 |
| 328 | n1 n0 . . . . R L | 384 | n1 n0 w3 w2 . . R L |
| 329 | 385 | ||
| 330 | L, R = 1 when Left, Right mouse button pressed | 386 | L, R = 1 when Left, Right mouse button pressed |
| 331 | n1..n0 = numbers of fingers on touchpad | 387 | n1..n0 = numbers of fingers on touchpad |
| @@ -333,24 +389,40 @@ byte 0: | |||
| 333 | byte 1: | 389 | byte 1: |
| 334 | 390 | ||
| 335 | bit 7 6 5 4 3 2 1 0 | 391 | bit 7 6 5 4 3 2 1 0 |
| 336 | . . . . . x10 x9 x8 | 392 | p7 p6 p5 p4 . x10 x9 x8 |
| 337 | 393 | ||
| 338 | byte 2: | 394 | byte 2: |
| 339 | 395 | ||
| 340 | bit 7 6 5 4 3 2 1 0 | 396 | bit 7 6 5 4 3 2 1 0 |
| 341 | x7 x6 x5 x4 x4 x2 x1 x0 | 397 | x7 x6 x5 x4 x3 x2 x1 x0 |
| 342 | 398 | ||
| 343 | x10..x0 = absolute x value (horizontal) | 399 | x10..x0 = absolute x value (horizontal) |
| 344 | 400 | ||
| 345 | byte 3: | 401 | byte 3: |
| 346 | 402 | ||
| 347 | bit 7 6 5 4 3 2 1 0 | 403 | bit 7 6 5 4 3 2 1 0 |
| 348 | . . . . . . . . | 404 | n4 vf w1 w0 . . . b2 |
| 405 | |||
| 406 | n4 = set if more than 3 fingers (only in 3 fingers mode) | ||
| 407 | vf = a kind of flag ? (only on EF123, 0 when finger is over one | ||
| 408 | of the buttons, 1 otherwise) | ||
| 409 | w3..w0 = width of the finger touch (not EF113) | ||
| 410 | b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed: | ||
| 411 | 0 = none | ||
| 412 | 1 = Left | ||
| 413 | 2 = Right | ||
| 414 | 3 = Middle (Left and Right) | ||
| 415 | 4 = Forward | ||
| 416 | 5 = Back | ||
| 417 | 6 = Another one | ||
| 418 | 7 = Another one | ||
| 349 | 419 | ||
| 350 | byte 4: | 420 | byte 4: |
| 351 | 421 | ||
| 352 | bit 7 6 5 4 3 2 1 0 | 422 | bit 7 6 5 4 3 2 1 0 |
| 353 | . . . . . . y9 y8 | 423 | p3 p1 p2 p0 . . y9 y8 |
| 424 | |||
| 425 | p7..p0 = pressure (not EF113) | ||
| 354 | 426 | ||
| 355 | byte 5: | 427 | byte 5: |
| 356 | 428 | ||
| @@ -363,6 +435,11 @@ byte 5: | |||
| 363 | 4.2.2 Two finger touch | 435 | 4.2.2 Two finger touch |
| 364 | ~~~~~~~~~~~~~~~~ | 436 | ~~~~~~~~~~~~~~~~ |
| 365 | 437 | ||
| 438 | Note that the two pairs of coordinates are not exactly the coordinates of the | ||
| 439 | two fingers, but only the pair of the lower-left and upper-right coordinates. | ||
| 440 | So the actual fingers might be situated on the other diagonal of the square | ||
| 441 | defined by these two points. | ||
| 442 | |||
| 366 | byte 0: | 443 | byte 0: |
| 367 | 444 | ||
| 368 | bit 7 6 5 4 3 2 1 0 | 445 | bit 7 6 5 4 3 2 1 0 |
| @@ -376,14 +453,14 @@ byte 1: | |||
| 376 | bit 7 6 5 4 3 2 1 0 | 453 | bit 7 6 5 4 3 2 1 0 |
| 377 | ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 | 454 | ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 |
| 378 | 455 | ||
| 379 | ax8..ax0 = first finger absolute x value | 456 | ax8..ax0 = lower-left finger absolute x value |
| 380 | 457 | ||
| 381 | byte 2: | 458 | byte 2: |
| 382 | 459 | ||
| 383 | bit 7 6 5 4 3 2 1 0 | 460 | bit 7 6 5 4 3 2 1 0 |
| 384 | ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 | 461 | ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 |
| 385 | 462 | ||
| 386 | ay8..ay0 = first finger absolute y value | 463 | ay8..ay0 = lower-left finger absolute y value |
| 387 | 464 | ||
| 388 | byte 3: | 465 | byte 3: |
| 389 | 466 | ||
| @@ -395,11 +472,11 @@ byte 4: | |||
| 395 | bit 7 6 5 4 3 2 1 0 | 472 | bit 7 6 5 4 3 2 1 0 |
| 396 | bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 | 473 | bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 |
| 397 | 474 | ||
| 398 | bx8..bx0 = second finger absolute x value | 475 | bx8..bx0 = upper-right finger absolute x value |
| 399 | 476 | ||
| 400 | byte 5: | 477 | byte 5: |
| 401 | 478 | ||
| 402 | bit 7 6 5 4 3 2 1 0 | 479 | bit 7 6 5 4 3 2 1 0 |
| 403 | by7 by8 by5 by4 by3 by2 by1 by0 | 480 | by7 by8 by5 by4 by3 by2 by1 by0 |
| 404 | 481 | ||
| 405 | by8..by0 = second finger absolute y value | 482 | by8..by0 = upper-right finger absolute y value |
diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt new file mode 100644 index 000000000000..23fcb05175be --- /dev/null +++ b/Documentation/input/event-codes.txt | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | The input protocol uses a map of types and codes to express input device values | ||
| 2 | to userspace. This document describes the types and codes and how and when they | ||
| 3 | may be used. | ||
| 4 | |||
| 5 | A single hardware event generates multiple input events. Each input event | ||
| 6 | contains the new value of a single data item. A special event type, EV_SYN, is | ||
| 7 | used to separate input events into packets of input data changes occurring at | ||
| 8 | the same moment in time. In the following, the term "event" refers to a single | ||
| 9 | input event encompassing a type, code, and value. | ||
| 10 | |||
| 11 | The input protocol is a stateful protocol. Events are emitted only when values | ||
| 12 | of event codes have changed. However, the state is maintained within the Linux | ||
| 13 | input subsystem; drivers do not need to maintain the state and may attempt to | ||
| 14 | emit unchanged values without harm. Userspace may obtain the current state of | ||
| 15 | event code values using the EVIOCG* ioctls defined in linux/input.h. The event | ||
| 16 | reports supported by a device are also provided by sysfs in | ||
| 17 | class/input/event*/device/capabilities/, and the properties of a device are | ||
| 18 | provided in class/input/event*/device/properties. | ||
| 19 | |||
| 20 | Types: | ||
| 21 | ========== | ||
| 22 | Types are groupings of codes under a logical input construct. Each type has a | ||
| 23 | set of applicable codes to be used in generating events. See the Codes section | ||
| 24 | for details on valid codes for each type. | ||
| 25 | |||
| 26 | * EV_SYN: | ||
| 27 | - Used as markers to separate events. Events may be separated in time or in | ||
| 28 | space, such as with the multitouch protocol. | ||
| 29 | |||
| 30 | * EV_KEY: | ||
| 31 | - Used to describe state changes of keyboards, buttons, or other key-like | ||
| 32 | devices. | ||
| 33 | |||
| 34 | * EV_REL: | ||
| 35 | - Used to describe relative axis value changes, e.g. moving the mouse 5 units | ||
| 36 | to the left. | ||
| 37 | |||
| 38 | * EV_ABS: | ||
| 39 | - Used to describe absolute axis value changes, e.g. describing the | ||
| 40 | coordinates of a touch on a touchscreen. | ||
| 41 | |||
| 42 | * EV_MSC: | ||
| 43 | - Used to describe miscellaneous input data that do not fit into other types. | ||
| 44 | |||
| 45 | * EV_SW: | ||
| 46 | - Used to describe binary state input switches. | ||
| 47 | |||
| 48 | * EV_LED: | ||
| 49 | - Used to turn LEDs on devices on and off. | ||
| 50 | |||
| 51 | * EV_SND: | ||
| 52 | - Used to output sound to devices. | ||
| 53 | |||
| 54 | * EV_REP: | ||
| 55 | - Used for autorepeating devices. | ||
| 56 | |||
| 57 | * EV_FF: | ||
| 58 | - Used to send force feedback commands to an input device. | ||
| 59 | |||
| 60 | * EV_PWR: | ||
| 61 | - A special type for power button and switch input. | ||
| 62 | |||
| 63 | * EV_FF_STATUS: | ||
| 64 | - Used to receive force feedback device status. | ||
| 65 | |||
| 66 | Codes: | ||
| 67 | ========== | ||
| 68 | Codes define the precise type of event. | ||
| 69 | |||
| 70 | EV_SYN: | ||
| 71 | ---------- | ||
| 72 | EV_SYN event values are undefined. Their usage is defined only by when they are | ||
| 73 | sent in the evdev event stream. | ||
| 74 | |||
| 75 | * SYN_REPORT: | ||
| 76 | - Used to synchronize and separate events into packets of input data changes | ||
| 77 | occurring at the same moment in time. For example, motion of a mouse may set | ||
| 78 | the REL_X and REL_Y values for one motion, then emit a SYN_REPORT. The next | ||
| 79 | motion will emit more REL_X and REL_Y values and send another SYN_REPORT. | ||
| 80 | |||
| 81 | * SYN_CONFIG: | ||
| 82 | - TBD | ||
| 83 | |||
| 84 | * SYN_MT_REPORT: | ||
| 85 | - Used to synchronize and separate touch events. See the | ||
| 86 | multi-touch-protocol.txt document for more information. | ||
| 87 | |||
| 88 | * SYN_DROPPED: | ||
| 89 | - Used to indicate buffer overrun in the evdev client's event queue. | ||
| 90 | Client should ignore all events up to and including next SYN_REPORT | ||
| 91 | event and query the device (using EVIOCG* ioctls) to obtain its | ||
| 92 | current state. | ||
| 93 | |||
| 94 | EV_KEY: | ||
| 95 | ---------- | ||
| 96 | EV_KEY events take the form KEY_<name> or BTN_<name>. For example, KEY_A is used | ||
| 97 | to represent the 'A' key on a keyboard. When a key is depressed, an event with | ||
| 98 | the key's code is emitted with value 1. When the key is released, an event is | ||
| 99 | emitted with value 0. Some hardware send events when a key is repeated. These | ||
| 100 | events have a value of 2. In general, KEY_<name> is used for keyboard keys, and | ||
| 101 | BTN_<name> is used for other types of momentary switch events. | ||
| 102 | |||
| 103 | A few EV_KEY codes have special meanings: | ||
| 104 | |||
| 105 | * BTN_TOOL_<name>: | ||
| 106 | - These codes are used in conjunction with input trackpads, tablets, and | ||
| 107 | touchscreens. These devices may be used with fingers, pens, or other tools. | ||
| 108 | When an event occurs and a tool is used, the corresponding BTN_TOOL_<name> | ||
| 109 | code should be set to a value of 1. When the tool is no longer interacting | ||
| 110 | with the input device, the BTN_TOOL_<name> code should be reset to 0. All | ||
| 111 | trackpads, tablets, and touchscreens should use at least one BTN_TOOL_<name> | ||
| 112 | code when events are generated. | ||
| 113 | |||
| 114 | * BTN_TOUCH: | ||
| 115 | BTN_TOUCH is used for touch contact. While an input tool is determined to be | ||
| 116 | within meaningful physical contact, the value of this property must be set | ||
| 117 | to 1. Meaningful physical contact may mean any contact, or it may mean | ||
| 118 | contact conditioned by an implementation defined property. For example, a | ||
| 119 | touchpad may set the value to 1 only when the touch pressure rises above a | ||
| 120 | certain value. BTN_TOUCH may be combined with BTN_TOOL_<name> codes. For | ||
| 121 | example, a pen tablet may set BTN_TOOL_PEN to 1 and BTN_TOUCH to 0 while the | ||
| 122 | pen is hovering over but not touching the tablet surface. | ||
| 123 | |||
| 124 | Note: For appropriate function of the legacy mousedev emulation driver, | ||
| 125 | BTN_TOUCH must be the first evdev code emitted in a synchronization frame. | ||
| 126 | |||
| 127 | Note: Historically a touch device with BTN_TOOL_FINGER and BTN_TOUCH was | ||
| 128 | interpreted as a touchpad by userspace, while a similar device without | ||
| 129 | BTN_TOOL_FINGER was interpreted as a touchscreen. For backwards compatibility | ||
| 130 | with current userspace it is recommended to follow this distinction. In the | ||
| 131 | future, this distinction will be deprecated and the device properties ioctl | ||
| 132 | EVIOCGPROP, defined in linux/input.h, will be used to convey the device type. | ||
| 133 | |||
| 134 | * BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP: | ||
| 135 | - These codes denote one, two, three, and four finger interaction on a | ||
| 136 | trackpad or touchscreen. For example, if the user uses two fingers and moves | ||
| 137 | them on the touchpad in an effort to scroll content on screen, | ||
| 138 | BTN_TOOL_DOUBLETAP should be set to value 1 for the duration of the motion. | ||
| 139 | Note that all BTN_TOOL_<name> codes and the BTN_TOUCH code are orthogonal in | ||
| 140 | purpose. A trackpad event generated by finger touches should generate events | ||
| 141 | for one code from each group. At most only one of these BTN_TOOL_<name> | ||
| 142 | codes should have a value of 1 during any synchronization frame. | ||
| 143 | |||
| 144 | Note: Historically some drivers emitted multiple of the finger count codes with | ||
| 145 | a value of 1 in the same synchronization frame. This usage is deprecated. | ||
| 146 | |||
| 147 | Note: In multitouch drivers, the input_mt_report_finger_count() function should | ||
| 148 | be used to emit these codes. Please see multi-touch-protocol.txt for details. | ||
| 149 | |||
| 150 | EV_REL: | ||
| 151 | ---------- | ||
| 152 | EV_REL events describe relative changes in a property. For example, a mouse may | ||
| 153 | move to the left by a certain number of units, but its absolute position in | ||
| 154 | space is unknown. If the absolute position is known, EV_ABS codes should be used | ||
| 155 | instead of EV_REL codes. | ||
| 156 | |||
| 157 | A few EV_REL codes have special meanings: | ||
| 158 | |||
| 159 | * REL_WHEEL, REL_HWHEEL: | ||
| 160 | - These codes are used for vertical and horizontal scroll wheels, | ||
| 161 | respectively. | ||
| 162 | |||
| 163 | EV_ABS: | ||
| 164 | ---------- | ||
| 165 | EV_ABS events describe absolute changes in a property. For example, a touchpad | ||
| 166 | may emit coordinates for a touch location. | ||
| 167 | |||
| 168 | A few EV_ABS codes have special meanings: | ||
| 169 | |||
| 170 | * ABS_DISTANCE: | ||
| 171 | - Used to describe the distance of a tool from an interaction surface. This | ||
| 172 | event should only be emitted while the tool is hovering, meaning in close | ||
| 173 | proximity of the device and while the value of the BTN_TOUCH code is 0. If | ||
| 174 | the input device may be used freely in three dimensions, consider ABS_Z | ||
| 175 | instead. | ||
| 176 | |||
| 177 | * ABS_MT_<name>: | ||
| 178 | - Used to describe multitouch input events. Please see | ||
| 179 | multi-touch-protocol.txt for details. | ||
| 180 | |||
| 181 | EV_SW: | ||
| 182 | ---------- | ||
| 183 | EV_SW events describe stateful binary switches. For example, the SW_LID code is | ||
| 184 | used to denote when a laptop lid is closed. | ||
| 185 | |||
| 186 | Upon binding to a device or resuming from suspend, a driver must report | ||
| 187 | the current switch state. This ensures that the device, kernel, and userspace | ||
| 188 | state is in sync. | ||
| 189 | |||
| 190 | Upon resume, if the switch state is the same as before suspend, then the input | ||
| 191 | subsystem will filter out the duplicate switch state reports. The driver does | ||
| 192 | not need to keep the state of the switch at any time. | ||
| 193 | |||
| 194 | EV_MSC: | ||
| 195 | ---------- | ||
| 196 | EV_MSC events are used for input and output events that do not fall under other | ||
| 197 | categories. | ||
| 198 | |||
| 199 | EV_LED: | ||
| 200 | ---------- | ||
| 201 | EV_LED events are used for input and output to set and query the state of | ||
| 202 | various LEDs on devices. | ||
| 203 | |||
| 204 | EV_REP: | ||
| 205 | ---------- | ||
| 206 | EV_REP events are used for specifying autorepeating events. | ||
| 207 | |||
| 208 | EV_SND: | ||
| 209 | ---------- | ||
| 210 | EV_SND events are used for sending sound commands to simple sound output | ||
| 211 | devices. | ||
| 212 | |||
| 213 | EV_FF: | ||
| 214 | ---------- | ||
| 215 | EV_FF events are used to initialize a force feedback capable device and to cause | ||
| 216 | such device to feedback. | ||
| 217 | |||
| 218 | EV_PWR: | ||
| 219 | ---------- | ||
| 220 | EV_PWR events are a special type of event used specifically for power | ||
| 221 | mangement. Its usage is not well defined. To be addressed later. | ||
| 222 | |||
| 223 | Guidelines: | ||
| 224 | ========== | ||
| 225 | The guidelines below ensure proper single-touch and multi-finger functionality. | ||
| 226 | For multi-touch functionality, see the multi-touch-protocol.txt document for | ||
| 227 | more information. | ||
| 228 | |||
| 229 | Mice: | ||
| 230 | ---------- | ||
| 231 | REL_{X,Y} must be reported when the mouse moves. BTN_LEFT must be used to report | ||
| 232 | the primary button press. BTN_{MIDDLE,RIGHT,4,5,etc.} should be used to report | ||
| 233 | further buttons of the device. REL_WHEEL and REL_HWHEEL should be used to report | ||
| 234 | scroll wheel events where available. | ||
| 235 | |||
| 236 | Touchscreens: | ||
| 237 | ---------- | ||
| 238 | ABS_{X,Y} must be reported with the location of the touch. BTN_TOUCH must be | ||
| 239 | used to report when a touch is active on the screen. | ||
| 240 | BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch | ||
| 241 | contact. BTN_TOOL_<name> events should be reported where possible. | ||
| 242 | |||
| 243 | Trackpads: | ||
| 244 | ---------- | ||
| 245 | Legacy trackpads that only provide relative position information must report | ||
| 246 | events like mice described above. | ||
| 247 | |||
| 248 | Trackpads that provide absolute touch position must report ABS_{X,Y} for the | ||
| 249 | location of the touch. BTN_TOUCH should be used to report when a touch is active | ||
| 250 | on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should | ||
| 251 | be used to report the number of touches active on the trackpad. | ||
| 252 | |||
| 253 | Tablets: | ||
| 254 | ---------- | ||
| 255 | BTN_TOOL_<name> events must be reported when a stylus or other tool is active on | ||
| 256 | the tablet. ABS_{X,Y} must be reported with the location of the tool. BTN_TOUCH | ||
| 257 | should be used to report when the tool is in contact with the tablet. | ||
| 258 | BTN_{STYLUS,STYLUS2} should be used to report buttons on the tool itself. Any | ||
| 259 | button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}. | ||
| 260 | BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use | ||
| 261 | meaningful buttons, like BTN_FORWARD, unless the button is labeled for that | ||
| 262 | purpose on the device. | ||
diff --git a/Documentation/input/ff.txt b/Documentation/input/ff.txt index ded4d5f53109..b3867bf49f8f 100644 --- a/Documentation/input/ff.txt +++ b/Documentation/input/ff.txt | |||
| @@ -49,7 +49,9 @@ This information is subject to change. | |||
| 49 | #include <linux/input.h> | 49 | #include <linux/input.h> |
| 50 | #include <sys/ioctl.h> | 50 | #include <sys/ioctl.h> |
| 51 | 51 | ||
| 52 | unsigned long features[1 + FF_MAX/sizeof(unsigned long)]; | 52 | #define BITS_TO_LONGS(x) \ |
| 53 | (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long))) | ||
| 54 | unsigned long features[BITS_TO_LONGS(FF_CNT)]; | ||
| 53 | int ioctl(int file_descriptor, int request, unsigned long *features); | 55 | int ioctl(int file_descriptor, int request, unsigned long *features); |
| 54 | 56 | ||
| 55 | "request" must be EVIOCGBIT(EV_FF, size of features array in bytes ) | 57 | "request" must be EVIOCGBIT(EV_FF, size of features array in bytes ) |
diff --git a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt index 1c856f32ff2c..56870c70a796 100644 --- a/Documentation/input/joystick-parport.txt +++ b/Documentation/input/joystick-parport.txt | |||
| @@ -272,7 +272,7 @@ if you want to use gamecon.c. | |||
| 272 | 272 | ||
| 273 | Also, the connection is a bit more complex. You'll need a bunch of diodes, | 273 | Also, the connection is a bit more complex. You'll need a bunch of diodes, |
| 274 | and one pullup resistor. First, you connect the Directions and the button | 274 | and one pullup resistor. First, you connect the Directions and the button |
| 275 | the same as for db9, however with the diodes inbetween. | 275 | the same as for db9, however with the diodes between. |
| 276 | 276 | ||
| 277 | Diodes | 277 | Diodes |
| 278 | (pin 2) -----|<|----> Up | 278 | (pin 2) -----|<|----> Up |
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt index bdcba154b83e..71536e78406f 100644 --- a/Documentation/input/multi-touch-protocol.txt +++ b/Documentation/input/multi-touch-protocol.txt | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | Multi-touch (MT) Protocol | 1 | Multi-touch (MT) Protocol |
| 2 | ------------------------- | 2 | ------------------------- |
| 3 | Copyright (C) 2009 Henrik Rydberg <rydberg@euromail.se> | 3 | Copyright (C) 2009-2010 Henrik Rydberg <rydberg@euromail.se> |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | Introduction | 6 | Introduction |
| @@ -161,19 +161,24 @@ against the glass. The inner region will increase, and in general, the | |||
| 161 | ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than | 161 | ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than |
| 162 | unity, is related to the contact pressure. For pressure-based devices, | 162 | unity, is related to the contact pressure. For pressure-based devices, |
| 163 | ABS_MT_PRESSURE may be used to provide the pressure on the contact area | 163 | ABS_MT_PRESSURE may be used to provide the pressure on the contact area |
| 164 | instead. | 164 | instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to |
| 165 | indicate the distance between the contact and the surface. | ||
| 165 | 166 | ||
| 166 | In addition to the MAJOR parameters, the oval shape of the contact can be | 167 | In addition to the MAJOR parameters, the oval shape of the contact can be |
| 167 | described by adding the MINOR parameters, such that MAJOR and MINOR are the | 168 | described by adding the MINOR parameters, such that MAJOR and MINOR are the |
| 168 | major and minor axis of an ellipse. Finally, the orientation of the oval | 169 | major and minor axis of an ellipse. Finally, the orientation of the oval |
| 169 | shape can be describe with the ORIENTATION parameter. | 170 | shape can be describe with the ORIENTATION parameter. |
| 170 | 171 | ||
| 172 | For type A devices, further specification of the touch shape is possible | ||
| 173 | via ABS_MT_BLOB_ID. | ||
| 174 | |||
| 171 | The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a | 175 | The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a |
| 172 | contact or a pen or something else. Devices with more granular information | 176 | finger or a pen or something else. Finally, the ABS_MT_TRACKING_ID event |
| 173 | may specify general shapes as blobs, i.e., as a sequence of rectangular | 177 | may be used to track identified contacts over time [5]. |
| 174 | shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices | 178 | |
| 175 | that currently support it, the ABS_MT_TRACKING_ID event may be used to | 179 | In the type B protocol, ABS_MT_TOOL_TYPE and ABS_MT_TRACKING_ID are |
| 176 | report contact tracking from hardware [5]. | 180 | implicitly handled by input core; drivers should instead call |
| 181 | input_mt_report_slot_state(). | ||
| 177 | 182 | ||
| 178 | 183 | ||
| 179 | Event Semantics | 184 | Event Semantics |
| @@ -213,6 +218,12 @@ The pressure, in arbitrary units, on the contact area. May be used instead | |||
| 213 | of TOUCH and WIDTH for pressure-based devices or any device with a spatial | 218 | of TOUCH and WIDTH for pressure-based devices or any device with a spatial |
| 214 | signal intensity distribution. | 219 | signal intensity distribution. |
| 215 | 220 | ||
| 221 | ABS_MT_DISTANCE | ||
| 222 | |||
| 223 | The distance, in surface units, between the contact and the surface. Zero | ||
| 224 | distance means the contact is touching the surface. A positive number means | ||
| 225 | the contact is hovering above the surface. | ||
| 226 | |||
| 216 | ABS_MT_ORIENTATION | 227 | ABS_MT_ORIENTATION |
| 217 | 228 | ||
| 218 | The orientation of the ellipse. The value should describe a signed quarter | 229 | The orientation of the ellipse. The value should describe a signed quarter |
| @@ -240,21 +251,24 @@ ABS_MT_TOOL_TYPE | |||
| 240 | The type of approaching tool. A lot of kernel drivers cannot distinguish | 251 | The type of approaching tool. A lot of kernel drivers cannot distinguish |
| 241 | between different tool types, such as a finger or a pen. In such cases, the | 252 | between different tool types, such as a finger or a pen. In such cases, the |
| 242 | event should be omitted. The protocol currently supports MT_TOOL_FINGER and | 253 | event should be omitted. The protocol currently supports MT_TOOL_FINGER and |
| 243 | MT_TOOL_PEN [2]. | 254 | MT_TOOL_PEN [2]. For type B devices, this event is handled by input core; |
| 255 | drivers should instead use input_mt_report_slot_state(). | ||
| 244 | 256 | ||
| 245 | ABS_MT_BLOB_ID | 257 | ABS_MT_BLOB_ID |
| 246 | 258 | ||
| 247 | The BLOB_ID groups several packets together into one arbitrarily shaped | 259 | The BLOB_ID groups several packets together into one arbitrarily shaped |
| 248 | contact. This is a low-level anonymous grouping for type A devices, and | 260 | contact. The sequence of points forms a polygon which defines the shape of |
| 261 | the contact. This is a low-level anonymous grouping for type A devices, and | ||
| 249 | should not be confused with the high-level trackingID [5]. Most type A | 262 | should not be confused with the high-level trackingID [5]. Most type A |
| 250 | devices do not have blob capability, so drivers can safely omit this event. | 263 | devices do not have blob capability, so drivers can safely omit this event. |
| 251 | 264 | ||
| 252 | ABS_MT_TRACKING_ID | 265 | ABS_MT_TRACKING_ID |
| 253 | 266 | ||
| 254 | The TRACKING_ID identifies an initiated contact throughout its life cycle | 267 | The TRACKING_ID identifies an initiated contact throughout its life cycle |
| 255 | [5]. This event is mandatory for type B devices. The value range of the | 268 | [5]. The value range of the TRACKING_ID should be large enough to ensure |
| 256 | TRACKING_ID should be large enough to ensure unique identification of a | 269 | unique identification of a contact maintained over an extended period of |
| 257 | contact maintained over an extended period of time. | 270 | time. For type B devices, this event is handled by input core; drivers |
| 271 | should instead use input_mt_report_slot_state(). | ||
| 258 | 272 | ||
| 259 | 273 | ||
| 260 | Event Computation | 274 | Event Computation |
| @@ -301,18 +315,19 @@ and with ORIENTATION, one can detect twisting of fingers. | |||
| 301 | Notes | 315 | Notes |
| 302 | ----- | 316 | ----- |
| 303 | 317 | ||
| 304 | In order to stay compatible with existing applications, the data | 318 | In order to stay compatible with existing applications, the data reported |
| 305 | reported in a finger packet must not be recognized as single-touch | 319 | in a finger packet must not be recognized as single-touch events. |
| 306 | events. In addition, all finger data must bypass input filtering, | 320 | |
| 307 | since subsequent events of the same type refer to different fingers. | 321 | For type A devices, all finger data bypasses input filtering, since |
| 322 | subsequent events of the same type refer to different fingers. | ||
| 308 | 323 | ||
| 309 | The first kernel driver to utilize the MT protocol is the bcm5974 driver, | 324 | For example usage of the type A protocol, see the bcm5974 driver. For |
| 310 | where examples can be found. | 325 | example usage of the type B protocol, see the hid-egalax driver. |
| 311 | 326 | ||
| 312 | [1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the | 327 | [1] With the extension ABS_MT_APPROACH_X and ABS_MT_APPROACH_Y, the |
| 313 | difference between the contact position and the approaching tool position | 328 | difference between the contact position and the approaching tool position |
| 314 | could be used to derive tilt. | 329 | could be used to derive tilt. |
| 315 | [2] The list can of course be extended. | 330 | [2] The list can of course be extended. |
| 316 | [3] Multitouch X driver project: http://bitmath.org/code/multitouch/. | 331 | [3] The mtdev project: http://bitmath.org/code/mtdev/. |
| 317 | [4] See the section on event computation. | 332 | [4] See the section on event computation. |
| 318 | [5] See the section on finger tracking. | 333 | [5] See the section on finger tracking. |
diff --git a/Documentation/input/ntrig.txt b/Documentation/input/ntrig.txt new file mode 100644 index 000000000000..be1fd981f73f --- /dev/null +++ b/Documentation/input/ntrig.txt | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | N-Trig touchscreen Driver | ||
| 2 | ------------------------- | ||
| 3 | Copyright (c) 2008-2010 Rafi Rubin <rafi@seas.upenn.edu> | ||
| 4 | Copyright (c) 2009-2010 Stephane Chatty | ||
| 5 | |||
| 6 | This driver provides support for N-Trig pen and multi-touch sensors. Single | ||
| 7 | and multi-touch events are translated to the appropriate protocols for | ||
| 8 | the hid and input systems. Pen events are sufficiently hid compliant and | ||
| 9 | are left to the hid core. The driver also provides additional filtering | ||
| 10 | and utility functions accessible with sysfs and module parameters. | ||
| 11 | |||
| 12 | This driver has been reported to work properly with multiple N-Trig devices | ||
| 13 | attached. | ||
| 14 | |||
| 15 | |||
| 16 | Parameters | ||
| 17 | ---------- | ||
| 18 | |||
| 19 | Note: values set at load time are global and will apply to all applicable | ||
| 20 | devices. Adjusting parameters with sysfs will override the load time values, | ||
| 21 | but only for that one device. | ||
| 22 | |||
| 23 | The following parameters are used to configure filters to reduce noise: | ||
| 24 | |||
| 25 | activate_slack number of fingers to ignore before processing events | ||
| 26 | |||
| 27 | activation_height size threshold to activate immediately | ||
| 28 | activation_width | ||
| 29 | |||
| 30 | min_height size threshold bellow which fingers are ignored | ||
| 31 | min_width both to decide activation and during activity | ||
| 32 | |||
| 33 | deactivate_slack the number of "no contact" frames to ignore before | ||
| 34 | propagating the end of activity events | ||
| 35 | |||
| 36 | When the last finger is removed from the device, it sends a number of empty | ||
| 37 | frames. By holding off on deactivation for a few frames we can tolerate false | ||
| 38 | erroneous disconnects, where the sensor may mistakenly not detect a finger that | ||
| 39 | is still present. Thus deactivate_slack addresses problems where a users might | ||
| 40 | see breaks in lines during drawing, or drop an object during a long drag. | ||
| 41 | |||
| 42 | |||
| 43 | Additional sysfs items | ||
| 44 | ---------------------- | ||
| 45 | |||
| 46 | These nodes just provide easy access to the ranges reported by the device. | ||
| 47 | sensor_logical_height the range for positions reported during activity | ||
| 48 | sensor_logical_width | ||
| 49 | |||
| 50 | sensor_physical_height internal ranges not used for normal events but | ||
| 51 | sensor_physical_width useful for tuning | ||
| 52 | |||
| 53 | All N-Trig devices with product id of 1 report events in the ranges of | ||
| 54 | X: 0-9600 | ||
| 55 | Y: 0-7200 | ||
| 56 | However not all of these devices have the same physical dimensions. Most | ||
| 57 | seem to be 12" sensors (Dell Latitude XT and XT2 and the HP TX2), and | ||
| 58 | at least one model (Dell Studio 17) has a 17" sensor. The ratio of physical | ||
| 59 | to logical sizes is used to adjust the size based filter parameters. | ||
| 60 | |||
| 61 | |||
| 62 | Filtering | ||
| 63 | --------- | ||
| 64 | |||
| 65 | With the release of the early multi-touch firmwares it became increasingly | ||
| 66 | obvious that these sensors were prone to erroneous events. Users reported | ||
| 67 | seeing both inappropriately dropped contact and ghosts, contacts reported | ||
| 68 | where no finger was actually touching the screen. | ||
| 69 | |||
| 70 | Deactivation slack helps prevent dropped contact for single touch use, but does | ||
| 71 | not address the problem of dropping one of more contacts while other contacts | ||
| 72 | are still active. Drops in the multi-touch context require additional | ||
| 73 | processing and should be handled in tandem with tacking. | ||
| 74 | |||
| 75 | As observed ghost contacts are similar to actual use of the sensor, but they | ||
| 76 | seem to have different profiles. Ghost activity typically shows up as small | ||
| 77 | short lived touches. As such, I assume that the longer the continuous stream | ||
| 78 | of events the more likely those events are from a real contact, and that the | ||
| 79 | larger the size of each contact the more likely it is real. Balancing the | ||
| 80 | goals of preventing ghosts and accepting real events quickly (to minimize | ||
| 81 | user observable latency), the filter accumulates confidence for incoming | ||
| 82 | events until it hits thresholds and begins propagating. In the interest in | ||
| 83 | minimizing stored state as well as the cost of operations to make a decision, | ||
| 84 | I've kept that decision simple. | ||
| 85 | |||
| 86 | Time is measured in terms of the number of fingers reported, not frames since | ||
| 87 | the probability of multiple simultaneous ghosts is expected to drop off | ||
| 88 | dramatically with increasing numbers. Rather than accumulate weight as a | ||
| 89 | function of size, I just use it as a binary threshold. A sufficiently large | ||
| 90 | contact immediately overrides the waiting period and leads to activation. | ||
| 91 | |||
| 92 | Setting the activation size thresholds to large values will result in deciding | ||
| 93 | primarily on activation slack. If you see longer lived ghosts, turning up the | ||
| 94 | activation slack while reducing the size thresholds may suffice to eliminate | ||
| 95 | the ghosts while keeping the screen quite responsive to firm taps. | ||
| 96 | |||
| 97 | Contacts continue to be filtered with min_height and min_width even after | ||
| 98 | the initial activation filter is satisfied. The intent is to provide | ||
| 99 | a mechanism for filtering out ghosts in the form of an extra finger while | ||
| 100 | you actually are using the screen. In practice this sort of ghost has | ||
| 101 | been far less problematic or relatively rare and I've left the defaults | ||
| 102 | set to 0 for both parameters, effectively turning off that filter. | ||
| 103 | |||
| 104 | I don't know what the optimal values are for these filters. If the defaults | ||
| 105 | don't work for you, please play with the parameters. If you do find other | ||
| 106 | values more comfortable, I would appreciate feedback. | ||
| 107 | |||
| 108 | The calibration of these devices does drift over time. If ghosts or contact | ||
| 109 | dropping worsen and interfere with the normal usage of your device, try | ||
| 110 | recalibrating it. | ||
| 111 | |||
| 112 | |||
| 113 | Calibration | ||
| 114 | ----------- | ||
| 115 | |||
| 116 | The N-Trig windows tools provide calibration and testing routines. Also an | ||
| 117 | unofficial unsupported set of user space tools including a calibrator is | ||
| 118 | available at: | ||
| 119 | http://code.launchpad.net/~rafi-seas/+junk/ntrig_calib | ||
| 120 | |||
| 121 | |||
| 122 | Tracking | ||
| 123 | -------- | ||
| 124 | |||
| 125 | As of yet, all tested N-Trig firmwares do not track fingers. When multiple | ||
| 126 | contacts are active they seem to be sorted primarily by Y position. | ||
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt index 8b4129de1d2d..92e68bce13a4 100644 --- a/Documentation/input/rotary-encoder.txt +++ b/Documentation/input/rotary-encoder.txt | |||
| @@ -9,6 +9,9 @@ peripherals with two wires. The outputs are phase-shifted by 90 degrees | |||
| 9 | and by triggering on falling and rising edges, the turn direction can | 9 | and by triggering on falling and rising edges, the turn direction can |
| 10 | be determined. | 10 | be determined. |
| 11 | 11 | ||
| 12 | Some encoders have both outputs low in stable states, whereas others also have | ||
| 13 | a stable state with both outputs high (half-period mode). | ||
| 14 | |||
| 12 | The phase diagram of these two outputs look like this: | 15 | The phase diagram of these two outputs look like this: |
| 13 | 16 | ||
| 14 | _____ _____ _____ | 17 | _____ _____ _____ |
| @@ -26,6 +29,8 @@ The phase diagram of these two outputs look like this: | |||
| 26 | |<-------->| | 29 | |<-------->| |
| 27 | one step | 30 | one step |
| 28 | 31 | ||
| 32 | |<-->| | ||
| 33 | one step (half-period mode) | ||
| 29 | 34 | ||
| 30 | For more information, please see | 35 | For more information, please see |
| 31 | http://en.wikipedia.org/wiki/Rotary_encoder | 36 | http://en.wikipedia.org/wiki/Rotary_encoder |
| @@ -34,6 +39,13 @@ For more information, please see | |||
| 34 | 1. Events / state machine | 39 | 1. Events / state machine |
| 35 | ------------------------- | 40 | ------------------------- |
| 36 | 41 | ||
| 42 | In half-period mode, state a) and c) above are used to determine the | ||
| 43 | rotational direction based on the last stable state. Events are reported in | ||
| 44 | states b) and d) given that the new stable state is different from the last | ||
| 45 | (i.e. the rotation was not reversed half-way). | ||
| 46 | |||
| 47 | Otherwise, the following apply: | ||
| 48 | |||
| 37 | a) Rising edge on channel A, channel B in low state | 49 | a) Rising edge on channel A, channel B in low state |
| 38 | This state is used to recognize a clockwise turn | 50 | This state is used to recognize a clockwise turn |
| 39 | 51 | ||
| @@ -46,7 +58,7 @@ c) Falling edge on channel A, channel B in high state | |||
| 46 | 58 | ||
| 47 | d) Falling edge on channel B, channel A in low state | 59 | d) Falling edge on channel B, channel A in low state |
| 48 | Parking position. If the encoder enters this state, a full transition | 60 | Parking position. If the encoder enters this state, a full transition |
| 49 | should have happend, unless it flipped back on half the way. The | 61 | should have happened, unless it flipped back on half the way. The |
| 50 | 'armed' state tells us about that. | 62 | 'armed' state tells us about that. |
| 51 | 63 | ||
| 52 | 2. Platform requirements | 64 | 2. Platform requirements |
| @@ -96,6 +108,7 @@ static struct rotary_encoder_platform_data my_rotary_encoder_info = { | |||
| 96 | .gpio_b = GPIO_ROTARY_B, | 108 | .gpio_b = GPIO_ROTARY_B, |
| 97 | .inverted_a = 0, | 109 | .inverted_a = 0, |
| 98 | .inverted_b = 0, | 110 | .inverted_b = 0, |
| 111 | .half_period = false, | ||
| 99 | }; | 112 | }; |
| 100 | 113 | ||
| 101 | static struct platform_device rotary_encoder_device = { | 114 | static struct platform_device rotary_encoder_device = { |
diff --git a/Documentation/input/walkera0701.txt b/Documentation/input/walkera0701.txt index 8f4289efc5c4..561385d38482 100644 --- a/Documentation/input/walkera0701.txt +++ b/Documentation/input/walkera0701.txt | |||
| @@ -77,7 +77,7 @@ pulse length: | |||
| 77 | 77 | ||
| 78 | 24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits | 78 | 24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits |
| 79 | 79 | ||
| 80 | (Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync | 80 | (Warning, pulses on ACK are inverted by transistor, irq is raised up on sync |
| 81 | to bin change or octal value to bin change). | 81 | to bin change or octal value to bin change). |
| 82 | 82 | ||
| 83 | Binary data representations: | 83 | Binary data representations: |
