Skip to contentSkip to conversation

Convert input documentation to ReST

PATCH Superseded Mauro Carvalho Chehab 2 participants 55 messages Apr 4, 2017 – Apr 7, 2017 18 messages not in the archive Page 2 of 2

Subsystems (6)
lore
Share & tools
lore
#52 lore raw

PATCH v2 20/37 docs: input/joystick-parport: convert it to ReST format

In reply to Mauro Carvalho Chehab

This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.

---
 Documentation/input/joystick-parport.txt | 708 ++++++++++++++++---------------
 1 file changed, 370 insertions(+), 338 deletions(-)
Documentation/input/joystick-parport.txt +370 -338
index 56870c70a796..0aa0fb17bf48 100644
@@ -1,333 +1,349 @@
-		    Linux Joystick parport drivers v2.0
-	       (c) 1998-2000 Vojtech Pavlik <[email protected]>
-	       (c) 1998 Andree Borrmann <[email protected]>
-			     Sponsored by SuSE
-----------------------------------------------------------------------------
-
-0. Disclaimer
-~~~~~~~~~~~~~
-  Any information in this file is provided as-is, without any guarantee that
+.. include:: <isonum.txt>
+
+.. _joystick-parport:
+
+===================================
+Linux Joystick parport drivers v2.0
+===================================
+
+:Copyright: |copy| 1998-2000 Vojtech Pavlik <[email protected]>
+:Copyright: |copy| 1998 Andree Borrmann <[email protected]>
+
+
+Sponsored by SuSE
+
+Disclaimer
+==========
+
+Any information in this file is provided as-is, without any guarantee that
 it will be true. So, use it at your own risk. The possible damages that can
 happen include burning your parallel port, and/or the sticks and joystick
 and maybe even more. Like when a lightning kills you it is not our problem.
 
-1. Intro
-~~~~~~~~
-  The joystick parport drivers are used for joysticks and gamepads not
+Intro
+=====
+
+The joystick parport drivers are used for joysticks and gamepads not
 originally designed for PCs and other computers Linux runs on. Because of
 that, PCs usually lack the right ports to connect these devices to. Parallel
 port, because of its ability to change single bits at will, and providing
 both output and input bits is the most suitable port on the PC for
 connecting such devices.
 
-2. Devices supported
-~~~~~~~~~~~~~~~~~~~~
-  Many console and 8-bit computer gamepads and joysticks are supported. The
+Devices supported
+=================
+
+Many console and 8-bit computer gamepads and joysticks are supported. The
 following subsections discuss usage of each.
 
-2.1 NES and SNES
-~~~~~~~~~~~~~~~~
-  The Nintendo Entertainment System and Super Nintendo Entertainment System
+NES and SNES
+------------
+
+The Nintendo Entertainment System and Super Nintendo Entertainment System
 gamepads are widely available, and easy to get. Also, they are quite easy to
 connect to a PC, and don't need much processing speed (108 us for NES and
 165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
 with them.
 
-  All NES and SNES use the same synchronous serial protocol, clocked from
+All NES and SNES use the same synchronous serial protocol, clocked from
 the computer's side (and thus timing insensitive). To allow up to 5 NES
 and/or SNES gamepads and/or SNES mice connected to the parallel port at once,
 the output lines of the parallel port are shared, while one of 5 available
 input lines is assigned to each gamepad.
 
-  This protocol is handled by the gamecon.c driver, so that's the one
+This protocol is handled by the gamecon.c driver, so that's the one
 you'll use for NES, SNES gamepads and SNES mice.
 
-  The main problem with PC parallel ports is that they don't have +5V power
+The main problem with PC parallel ports is that they don't have +5V power
 source on any of their pins. So, if you want a reliable source of power
 for your pads, use either keyboard or joystick port, and make a pass-through
 cable. You can also pull the power directly from the power supply (the red
 wire is +5V).
 
-  If you want to use the parallel port only, you can take the power is from
+If you want to use the parallel port only, you can take the power is from
 some data pin. For most gamepad and parport implementations only one pin is
 needed, and I'd recommend pin 9 for that, the highest data bit. On the other
 hand, if you are not planning to use anything else than NES / SNES on the
-port, anything between and including pin 4 and pin 9 will work.
+port, anything between and including pin 4 and pin 9 will work::
 
-(pin 9) -----> Power
+    (pin 9) -----> Power
 
-  Unfortunately, there are pads that need a lot more of power, and parallel
+Unfortunately, there are pads that need a lot more of power, and parallel
 ports that can't give much current through the data pins. If this is your
 case, you'll need to use diodes (as a prevention of destroying your parallel
-port), and combine the currents of two or more data bits together.
+port), and combine the currents of two or more data bits together::
 
-	   Diodes
-(pin 9) ----|>|-------+------> Power
-		      |
-(pin 8) ----|>|-------+
-		      |
-(pin 7) ----|>|-------+
-		      |
- <and so on>          :
-		      |
-(pin 4) ----|>|-------+
+	      Diodes
+    (pin 9) ----|>|-------+------> Power
+			|
+    (pin 8) ----|>|-------+
+			|
+    (pin 7) ----|>|-------+
+			|
+    <and so on>         :
+			|
+    (pin 4) ----|>|-------+
 
-  Ground is quite easy. On PC's parallel port the ground is on any of the
-pins from pin 18 to pin 25. So use any pin of these you like for the ground.
+Ground is quite easy. On PC's parallel port the ground is on any of the
+pins from pin 18 to pin 25. So use any pin of these you like for the ground::
 
-(pin 18) -----> Ground
+    (pin 18) -----> Ground
 
-  NES and SNES pads have two input bits, Clock and Latch, which drive the
+NES and SNES pads have two input bits, Clock and Latch, which drive the
 serial transfer. These are connected to pins 2 and 3 of the parallel port,
-respectively.
+respectively::
 
-(pin 2) -----> Clock
-(pin 3) -----> Latch
+    (pin 2) -----> Clock
+    (pin 3) -----> Latch
 
-  And the last thing is the NES / SNES data wire. Only that isn't shared and
-each pad needs its own data pin. The parallel port pins are:
+And the last thing is the NES / SNES data wire. Only that isn't shared and
+each pad needs its own data pin. The parallel port pins are::
 
-(pin 10) -----> Pad 1 data
-(pin 11) -----> Pad 2 data
-(pin 12) -----> Pad 3 data
-(pin 13) -----> Pad 4 data
-(pin 15) -----> Pad 5 data
+    (pin 10) -----> Pad 1 data
+    (pin 11) -----> Pad 2 data
+    (pin 12) -----> Pad 3 data
+    (pin 13) -----> Pad 4 data
+    (pin 15) -----> Pad 5 data
 
-  Note that pin 14 is not used, since it is not an input pin on the parallel
+Note that pin 14 is not used, since it is not an input pin on the parallel
 port.
 
-  This is everything you need on the PC's side of the connection, now on to
+This is everything you need on the PC's side of the connection, now on to
 the gamepads side. The NES and SNES have different connectors. Also, there
 are quite a lot of NES clones, and because Nintendo used proprietary
 connectors for their machines, the cloners couldn't and used standard D-Cannon
 connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
 A, Turbo B, Select and Start, and is connected through 5 wires, then it is
 either a NES or NES clone and will work with this connection. SNES gamepads
-also use 5 wires, but have more buttons. They will work as well, of course.
+also use 5 wires, but have more buttons. They will work as well, of course::
 
-Pinout for NES gamepads                 Pinout for SNES gamepads and mice
+  Pinout for NES gamepads                 Pinout for SNES gamepads and mice
 
-	   +----> Power                   +-----------------------\
-	   |                            7 | o  o  o  o |  x  x  o  | 1
- 5 +---------+  7                         +-----------------------/
-   | x  x  o   \                            |  |  |  |          |
-   | o  o  o  o |                           |  |  |  |          +-> Ground
- 4 +------------+ 1                         |  |  |  +------------> Data
-     |  |  |  |                             |  |  +---------------> Latch
-     |  |  |  +-> Ground                    |  +------------------> Clock
-     |  |  +----> Clock                     +---------------------> Power
-     |  +-------> Latch
-     +----------> Data
+             +----> Power                   +-----------------------\
+             |                            7 | o  o  o  o |  x  x  o  | 1
+   5 +---------+  7                         +-----------------------/
+     | x  x  o   \                            |  |  |  |          |
+     | o  o  o  o |                           |  |  |  |          +-> Ground
+   4 +------------+ 1                         |  |  |  +------------> Data
+       |  |  |  |                             |  |  +---------------> Latch
+       |  |  |  +-> Ground                    |  +------------------> Clock
+       |  |  +----> Clock                     +---------------------> Power
+       |  +-------> Latch
+       +----------> Data
 
-Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads
+  Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads
 
-	+---------> Clock                    +-----------------> Data
-	| +-------> Latch                    |             +---> Ground
-	| | +-----> Data                     |             |
-	| | |                              ___________________
+        +---------> Clock                    +-----------------> Data
+        | +-------> Latch                    |             +---> Ground
+        | | +-----> Data                     |             |
+        | | |                              ___________________
     _____________                        8 \ o x x x x x x o / 1
   5 \ x o o o x / 1                         \ o x x o x x o /
      \ x o x o /                          15 `~~~~~~~~~~~~~' 9
     9 `~~~~~~~' 6                             |     |     |
-	 |   |                                |     |     +----> Clock
-	 |   +----> Power                     |     +----------> Latch
-	 +--------> Ground                    +----------------> Power
+         |   |                                |     |     +----> Clock
+         |   +----> Power                     |     +----------> Latch
+         +--------> Ground                    +----------------> Power
 
-2.2 Multisystem joysticks
-~~~~~~~~~~~~~~~~~~~~~~~~~
-  In the era of 8-bit machines, there was something like de-facto standard
+Multisystem joysticks
+---------------------
+
+In the era of 8-bit machines, there was something like de-facto standard
 for joystick ports. They were all digital, and all used D-Cannon 9 pin
 connectors (db9). Because of that, a single joystick could be used without
 hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
 Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
 joysticks are called "Multisystem".
 
-  Now their pinout:
+Now their pinout::
 
-      +---------> Right
-      | +-------> Left
-      | | +-----> Down
-      | | | +---> Up
-      | | | |
-  _____________
-5 \ x o o o o / 1
-   \ x o x o /
-  9 `~~~~~~~' 6
-       |   |
-       |   +----> Button
-       +--------> Ground
+        +---------> Right
+        | +-------> Left
+        | | +-----> Down
+        | | | +---> Up
+        | | | |
+    _____________
+  5 \ x o o o o / 1
+     \ x o x o /
+    9 `~~~~~~~' 6
+         |   |
+         |   +----> Button
+         +--------> Ground
 
-  However, as time passed, extensions to this standard developed, and these
-were not compatible with each other:
+However, as time passed, extensions to this standard developed, and these
+were not compatible with each other::
 
 
-	Atari 130, 800/XL/XE		   MSX
+          Atari 130, 800/XL/XE                   MSX
 
-					 +-----------> Power
-      +---------> Right                  | +---------> Right
-      | +-------> Left                   | | +-------> Left
-      | | +-----> Down                   | | | +-----> Down
-      | | | +---> Up                     | | | | +---> Up
-      | | | |                            | | | | |
-  _____________                        _____________
-5 \ x o o o o / 1                    5 \ o o o o o / 1
-   \ x o o o /                          \ o o o o /
-  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
-       | | |                              | | | |
-       | | +----> Button                  | | | +----> Button 1
-       | +------> Power                   | | +------> Button 2
-       +--------> Ground                  | +--------> Output 3
-					  +----------> Ground
+                                           +-----------> Power
+        +---------> Right                  | +---------> Right
+        | +-------> Left                   | | +-------> Left
+        | | +-----> Down                   | | | +-----> Down
+        | | | +---> Up                     | | | | +---> Up
+        | | | |                            | | | | |
+    _____________                        _____________
+  5 \ x o o o o / 1                    5 \ o o o o o / 1
+     \ x o o o /                          \ o o o o /
+    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+         | | |                              | | | |
+         | | +----> Button                  | | | +----> Button 1
+         | +------> Power                   | | +------> Button 2
+         +--------> Ground                  | +--------> Output 3
+                                            +----------> Ground
 
-	Amstrad CPC			   Commodore C64
+          Amstrad CPC                           Commodore C64
 
-					 +-----------> Analog Y
-      +---------> Right                  | +---------> Right
-      | +-------> Left                   | | +-------> Left
-      | | +-----> Down                   | | | +-----> Down
-      | | | +---> Up                     | | | | +---> Up
-      | | | |                            | | | | |
-  _____________                        _____________
-5 \ x o o o o / 1                    5 \ o o o o o / 1
-   \ x o o o /                          \ o o o o /
-  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
-       | | |                              | | | |
-       | | +----> Button 1                | | | +----> Button
-       | +------> Button 2                | | +------> Power
-       +--------> Ground                  | +--------> Ground
-					  +----------> Analog X
+                                           +-----------> Analog Y
+        +---------> Right                  | +---------> Right
+        | +-------> Left                   | | +-------> Left
+        | | +-----> Down                   | | | +-----> Down
+        | | | +---> Up                     | | | | +---> Up
+        | | | |                            | | | | |
+    _____________                        _____________
+  5 \ x o o o o / 1                    5 \ o o o o o / 1
+     \ x o o o /                          \ o o o o /
+    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+         | | |                              | | | |
+         | | +----> Button 1                | | | +----> Button
+         | +------> Button 2                | | +------> Power
+         +--------> Ground                  | +--------> Ground
+                                            +----------> Analog X
 
-	Sinclair Spectrum +2A/+3           Amiga 1200
-                                     
-    +-----------> Up                     +-----------> Button 3
-    | +---------> Fire                   | +---------> Right
-    | |                                  | | +-------> Left
-    | |   +-----> Ground                 | | | +-----> Down
-    | |   |                              | | | | +---> Up
-    | |   |                              | | | | |
-  _____________                        _____________
-5 \ o o x o x / 1                    5 \ o o o o o / 1
-   \ o o o o /                          \ o o o o /
-  9 `~~~~~~~' 6                        9 `~~~~~~~' 6
-     | | | |                              | | | |
-     | | | +----> Right                   | | | +----> Button 1
-     | | +------> Left                    | | +------> Power
-     | +--------> Ground                  | +--------> Ground
-     +----------> Down                    +----------> Button 2
+          Sinclair Spectrum +2A/+3           Amiga 1200
+
+      +-----------> Up                     +-----------> Button 3
+      | +---------> Fire                   | +---------> Right
+      | |                                  | | +-------> Left
+      | |   +-----> Ground                 | | | +-----> Down
+      | |   |                              | | | | +---> Up
+      | |   |                              | | | | |
+    _____________                        _____________
+  5 \ o o x o x / 1                    5 \ o o o o o / 1
+     \ o o o o /                          \ o o o o /
+    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
+       | | | |                              | | | |
+       | | | +----> Right                   | | | +----> Button 1
+       | | +------> Left                    | | +------> Power
+       | +--------> Ground                  | +--------> Ground
+       +----------> Down                    +----------> Button 2
 
   And there were many others.
 
-2.2.1 Multisystem joysticks using db9.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  For the Multisystem joysticks, and their derivatives, the db9.c driver
+Multisystem joysticks using db9.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For the Multisystem joysticks, and their derivatives, the db9.c driver
 was written. It allows only one joystick / gamepad per parallel port, but
 the interface is easy to build and works with almost anything.
 
-  For the basic 1-button Multisystem joystick you connect its wires to the
-parallel port like this:
+For the basic 1-button Multisystem joystick you connect its wires to the
+parallel port like this::
 
-(pin  1) -----> Power
-(pin 18) -----> Ground
+    (pin  1) -----> Power
+    (pin 18) -----> Ground
 
-(pin  2) -----> Up
-(pin  3) -----> Down
-(pin  4) -----> Left
-(pin  5) -----> Right
-(pin  6) -----> Button 1
+    (pin  2) -----> Up
+    (pin  3) -----> Down
+    (pin  4) -----> Left
+    (pin  5) -----> Right
+    (pin  6) -----> Button 1
 
-  However, if the joystick is switch based (eg. clicks when you move it),
+However, if the joystick is switch based (eg. clicks when you move it),
 you might or might not, depending on your parallel port, need 10 kOhm pullup
-resistors on each of the direction and button signals, like this:
+resistors on each of the direction and button signals, like this::
 
-(pin 2) ------------+------> Up
-	  Resistor  |
-(pin 1) --[10kOhm]--+
+    (pin 2) ------------+------> Up
+              Resistor  |
+    (pin 1) --[10kOhm]--+
 
-  Try without, and if it doesn't work, add them. For TTL based joysticks /
+Try without, and if it doesn't work, add them. For TTL based joysticks /
 gamepads the pullups are not needed.
 
-  For joysticks with two buttons you connect the second button to pin 7 on
-the parallel port.
+For joysticks with two buttons you connect the second button to pin 7 on
+the parallel port::
 
-(pin 7) -----> Button 2
+    (pin 7) -----> Button 2
 
-  And that's it.
+And that's it.
 
-  On a side note, if you have already built a different adapter for use with
+On a side note, if you have already built a different adapter for use with
 the digital joystick driver 0.8.0.2, this is also supported by the db9.c
 driver, as device type 8. (See section 3.2)
 
-2.2.2 Multisystem joysticks using gamecon.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  For some people just one joystick per parallel port is not enough, and/or
+Multisystem joysticks using gamecon.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For some people just one joystick per parallel port is not enough, and/or
 want to use them on one parallel port together with NES/SNES/PSX pads. This is
 possible using the gamecon.c. It supports up to 5 devices of the above types,
 including 1 and 2 buttons Multisystem joysticks.
 
-  However, there is nothing for free. To allow more sticks to be used at
+However, there is nothing for free. To allow more sticks to be used at
 once, you need the sticks to be purely switch based (that is non-TTL), and
 not to need power. Just a plain simple six switches inside. If your
 joystick can do more (eg. turbofire) you'll need to disable it totally first
 if you want to use gamecon.c.
 
-  Also, the connection is a bit more complex. You'll need a bunch of diodes,
+Also, the connection is a bit more complex. You'll need a bunch of diodes,
 and one pullup resistor. First, you connect the Directions and the button
-the same as for db9, however with the diodes between.
+the same as for db9, however with the diodes between::
 
-	    Diodes
-(pin 2) -----|<|----> Up
-(pin 3) -----|<|----> Down
-(pin 4) -----|<|----> Left
-(pin 5) -----|<|----> Right
-(pin 6) -----|<|----> Button 1
+                Diodes
+    (pin 2) -----|<|----> Up
+    (pin 3) -----|<|----> Down
+    (pin 4) -----|<|----> Left
+    (pin 5) -----|<|----> Right
+    (pin 6) -----|<|----> Button 1
 
-  For two button sticks you also connect the other button.
+For two button sticks you also connect the other button::
 
-(pin 7) -----|<|----> Button 2
+    (pin 7) -----|<|----> Button 2
 
-  And finally, you connect the Ground wire of the joystick, like done in
+And finally, you connect the Ground wire of the joystick, like done in
 this little schematic to Power and Data on the parallel port, as described
 for the NES / SNES pads in section 2.1 of this file - that is, one data pin
-for each joystick. The power source is shared.
+for each joystick. The power source is shared::
 
-Data    ------------+-----> Ground
-	  Resistor  |
-Power   --[10kOhm]--+
+    Data    ------------+-----> Ground
+              Resistor  |
+    Power   --[10kOhm]--+
 
-  And that's all, here we go!
+And that's all, here we go!
 
-2.2.3 Multisystem joysticks using turbografx.c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The TurboGraFX interface, designed by
+Multisystem joysticks using turbografx.c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The TurboGraFX interface, designed by
 
 	Steffen Schwenke <[email protected]>
 
-  allows up to 7 Multisystem joysticks connected to the parallel port. In
+allows up to 7 Multisystem joysticks connected to the parallel port. In
 Steffen's version, there is support for up to 5 buttons per joystick.  However,
 since this doesn't work reliably on all parallel ports, the turbografx.c driver
 supports only one button per joystick. For more information on how to build the
-interface, see
+interface, see:
 
 	http://www2.burg-halle.de/~schwenke/parport.html
 
-2.3 Sony Playstation
-~~~~~~~~~~~~~~~~~~~~
+Sony Playstation
+----------------
 
-  The PSX controller is supported by the gamecon.c. Pinout of the PSX
-controller (compatible with DirectPadPro):
+The PSX controller is supported by the gamecon.c. Pinout of the PSX
+controller (compatible with DirectPadPro)::
 
-  +---------+---------+---------+
-9 | o  o  o | o  o  o | o  o  o | 1               parallel
-   \________|_________|________/                  port pins
-    |  |      |  |  |   |
-    |  |      |  |  |   +-------->  Clock    ---  (4)
-    |  |      |  |  +------------>  Select   ---  (3)
-    |  |      |  +--------------->  Power    ---  (5-9)
-    |  |      +------------------>  Ground   ---  (18-25)
-    |  +------------------------->  Command  ---  (2)
-    +---------------------------->  Data     ---  (one of 10,11,12,13,15)
+    +---------+---------+---------+
+  9 | o  o  o | o  o  o | o  o  o | 1               parallel
+     \________|_________|________/                  port pins
+      |  |      |  |  |   |
+      |  |      |  |  |   +-------->  Clock    ---  (4)
+      |  |      |  |  +------------>  Select   ---  (3)
+      |  |      |  +--------------->  Power    ---  (5-9)
+      |  |      +------------------>  Ground   ---  (18-25)
+      |  +------------------------->  Command  ---  (2)
+      +---------------------------->  Data     ---  (one of 10,11,12,13,15)
 
-  The driver supports these controllers:
+The driver supports these controllers:
 
  * Standard PSX Pad
  * NegCon PSX Pad
@@ -336,207 +352,223 @@ controller (compatible with DirectPadPro):
  * PSX Rumble Pad
  * PSX DDR Pad
 
-2.4 Sega
-~~~~~~~~
-  All the Sega controllers are more or less based on the standard 2-button
+Sega
+----
+
+All the Sega controllers are more or less based on the standard 2-button
 Multisystem joystick. However, since they don't use switches and use TTL
 logic, the only driver usable with them is the db9.c driver.
 
-2.4.1 Sega Master System
-~~~~~~~~~~~~~~~~~~~~~~~~
-  The SMS gamepads are almost exactly the same as normal 2-button
+Sega Master System
+~~~~~~~~~~~~~~~~~~
+
+The SMS gamepads are almost exactly the same as normal 2-button
 Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
-parallel port pins, and the following schematic:
+parallel port pins, and the following schematic::
 
-    +-----------> Power
-    | +---------> Right
-    | | +-------> Left
-    | | | +-----> Down
-    | | | | +---> Up
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o x o /
-  9 `~~~~~~~' 6
-     | |   |
-     | |   +----> Button 1
-     | +--------> Ground
-     +----------> Button 2
+      +-----------> Power
+      | +---------> Right
+      | | +-------> Left
+      | | | +-----> Down
+      | | | | +---> Up
+      | | | | |
+    _____________
+  5 \ o o o o o / 1
+     \ o o x o /
+    9 `~~~~~~~' 6
+       | |   |
+       | |   +----> Button 1
+       | +--------> Ground
+       +----------> Button 2
 
-2.4.2 Sega Genesis aka MegaDrive
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
+Sega Genesis aka MegaDrive
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
 to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1).  Use
-the following schematic:
+the following schematic::
 
-    +-----------> Power
-    | +---------> Right
-    | | +-------> Left
-    | | | +-----> Down
-    | | | | +---> Up
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o o o /
-  9 `~~~~~~~' 6
-     | | | |
-     | | | +----> Button 1
-     | | +------> Select
-     | +--------> Ground
-     +----------> Button 2
+        +-----------> Power
+        | +---------> Right
+        | | +-------> Left
+        | | | +-----> Down
+        | | | | +---> Up
+        | | | | |
+      _____________
+    5 \ o o o o o / 1
+       \ o o o o /
+      9 `~~~~~~~' 6
+        | | | |
+        | | | +----> Button 1
+        | | +------> Select
+        | +--------> Ground
+        +----------> Button 2
 
-  The Select pin goes to pin 14 on the parallel port.
+The Select pin goes to pin 14 on the parallel port::
 
-(pin 14) -----> Select
+    (pin 14) -----> Select
 
-  The rest is the same as for Multi2 joysticks using db9.c
+The rest is the same as for Multi2 joysticks using db9.c
 
-2.4.3 Sega Saturn
-~~~~~~~~~~~~~~~~~
-  Sega Saturn has eight buttons, and to transfer that, without hacks like
+Sega Saturn
+~~~~~~~~~~~
+
+Sega Saturn has eight buttons, and to transfer that, without hacks like
 Genesis 6 pads use, it needs one more select pin. Anyway, it is still
 handled by the db9.c driver. Its pinout is very different from anything
-else.  Use this schematic:
+else.  Use this schematic::
 
-    +-----------> Select 1
-    | +---------> Power
-    | | +-------> Up
-    | | | +-----> Down
-    | | | | +---> Ground
-    | | | | |
-  _____________
-5 \ o o o o o / 1
-   \ o o o o /
-  9 `~~~~~~~' 6
-     | | | |
-     | | | +----> Select 2
-     | | +------> Right
-     | +--------> Left
-     +----------> Power
+      +-----------> Select 1
+      | +---------> Power
+      | | +-------> Up
+      | | | +-----> Down
+      | | | | +---> Ground
+      | | | | |
+    _____________
+  5 \ o o o o o / 1
+     \ o o o o /
+    9 `~~~~~~~' 6
+       | | | |
+       | | | +----> Select 2
+       | | +------> Right
+       | +--------> Left
+       +----------> Power
 
-  Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
-parallel port.
+Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
+parallel port::
 
-(pin 14) -----> Select 1
-(pin 16) -----> Select 2
+    (pin 14) -----> Select 1
+    (pin 16) -----> Select 2
 
-  The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
+The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
 Multi joysticks using db9.c
 
-3. The drivers
-~~~~~~~~~~~~~~
-  There are three drivers for the parallel port interfaces. Each, as
+The drivers
+===========
+
+There are three drivers for the parallel port interfaces. Each, as
 described above, allows to connect a different group of joysticks and pads.
 Here are described their command lines:
 
-3.1 gamecon.c
-~~~~~~~~~~~~~
-  Using gamecon.c you can connect up to five devices to one parallel port. It
-uses the following kernel/module command line:
+gamecon.c
+---------
+
+Using gamecon.c you can connect up to five devices to one parallel port. It
+uses the following kernel/module command line::
 
 	gamecon.map=port,pad1,pad2,pad3,pad4,pad5
 
-  Where 'port' the number of the parport interface (eg. 0 for parport0).
+Where ``port`` the number of the parport interface (eg. 0 for parport0).
 
-  And 'pad1' to 'pad5' are pad types connected to different data input pins
+And ``pad1`` to ``pad5`` are pad types connected to different data input pins
 (10,11,12,13,15), as described in section 2.1 of this file.
 
-  The types are:
+The types are:
 
-	Type | Joystick/Pad
-	--------------------
-	  0  | None
-	  1  | SNES pad
-	  2  | NES pad
-	  4  | Multisystem 1-button joystick
-	  5  | Multisystem 2-button joystick
-	  6  | N64 pad
-	  7  | Sony PSX controller
-	  8  | Sony PSX DDR controller
-	  9  | SNES mouse
+	===== =============================
+	Type  Joystick/Pad
+	===== =============================
+	  0   None
+	  1   SNES pad
+	  2   NES pad
+	  4   Multisystem 1-button joystick
+	  5   Multisystem 2-button joystick
+	  6   N64 pad
+	  7   Sony PSX controller
+	  8   Sony PSX DDR controller
+	  9   SNES mouse
+	===== =============================
 
-  The exact type of the PSX controller type is autoprobed when used, so
+The exact type of the PSX controller type is autoprobed when used, so
 hot swapping should work (but is not recommended).
 
-  Should you want to use more than one of parallel ports at once, you can use
+Should you want to use more than one of parallel ports at once, you can use
 gamecon.map2 and gamecon.map3 as additional command line parameters for two
 more parallel ports.
 
-  There are two options specific to PSX driver portion.  gamecon.psx_delay sets
+There are two options specific to PSX driver portion.  gamecon.psx_delay sets
 the command delay when talking to the controllers. The default of 25 should
 work but you can try lowering it for better performance. If your pads don't
 respond try raising it until they work. Setting the type to 8 allows the
 driver to be used with Dance Dance Revolution or similar games. Arrow keys are
 registered as key presses instead of X and Y axes.
 
-3.2 db9.c
-~~~~~~~~~
-  Apart from making an interface, there is nothing difficult on using the
-db9.c driver. It uses the following kernel/module command line:
+db9.c
+-----
+
+Apart from making an interface, there is nothing difficult on using the
+db9.c driver. It uses the following kernel/module command line::
 
 	db9.dev=port,type
 
-  Where 'port' is the number of the parport interface (eg. 0 for parport0).
+Where ``port`` is the number of the parport interface (eg. 0 for parport0).
 
-  Caveat here: This driver only works on bidirectional parallel ports. If
+Caveat here: This driver only works on bidirectional parallel ports. If
 your parallel port is recent enough, you should have no trouble with this.
 Old parallel ports may not have this feature.
 
-  'Type' is the type of joystick or pad attached:
+``Type`` is the type of joystick or pad attached:
 
-	Type | Joystick/Pad
-	--------------------
-	  0  | None
-	  1  | Multisystem 1-button joystick
-	  2  | Multisystem 2-button joystick
-	  3  | Genesis pad (3+1 buttons)
-	  5  | Genesis pad (5+1 buttons)
-	  6  | Genesis pad (6+2 buttons)
-	  7  | Saturn pad (8 buttons)
-	  8  | Multisystem 1-button joystick (v0.8.0.2 pin-out)
-	  9  | Two Multisystem 1-button joysticks (v0.8.0.2 pin-out) 
-	 10  | Amiga CD32 pad
+	===== ======================================================
+	Type  Joystick/Pad
+	===== ======================================================
+	  0   None
+	  1   Multisystem 1-button joystick
+	  2   Multisystem 2-button joystick
+	  3   Genesis pad (3+1 buttons)
+	  5   Genesis pad (5+1 buttons)
+	  6   Genesis pad (6+2 buttons)
+	  7   Saturn pad (8 buttons)
+	  8   Multisystem 1-button joystick (v0.8.0.2 pin-out)
+	  9   Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
+	 10   Amiga CD32 pad
+	===== ======================================================
 
-  Should you want to use more than one of these joysticks/pads at once, you
+Should you want to use more than one of these joysticks/pads at once, you
 can use db9.dev2 and db9.dev3 as additional command line parameters for two
 more joysticks/pads.
 
-3.3 turbografx.c
-~~~~~~~~~~~~~~~~
-  The turbografx.c driver uses a very simple kernel/module command line:
+turbografx.c
+------------
+
+The turbografx.c driver uses a very simple kernel/module command line::
 
 	turbografx.map=port,js1,js2,js3,js4,js5,js6,js7
 
-  Where 'port' is the number of the parport interface (eg. 0 for parport0).
+Where ``port`` is the number of the parport interface (eg. 0 for parport0).
 
-  'jsX' is the number of buttons the Multisystem joysticks connected to the
+``jsX`` is the number of buttons the Multisystem joysticks connected to the
 interface ports 1-7 have. For a standard multisystem joystick, this is 1.
 
-  Should you want to use more than one of these interfaces at once, you can
+Should you want to use more than one of these interfaces at once, you can
 use turbografx.map2 and turbografx.map3 as additional command line parameters
 for two more interfaces.
 
-3.4 PC parallel port pinout
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+PC parallel port pinout
+-----------------------
+
+::
+
 		  .----------------------------------------.
    At the PC:     \ 13 12 11 10  9  8  7  6  5  4  3  2  1 /
                    \  25 24 23 22 21 20 19 18 17 16 15 14 /
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-	  Pin | Name    | Description
-	~~~~~~|~~~~~~~~~|~~~~~~~~~~
-	    1 | /STROBE | Strobe
-	  2-9 | D0-D7   | Data Bit 0-7
-	   10 | /ACK    | Acknowledge
-	   11 | BUSY    | Busy
-	   12 | PE      | Paper End
-	   13 | SELIN   | Select In
-	   14 | /AUTOFD | Autofeed
-	   15 | /ERROR  | Error
-	   16 | /INIT   | Initialize
-	   17 | /SEL    | Select
-	18-25 | GND     | Signal Ground
+======  =======  =============
+   Pin  Name     Description
+======  =======  =============
+     1  /STROBE  Strobe
+   2-9  D0-D7    Data Bit 0-7
+    10  /ACK     Acknowledge
+    11  BUSY     Busy
+    12  PE       Paper End
+    13  SELIN    Select In
+    14  /AUTOFD  Autofeed
+    15  /ERROR   Error
+    16  /INIT    Initialize
+    17  /SEL     Select
+ 18-25  GND      Signal Ground
+======  =======  =============
 
-3.5 End
-~~~~~~~
-  That's all, folks! Have fun!
+
+That's all, folks! Have fun!
Signature · 1 line
2.9.3
#57 lore raw

PATCH v2 25/37 docs: input/sentelic: convert it to ReST format

In reply to Mauro Carvalho Chehab

This file has its own particular format that doesn't match any markup one.

Manually change it to get something that would be readable using ReST markup language.

---
 Documentation/input/sentelic.txt | 1000 ++++++++++++++++++++------------------
 1 file changed, 514 insertions(+), 486 deletions(-)
Documentation/input/sentelic.txt +514 -486
index 89251e2a3eba..d1a476f973b1 100644
@@ -1,411 +1,437 @@
-Copyright (C) 2002-2011 Sentelic Corporation.
-Last update: Dec-07-2011
+.. include:: <isonum.txt>
+
+===============
+Sentelic Driver
+===============
+
+
+:Copyright: |copy| 2002-2011 Sentelic Corporation.
+
+:Last update: Dec-07-2011
+
+Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons)
+==========================================================================
 
-==============================================================================
-* Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons)
-==============================================================================
 A) MSID 4: Scrolling wheel mode plus Forward page(4th button) and Backward
    page (5th button)
-@1. Set sample rate to 200;
-@2. Set sample rate to 200;
-@3. Set sample rate to 80;
-@4. Issuing the "Get device ID" command (0xF2) and waits for the response;
-@5. FSP will respond 0x04.
-
-Packet 1
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |Y|X|y|x|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 | | |B|F|W|W|W|W|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7 => Y overflow
-        Bit6 => X overflow
-        Bit5 => Y sign bit
-        Bit4 => X sign bit
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X Movement(9-bit 2's complement integers)
-Byte 3: Y Movement(9-bit 2's complement integers)
-Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
-                     valid values, -8 ~ +7
-        Bit4 => 1 = 4th mouse button is pressed, Forward one page.
-                0 = 4th mouse button is not pressed.
-        Bit5 => 1 = 5th mouse button is pressed, Backward one page.
-                0 = 5th mouse button is not pressed.
-
-B) MSID 6: Horizontal and Vertical scrolling.
-@ Set bit 1 in register 0x40 to 1
-
-# FSP replaces scrolling wheel's movement as 4 bits to show horizontal and
-  vertical scrolling.
-
-Packet 1
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |Y|X|y|x|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 | | |B|F|r|l|u|d|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7 => Y overflow
-        Bit6 => X overflow
-        Bit5 => Y sign bit
-        Bit4 => X sign bit
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X Movement(9-bit 2's complement integers)
-Byte 3: Y Movement(9-bit 2's complement integers)
-Byte 4: Bit0 => the Vertical scrolling movement downward.
-	Bit1 => the Vertical scrolling movement upward.
-	Bit2 => the Horizontal scrolling movement leftward.
-	Bit3 => the Horizontal scrolling movement rightward.
-        Bit4 => 1 = 4th mouse button is pressed, Forward one page.
-                0 = 4th mouse button is not pressed.
-        Bit5 => 1 = 5th mouse button is pressed, Backward one page.
-                0 = 5th mouse button is not pressed.
-
-C) MSID 7:
-# FSP uses 2 packets (8 Bytes) to represent Absolute Position.
-  so we have PACKET NUMBER to identify packets.
+
+1. Set sample rate to 200;
+2. Set sample rate to 200;
+3. Set sample rate to 80;
+4. Issuing the "Get device ID" command (0xF2) and waits for the response;
+5. FSP will respond 0x04.
+
+::
+
+    Packet 1
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |Y|X|y|x|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 | | |B|F|W|W|W|W|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7 => Y overflow
+	    Bit6 => X overflow
+	    Bit5 => Y sign bit
+	    Bit4 => X sign bit
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X Movement(9-bit 2's complement integers)
+    Byte 3: Y Movement(9-bit 2's complement integers)
+    Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
+			valid values, -8 ~ +7
+	    Bit4 => 1 = 4th mouse button is pressed, Forward one page.
+		    0 = 4th mouse button is not pressed.
+	    Bit5 => 1 = 5th mouse button is pressed, Backward one page.
+		    0 = 5th mouse button is not pressed.
+
+B) MSID 6: Horizontal and Vertical scrolling
+
+- Set bit 1 in register 0x40 to 1
+
+FSP replaces scrolling wheel's movement as 4 bits to show horizontal and
+vertical scrolling.
+
+::
+
+    Packet 1
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |Y|X|y|x|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 | | |B|F|r|l|u|d|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7 => Y overflow
+	    Bit6 => X overflow
+	    Bit5 => Y sign bit
+	    Bit4 => X sign bit
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X Movement(9-bit 2's complement integers)
+    Byte 3: Y Movement(9-bit 2's complement integers)
+    Byte 4: Bit0 => the Vertical scrolling movement downward.
+	    Bit1 => the Vertical scrolling movement upward.
+	    Bit2 => the Horizontal scrolling movement leftward.
+	    Bit3 => the Horizontal scrolling movement rightward.
+	    Bit4 => 1 = 4th mouse button is pressed, Forward one page.
+		    0 = 4th mouse button is not pressed.
+	    Bit5 => 1 = 5th mouse button is pressed, Backward one page.
+		    0 = 5th mouse button is not pressed.
+
+C) MSID 7
+
+FSP uses 2 packets (8 Bytes) to represent Absolute Position.
+so we have PACKET NUMBER to identify packets.
+
   If PACKET NUMBER is 0, the packet is Packet 1.
   If PACKET NUMBER is 1, the packet is Packet 2.
   Please count this number in program.
 
-# MSID6 special packet will be enable at the same time when enable MSID 7.
-
-==============================================================================
-* Absolute position for STL3886-G0.
-==============================================================================
-@ Set bit 2 or 3 in register 0x40 to 1
-@ Set bit 6 in register 0x40 to 1
-
-Packet 1 (ABSOLUTE POSITION)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|V|1|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|d|u|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-        Bit5 => valid bit
-        Bit4 => 1
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-        Bit3~Bit2 => X coordinate (ypos[1:0])
-        Bit4 => scroll up
-        Bit5 => scroll down
-        Bit6 => scroll left
-        Bit7 => scroll right
-
-Notify Packet for G0
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |1|0|0|1|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |M|M|M|M|M|M|M|M|  4 |0|0|0|0|0|0|0|0|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-        Bit5 => 0
-        Bit4 => 1
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: Message Type => 0x5A (Enable/Disable status packet)
-        Mode Type => 0xA5 (Normal/Icon mode status)
-Byte 3: Message Type => 0x00 (Disabled)
-                     => 0x01 (Enabled)
-        Mode Type    => 0x00 (Normal)
-                     => 0x01 (Icon)
-Byte 4: Bit7~Bit0 => Don't Care
-
-==============================================================================
-* Absolute position for STL3888-Ax.
-==============================================================================
-Packet 1 (ABSOLUTE POSITION)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|V|A|1|L|0|1|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |x|x|y|y|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
-                When both fingers are up, the last two reports have zero valid
-                bit.
-        Bit4 => arc
-        Bit3 => 1
-        Bit2 => Left Button, 1 is pressed, 0 is released.
-        Bit1 => 0
-        Bit0 => 1
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-        Bit3~Bit2 => X coordinate (ypos[1:0])
-        Bit5~Bit4 => y1_g
-        Bit7~Bit6 => x1_g
-
-Packet 2 (ABSOLUTE POSITION)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|V|A|1|R|1|0|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |x|x|y|y|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordinates packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
-                When both fingers are up, the last two reports have zero valid
-                bit.
-        Bit4 => arc
-        Bit3 => 1
-        Bit2 => Right Button, 1 is pressed, 0 is released.
-        Bit1 => 1
-        Bit0 => 0
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-        Bit3~Bit2 => X coordinate (ypos[1:0])
-        Bit5~Bit4 => y2_g
-        Bit7~Bit6 => x2_g
-
-Notify Packet for STL3888-Ax
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |1|0|1|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|d|u|0|0|0|0|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordinates packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => 1
-        Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
-                0: left button is generated by the on-pad command
-                1: left button is generated by the external button
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
-Byte 3: Bit7~Bit6 => Don't care
-        Bit5~Bit4 => Number of fingers
-        Bit3~Bit1 => Reserved
-        Bit0 => 1: enter gesture mode; 0: leaving gesture mode
-Byte 4: Bit7 => scroll right button
-        Bit6 => scroll left button
-        Bit5 => scroll down button
-        Bit4 => scroll up button
-            * Note that if gesture and additional button (Bit4~Bit7)
-              happen at the same time, the button information will not
-              be sent.
-        Bit3~Bit0 => Reserved
+MSID6 special packet will be enable at the same time when enable MSID 7.
+
+Absolute position for STL3886-G0
+================================
+
+1. Set bit 2 or 3 in register 0x40 to 1
+2. Set bit 6 in register 0x40 to 1
+
+::
+
+    Packet 1 (ABSOLUTE POSITION)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|V|1|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|d|u|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+	    Bit5 => valid bit
+	    Bit4 => 1
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit4 => scroll up
+	    Bit5 => scroll down
+	    Bit6 => scroll left
+	    Bit7 => scroll right
+
+    Notify Packet for G0
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |1|0|0|1|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |M|M|M|M|M|M|M|M|  4 |0|0|0|0|0|0|0|0|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+	    Bit5 => 0
+	    Bit4 => 1
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: Message Type => 0x5A (Enable/Disable status packet)
+	    Mode Type => 0xA5 (Normal/Icon mode status)
+    Byte 3: Message Type => 0x00 (Disabled)
+			=> 0x01 (Enabled)
+	    Mode Type    => 0x00 (Normal)
+			=> 0x01 (Icon)
+    Byte 4: Bit7~Bit0 => Don't Care
+
+Absolute position for STL3888-Ax
+================================
+
+::
+
+    Packet 1 (ABSOLUTE POSITION)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|V|A|1|L|0|1|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |x|x|y|y|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
+		    When both fingers are up, the last two reports have zero valid
+		    bit.
+	    Bit4 => arc
+	    Bit3 => 1
+	    Bit2 => Left Button, 1 is pressed, 0 is released.
+	    Bit1 => 0
+	    Bit0 => 1
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit5~Bit4 => y1_g
+	    Bit7~Bit6 => x1_g
+
+    Packet 2 (ABSOLUTE POSITION)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|V|A|1|R|1|0|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |x|x|y|y|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordinates packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
+		    When both fingers are up, the last two reports have zero valid
+		    bit.
+	    Bit4 => arc
+	    Bit3 => 1
+	    Bit2 => Right Button, 1 is pressed, 0 is released.
+	    Bit1 => 1
+	    Bit0 => 0
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit5~Bit4 => y2_g
+	    Bit7~Bit6 => x2_g
+
+    Notify Packet for STL3888-Ax
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |1|0|1|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|d|u|0|0|0|0|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordinates packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => 1
+	    Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
+		    0: left button is generated by the on-pad command
+		    1: left button is generated by the external button
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
+    Byte 3: Bit7~Bit6 => Don't care
+	    Bit5~Bit4 => Number of fingers
+	    Bit3~Bit1 => Reserved
+	    Bit0 => 1: enter gesture mode; 0: leaving gesture mode
+    Byte 4: Bit7 => scroll right button
+	    Bit6 => scroll left button
+	    Bit5 => scroll down button
+	    Bit4 => scroll up button
+		* Note that if gesture and additional button (Bit4~Bit7)
+		happen at the same time, the button information will not
+		be sent.
+	    Bit3~Bit0 => Reserved
 
 Sample sequence of Multi-finger, Multi-coordinate mode:
 
 	notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
 	abs pkt 2, ..., notify packet (valid bit == 0)
 
-==============================================================================
-* Absolute position for STL3888-B0.
-==============================================================================
-Packet 1(ABSOLUTE POSITION)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|V|F|1|0|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|u|d|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordinates packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
-                When both fingers are up, the last two reports have zero valid
-                bit.
-        Bit4 => finger up/down information. 1: finger down, 0: finger up.
-        Bit3 => 1
-        Bit2 => finger index, 0 is the first finger, 1 is the second finger.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-        Bit3~Bit2 => X coordinate (ypos[1:0])
-        Bit4 => scroll down button
-        Bit5 => scroll up button
-        Bit6 => scroll left button
-        Bit7 => scroll right button
-
-Packet 2 (ABSOLUTE POSITION)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|V|F|1|1|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|u|d|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
-                When both fingers are up, the last two reports have zero valid
-                bit.
-        Bit4 => finger up/down information. 1: finger down, 0: finger up.
-        Bit3 => 1
-        Bit2 => finger index, 0 is the first finger, 1 is the second finger.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-        Bit3~Bit2 => X coordinate (ypos[1:0])
-        Bit4 => scroll down button
-        Bit5 => scroll up button
-        Bit6 => scroll left button
-        Bit7 => scroll right button
-
-Notify Packet for STL3888-B0
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |1|0|1|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|u|d|0|0|0|0|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-                  => 11, Normal data packet with on-pad click
-        Bit5 => 1
-        Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
-                0: left button is generated by the on-pad command
-                1: left button is generated by the external button
-        Bit3 => 1
-        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
-Byte 3: Bit7~Bit6 => Don't care
-        Bit5~Bit4 => Number of fingers
-        Bit3~Bit1 => Reserved
-        Bit0 => 1: enter gesture mode; 0: leaving gesture mode
-Byte 4: Bit7 => scroll right button
-        Bit6 => scroll left button
-        Bit5 => scroll up button
-        Bit4 => scroll down button
-            * Note that if gesture and additional button(Bit4~Bit7)
-              happen at the same time, the button information will not
-              be sent.
-        Bit3~Bit0 => Reserved
+Absolute position for STL3888-B0
+================================
+
+::
+
+    Packet 1(ABSOLUTE POSITION)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|V|F|1|0|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|u|d|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordinates packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
+		    When both fingers are up, the last two reports have zero valid
+		    bit.
+	    Bit4 => finger up/down information. 1: finger down, 0: finger up.
+	    Bit3 => 1
+	    Bit2 => finger index, 0 is the first finger, 1 is the second finger.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit4 => scroll down button
+	    Bit5 => scroll up button
+	    Bit6 => scroll left button
+	    Bit7 => scroll right button
+
+    Packet 2 (ABSOLUTE POSITION)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|V|F|1|1|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|u|d|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
+		    When both fingers are up, the last two reports have zero valid
+		    bit.
+	    Bit4 => finger up/down information. 1: finger down, 0: finger up.
+	    Bit3 => 1
+	    Bit2 => finger index, 0 is the first finger, 1 is the second finger.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit4 => scroll down button
+	    Bit5 => scroll up button
+	    Bit6 => scroll left button
+	    Bit7 => scroll right button
+
+Notify Packet for STL3888-B0::
+
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |1|0|1|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|u|d|0|0|0|0|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+		    => 11, Normal data packet with on-pad click
+	    Bit5 => 1
+	    Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
+		    0: left button is generated by the on-pad command
+		    1: left button is generated by the external button
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
+    Byte 3: Bit7~Bit6 => Don't care
+	    Bit5~Bit4 => Number of fingers
+	    Bit3~Bit1 => Reserved
+	    Bit0 => 1: enter gesture mode; 0: leaving gesture mode
+    Byte 4: Bit7 => scroll right button
+	    Bit6 => scroll left button
+	    Bit5 => scroll up button
+	    Bit4 => scroll down button
+		* Note that if gesture and additional button(Bit4~Bit7)
+		happen at the same time, the button information will not
+		be sent.
+	    Bit3~Bit0 => Reserved
 
 Sample sequence of Multi-finger, Multi-coordinate mode:
 
 	notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
 	abs pkt 2, ..., notify packet (valid bit == 0)
 
-==============================================================================
-* Absolute position for STL3888-Cx and STL3888-Dx.
-==============================================================================
-Single Finger, Absolute Coordinate Mode (SFAC)
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|0|P|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|B|F|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordinates packet
-                  => 10, Notify packet
-	Bit5 => Coordinate mode(always 0 in SFAC mode):
-		0: single-finger absolute coordinates (SFAC) mode
-		1: multi-finger, multiple coordinates (MFMC) mode
-	Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
-		1: The LEFT button is generated by external button
-		Default is 1 even if the LEFT button is not pressed.
-	Bit3 => Always 1, as specified by PS/2 protocol.
-	Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-	Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-	Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-	Bit3~Bit2 => X coordinate (ypos[1:0])
-	Bit4 => 4th mouse button(forward one page)
-	Bit5 => 5th mouse button(backward one page)
-	Bit6 => scroll left button
-	Bit7 => scroll right button
-
-Multi Finger, Multiple Coordinates Mode (MFMC):
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |0|1|1|P|1|F|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|B|F|X|X|Y|Y|
-      |---------------|     |---------------|    |---------------|    |---------------|
-
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordination packet
-                  => 10, Notify packet
-	Bit5 => Coordinate mode (always 1 in MFMC mode):
-		0: single-finger absolute coordinates (SFAC) mode
-		1: multi-finger, multiple coordinates (MFMC) mode
-	Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
-		1: The LEFT button is generated by external button
-		Default is 1 even if the LEFT button is not pressed.
-	Bit3 => Always 1, as specified by PS/2 protocol.
-	Bit2 => Finger index, 0 is the first finger, 1 is the second finger.
-		If bit 1 and 0 are all 1 and bit 4 is 0, the middle external
-		button is pressed.
-	Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-	Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: X coordinate (xpos[9:2])
-Byte 3: Y coordinate (ypos[9:2])
-Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
-	Bit3~Bit2 => X coordinate (ypos[1:0])
-	Bit4 => 4th mouse button(forward one page)
-	Bit5 => 5th mouse button(backward one page)
-	Bit6 => scroll left button
-	Bit7 => scroll right button
-
-  When one of the two fingers is up, the device will output four consecutive
+Absolute position for STL3888-Cx and STL3888-Dx
+===============================================
+
+::
+
+    Single Finger, Absolute Coordinate Mode (SFAC)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|0|P|1|M|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|B|F|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordinates packet
+		    => 10, Notify packet
+	    Bit5 => Coordinate mode(always 0 in SFAC mode):
+		    0: single-finger absolute coordinates (SFAC) mode
+		    1: multi-finger, multiple coordinates (MFMC) mode
+	    Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
+		    1: The LEFT button is generated by external button
+		    Default is 1 even if the LEFT button is not pressed.
+	    Bit3 => Always 1, as specified by PS/2 protocol.
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit4 => 4th mouse button(forward one page)
+	    Bit5 => 5th mouse button(backward one page)
+	    Bit6 => scroll left button
+	    Bit7 => scroll right button
+
+    Multi Finger, Multiple Coordinates Mode (MFMC):
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |0|1|1|P|1|F|R|L|  2  |X|X|X|X|X|X|X|X|  3 |Y|Y|Y|Y|Y|Y|Y|Y|  4 |r|l|B|F|X|X|Y|Y|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordination packet
+		    => 10, Notify packet
+	    Bit5 => Coordinate mode (always 1 in MFMC mode):
+		    0: single-finger absolute coordinates (SFAC) mode
+		    1: multi-finger, multiple coordinates (MFMC) mode
+	    Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
+		    1: The LEFT button is generated by external button
+		    Default is 1 even if the LEFT button is not pressed.
+	    Bit3 => Always 1, as specified by PS/2 protocol.
+	    Bit2 => Finger index, 0 is the first finger, 1 is the second finger.
+		    If bit 1 and 0 are all 1 and bit 4 is 0, the middle external
+		    button is pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: X coordinate (xpos[9:2])
+    Byte 3: Y coordinate (ypos[9:2])
+    Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
+	    Bit3~Bit2 => X coordinate (ypos[1:0])
+	    Bit4 => 4th mouse button(forward one page)
+	    Bit5 => 5th mouse button(backward one page)
+	    Bit6 => scroll left button
+	    Bit7 => scroll right button
+
+When one of the two fingers is up, the device will output four consecutive
 MFMC#0 report packets with zero X and Y to represent 1st finger is up or
 four consecutive MFMC#1 report packets with zero X and Y to represent that
 the 2nd finger is up.  On the other hand, if both fingers are up, the device
 will output four consecutive single-finger, absolute coordinate(SFAC) packets
 with zero X and Y.
 
-Notify Packet for STL3888-Cx/Dx
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |1|0|0|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|u|d|0|0|0|0|
-      |---------------|     |---------------|    |---------------|    |---------------|
+Notify Packet for STL3888-Cx/Dx::
 
-Byte 1: Bit7~Bit6 => 00, Normal data packet
-                  => 01, Absolute coordinates packet
-                  => 10, Notify packet
-	Bit5 => Always 0
-	Bit4 => 0: The LEFT button is generated by on-pad command(OPC)
-		1: The LEFT button is generated by external button
-		Default is 1 even if the LEFT button is not pressed.
-	Bit3 => 1
-	Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
-	Bit1 => Right Button, 1 is pressed, 0 is not pressed.
-	Bit0 => Left Button, 1 is pressed, 0 is not pressed.
-Byte 2: Message type:
-	0xba => gesture information
-	0xc0 => one finger hold-rotating gesture
-Byte 3: The first parameter for the received message:
-	0xba => gesture ID (refer to the 'Gesture ID' section)
-	0xc0 => region ID
-Byte 4: The second parameter for the received message:
-	0xba => N/A
-	0xc0 => finger up/down information
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |1|0|0|P|1|M|R|L|  2  |C|C|C|C|C|C|C|C|  3 |0|0|F|F|0|0|0|i|  4 |r|l|u|d|0|0|0|0|
+	  |---------------|     |---------------|    |---------------|    |---------------|
+
+    Byte 1: Bit7~Bit6 => 00, Normal data packet
+		    => 01, Absolute coordinates packet
+		    => 10, Notify packet
+	    Bit5 => Always 0
+	    Bit4 => 0: The LEFT button is generated by on-pad command(OPC)
+		    1: The LEFT button is generated by external button
+		    Default is 1 even if the LEFT button is not pressed.
+	    Bit3 => 1
+	    Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
+	    Bit1 => Right Button, 1 is pressed, 0 is not pressed.
+	    Bit0 => Left Button, 1 is pressed, 0 is not pressed.
+    Byte 2: Message type:
+	    0xba => gesture information
+	    0xc0 => one finger hold-rotating gesture
+    Byte 3: The first parameter for the received message:
+	    0xba => gesture ID (refer to the 'Gesture ID' section)
+	    0xc0 => region ID
+    Byte 4: The second parameter for the received message:
+	    0xba => N/A
+	    0xc0 => finger up/down information
 
 Sample sequence of Multi-finger, Multi-coordinates mode:
 
@@ -416,50 +442,51 @@ Sample sequence of Multi-finger, Multi-coordinates mode:
 	That is, when the device is in MFMC mode, the host will receive
 	interleaved absolute coordinate packets for each finger.
 
-==============================================================================
-* FSP Enable/Disable packet
-==============================================================================
-   Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
-BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
-  1   |Y|X|0|0|1|M|R|L|  2  |0|1|0|1|1|0|1|E|  3 | | | | | | | | |  4 | | | | | | | | |
-      |---------------|     |---------------|    |---------------|    |---------------|
+FSP Enable/Disable packet
+=========================
 
-FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
-command. Host will receive the packet which Middle, Right, Left button will
-be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
-Ignore the other bytes of the packet.
+::
 
-Byte 1: Bit7 => 0, Y overflow
-        Bit6 => 0, X overflow
-	Bit5 => 0, Y sign bit
-        Bit4 => 0, X sign bit
-	Bit3 => 1
-	Bit2 => 1, Middle Button
-        Bit1 => 1, Right Button
-        Bit0 => 1, Left Button
-Byte 2: Bit7~1 => (0101101b)
-        Bit0 => 1 = Enable
-		0 = Disable
-Byte 3: Don't care
-Byte 4: Don't care (MOUSE ID 3, 4)
-Byte 5~8: Don't care (Absolute packet)
+    Bit 7 6 5 4 3 2 1 0       7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0      7 6 5 4 3 2 1 0
+    BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
+      1   |Y|X|0|0|1|M|R|L|  2  |0|1|0|1|1|0|1|E|  3 | | | | | | | | |  4 | | | | | | | | |
+	  |---------------|     |---------------|    |---------------|    |---------------|
 
-==============================================================================
-* PS/2 Command Set
-==============================================================================
+    FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
+    command. Host will receive the packet which Middle, Right, Left button will
+    be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
+    Ignore the other bytes of the packet.
+
+    Byte 1: Bit7 => 0, Y overflow
+	    Bit6 => 0, X overflow
+	    Bit5 => 0, Y sign bit
+	    Bit4 => 0, X sign bit
+	    Bit3 => 1
+	    Bit2 => 1, Middle Button
+	    Bit1 => 1, Right Button
+	    Bit0 => 1, Left Button
+    Byte 2: Bit7~1 => (0101101b)
+	    Bit0 => 1 = Enable
+		    0 = Disable
+    Byte 3: Don't care
+    Byte 4: Don't care (MOUSE ID 3, 4)
+    Byte 5~8: Don't care (Absolute packet)
+
+PS/2 Command Set
+================
 
 FSP supports basic PS/2 commanding set and modes, refer to following URL for
 details about PS/2 commands:
 
 http://www.computer-engineering.org/ps2mouse/
 
-==============================================================================
-* Programming Sequence for Determining Packet Parsing Flow
-==============================================================================
+Programming Sequence for Determining Packet Parsing Flow
+========================================================
+
 1. Identify FSP by reading device ID(0x00) and version(0x01) register
 
-2a. For FSP version < STL3888 Cx, determine number of buttons by reading
-    the 'test mode status' (0x20) register:
+2. For FSP version < STL3888 Cx, determine number of buttons by reading
+   the 'test mode status' (0x20) register::
 
 	buttons = reg[0x20] & 0x30
 
@@ -476,25 +503,24 @@ http://www.computer-engineering.org/ps2mouse/
 		Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
 		section A for packet parsing detail
 
-2b. For FSP version >= STL3888 Cx:
+3. For FSP version >= STL3888 Cx:
 	Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
 	section A for packet parsing detail (ignore byte 4, bit ~ 7)
 
-==============================================================================
-* Programming Sequence for Register Reading/Writing
-==============================================================================
+Programming Sequence for Register Reading/Writing
+=================================================
 
 Register inversion requirement:
 
-  Following values needed to be inverted(the '~' operator in C) before being
-sent to FSP:
+Following values needed to be inverted(the '~' operator in C) before being
+sent to FSP::
 
 	0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff.
 
 Register swapping requirement:
 
-  Following values needed to have their higher 4 bits and lower 4 bits being
-swapped before being sent to FSP:
+Following values needed to have their higher 4 bits and lower 4 bits being
+swapped before being sent to FSP::
 
 	10, 20, 40, 60, 80, 100 and 200.
 
@@ -512,33 +538,33 @@ Register reading sequence:
 	inverted(refer to the 'Register inversion requirement' section),
 	goto step 6
 
-	5a. send 0x68 PS/2 command to FSP;
+	  a. send 0x68 PS/2 command to FSP;
 
-	5b. send the inverted register address to FSP and goto step 8;
+	  b. send the inverted register address to FSP and goto step 8;
 
 	6. if the register address being to read is not required to be
 	swapped(refer to the 'Register swapping requirement' section),
 	goto step 7
 
-	6a. send 0xcc PS/2 command to FSP;
+	  a. send 0xcc PS/2 command to FSP;
 
-	6b. send the swapped register address to FSP and goto step 8;
+	  b. send the swapped register address to FSP and goto step 8;
 
 	7. send 0x66 PS/2 command to FSP;
 
-	7a. send the original register address to FSP and goto step 8;
+	  a. send the original register address to FSP and goto step 8;
 
 	8. send 0xe9(status request) PS/2 command to FSP;
 
 	9. the 4th byte of the response read from FSP should be the
-	requested register value(?? indicates don't care byte):
+	requested register value(?? indicates don't care byte)::
 
 		host: 0xe9
 		3888: 0xfa (??) (??) (val)
 
 	* Note that since the Cx release, the hardware will return 1's
-	complement of the register value at the 3rd byte of status request
-	result:
+	  complement of the register value at the 3rd byte of status request
+	  result::
 
 		host: 0xe9
 		3888: 0xfa (??) (~val) (val)
@@ -551,21 +577,21 @@ Register writing sequence:
 	inverted(refer to the 'Register inversion requirement' section),
 	goto step 3
 
-	2a. send 0x74 PS/2 command to FSP;
+	  a. send 0x74 PS/2 command to FSP;
 
-	2b. send the inverted register address to FSP and goto step 5;
+	  b. send the inverted register address to FSP and goto step 5;
 
 	3. if the register address being to write is not required to be
 	swapped(refer to the 'Register swapping requirement' section),
 	goto step 4
 
-	3a. send 0x77 PS/2 command to FSP;
+	  a. send 0x77 PS/2 command to FSP;
 
-	3b. send the swapped register address to FSP and goto step 5;
+	  b. send the swapped register address to FSP and goto step 5;
 
 	4. send 0x55 PS/2 command to FSP;
 
-	4a. send the register address to FSP and goto step 5;
+	  a. send the register address to FSP and goto step 5;
 
 	5. send 0xf3 PS/2 command to FSP;
 
@@ -573,43 +599,42 @@ Register writing sequence:
 	inverted(refer to the 'Register inversion requirement' section),
 	goto step 7
 
-	6a. send 0x47 PS/2 command to FSP;
+	  a. send 0x47 PS/2 command to FSP;
 
-	6b. send the inverted register value to FSP and goto step 9;
+	  b. send the inverted register value to FSP and goto step 9;
 
 	7. if the register value being to write is not required to be
 	swapped(refer to the 'Register swapping requirement' section),
 	goto step 8
 
-	7a. send 0x44 PS/2 command to FSP;
+	  a. send 0x44 PS/2 command to FSP;
 
-	7b. send the swapped register value to FSP and goto step 9;
+	  b. send the swapped register value to FSP and goto step 9;
 
 	8. send 0x33 PS/2 command to FSP;
 
-	8a. send the register value to FSP;
+	  a. send the register value to FSP;
 
 	9. the register writing sequence is completed.
 
-	* Note that since the Cx release, the hardware will return 1's
-	complement of the register value at the 3rd byte of status request
-	result. Host can optionally send another 0xe9 (status request) PS/2
-	command to FSP at the end of register writing to verify that the
-	register writing operation is successful (?? indicates don't care
-	byte):
+	* Since the Cx release, the hardware will return 1's
+	  complement of the register value at the 3rd byte of status request
+	  result. Host can optionally send another 0xe9 (status request) PS/2
+	  command to FSP at the end of register writing to verify that the
+	  register writing operation is successful (?? indicates don't care
+	  byte)::
 
 		host: 0xe9
 		3888: 0xfa (??) (~val) (val)
 
-==============================================================================
-* Programming Sequence for Page Register Reading/Writing
-==============================================================================
+Programming Sequence for Page Register Reading/Writing
+======================================================
 
-  In order to overcome the limitation of maximum number of registers
+In order to overcome the limitation of maximum number of registers
 supported, the hardware separates register into different groups called
 'pages.' Each page is able to include up to 255 registers.
 
-  The default page after power up is 0x82; therefore, if one has to get
+The default page after power up is 0x82; therefore, if one has to get
 access to register 0x8301, one has to use following sequence to switch
 to page 0x83, then start reading/writing from/to offset 0x01 by using
 the register read/write sequence described in previous section.
@@ -632,6 +657,7 @@ Page register reading sequence:
 
 	8. the response read from FSP should be the requested page value.
 
+
 Page register writing sequence:
 
 	1. send 0xf3 PS/2 command to FSP;
@@ -646,17 +672,17 @@ Page register writing sequence:
 	inverted(refer to the 'Register inversion requirement' section),
 	goto step 6
 
-	5a. send 0x47 PS/2 command to FSP;
+	  a. send 0x47 PS/2 command to FSP;
 
-	5b. send the inverted page address to FSP and goto step 9;
+	  b. send the inverted page address to FSP and goto step 9;
 
 	6. if the page address being written is not required to be
 	swapped(refer to the 'Register swapping requirement' section),
 	goto step 7
 
-	6a. send 0x44 PS/2 command to FSP;
+	  a. send 0x44 PS/2 command to FSP;
 
-	6b. send the swapped page address to FSP and goto step 9;
+	  b. send the swapped page address to FSP and goto step 9;
 
 	7. send 0x33 PS/2 command to FSP;
 
@@ -664,16 +690,17 @@ Page register writing sequence:
 
 	9. the page register writing sequence is completed.
 
-==============================================================================
-* Gesture ID
-==============================================================================
+Gesture ID
+==========
 
-  Unlike other devices which sends multiple fingers' coordinates to host,
+Unlike other devices which sends multiple fingers' coordinates to host,
 FSP processes multiple fingers' coordinates internally and convert them
 into a 8 bits integer, namely 'Gesture ID.'  Following is a list of
 supported gesture IDs:
 
+	======= ==================================
 	ID	Description
+	======= ==================================
 	0x86	2 finger straight up
 	0x82	2 finger straight down
 	0x80	2 finger straight right
@@ -687,38 +714,38 @@ supported gesture IDs:
 	0x28	3 finger straight right
 	0x2c	3 finger straight left
 	0x38	palm
+	======= ==================================
 
-==============================================================================
-* Register Listing
-==============================================================================
+Register Listing
+================
 
-  Registers are represented in 16 bits values. The higher 8 bits represent
+Registers are represented in 16 bits values. The higher 8 bits represent
 the page address and the lower 8 bits represent the relative offset within
 that particular page.  Refer to the 'Programming Sequence for Page Register
 Reading/Writing' section for instructions on how to change current page
-address.
+address::
 
-offset	width		default	r/w	name
-0x8200	bit7~bit0	0x01	RO	device ID
+ offset	width		default	r/w	name
+ 0x8200	bit7~bit0	0x01	RO	device ID
 
-0x8201	bit7~bit0		RW	version ID
+ 0x8201	bit7~bit0		RW	version ID
 					0xc1: STL3888 Ax
 					0xd0 ~ 0xd2: STL3888 Bx
 					0xe0 ~ 0xe1: STL3888 Cx
 					0xe2 ~ 0xe3: STL3888 Dx
 
-0x8202	bit7~bit0	0x01	RO	vendor ID
+ 0x8202	bit7~bit0	0x01	RO	vendor ID
 
-0x8203	bit7~bit0	0x01	RO	product ID
+ 0x8203	bit7~bit0	0x01	RO	product ID
 
-0x8204	bit3~bit0	0x01	RW	revision ID
+ 0x8204	bit3~bit0	0x01	RW	revision ID
 
-0x820b					test mode status 1
+ 0x820b					test mode status 1
 	bit3		1	RO	0: rotate 180 degree
 					1: no rotation
 					*only supported by H/W prior to Cx
 
-0x820f					register file page control
+ 0x820f					register file page control
 	bit2		0	RW	1: rotate 180 degree
 					0: no rotation
 					*supported since Cx
@@ -726,7 +753,7 @@ offset	width		default	r/w	name
 	bit0		0	RW	1 to enable page 1 register files
 					*only supported by H/W prior to Cx
 
-0x8210				RW	system control 1
+ 0x8210				RW	system control 1
 	bit0		1	RW	Reserved, must be 1
 	bit1		0	RW	Reserved, must be 0
 	bit4		0	RW	Reserved, must be 0
@@ -737,7 +764,7 @@ offset	width		default	r/w	name
 	40 41 42 43.  In addition to that, this bit must be 1 when gesture
 	mode is enabled)
 
-0x8220					test mode status
+ 0x8220					test mode status
 	bit5~bit4		RO	number of buttons
 					11 => 2, lbtn/rbtn
 					10 => 4, lbtn/rbtn/scru/scrd
@@ -745,13 +772,13 @@ offset	width		default	r/w	name
 					00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
 					*only supported by H/W prior to Cx
 
-0x8231				RW	on-pad command detection
+ 0x8231				RW	on-pad command detection
 	bit7		0	RW	on-pad command left button down tag
 					enable
 					0: disable, 1: enable
 					*only supported by H/W prior to Cx
 
-0x8234				RW	on-pad command control 5
+ 0x8234				RW	on-pad command control 5
 	bit4~bit0	0x05	RW	XLO in 0s/4/1, so 03h = 0010.1b = 2.5
 	(Note that position unit is in 0.5 scanline)
 					*only supported by H/W prior to Cx
@@ -760,22 +787,22 @@ offset	width		default	r/w	name
 					0: disable, 1: enable
 					*only supported by H/W prior to Cx
 
-0x8235				RW	on-pad command control 6
+ 0x8235				RW	on-pad command control 6
 	bit4~bit0	0x1d	RW	XHI in 0s/4/1, so 19h = 1100.1b = 12.5
 	(Note that position unit is in 0.5 scanline)
 					*only supported by H/W prior to Cx
 
-0x8236				RW	on-pad command control 7
+ 0x8236				RW	on-pad command control 7
 	bit4~bit0	0x04	RW	YLO in 0s/4/1, so 03h = 0010.1b = 2.5
 	(Note that position unit is in 0.5 scanline)
 					*only supported by H/W prior to Cx
 
-0x8237				RW	on-pad command control 8
+ 0x8237				RW	on-pad command control 8
 	bit4~bit0	0x13	RW	YHI in 0s/4/1, so 11h = 1000.1b = 8.5
 	(Note that position unit is in 0.5 scanline)
 					*only supported by H/W prior to Cx
 
-0x8240				RW	system control 5
+ 0x8240				RW	system control 5
 	bit1		0	RW	FSP Intellimouse mode enable
 					0: disable, 1: enable
 					*only supported by H/W prior to Cx
@@ -813,7 +840,7 @@ offset	width		default	r/w	name
 					0: disable, 1: enable
 					*only supported by H/W prior to Cx
 
-0x8243				RW	on-pad control
+ 0x8243				RW	on-pad control
 	bit0		0	RW	on-pad control enable
 					0: disable, 1: enable
 	(Note that if this bit is cleared, bit 3/5 will be ineffective)
@@ -827,7 +854,7 @@ offset	width		default	r/w	name
 					0: disable, 1: enable
 					*only supported by H/W prior to Cx
 
-0x8290				RW	software control register 1
+ 0x8290				RW	software control register 1
 	bit0		0	RW	absolute coordination mode
 					0: disable, 1: enable
 					*supported since Cx
@@ -856,16 +883,17 @@ offset	width		default	r/w	name
 					*supported since Cx
 
 	bit7		0	RW	Bx packet output compatible mode
-					0: disable, 1: enable					*supported since Cx
+					0: disable, 1: enable
+					*supported since Cx
 					*supported since Cx
 
 
-0x833d				RW	on-pad command control 1
+ 0x833d				RW	on-pad command control 1
 	bit7		1	RW	on-pad command detection enable
 					0: disable, 1: enable
 					*supported since Cx
 
-0x833e				RW	on-pad command detection
+ 0x833e				RW	on-pad command detection
 	bit7		0	RW	on-pad command left button down tag
 					enable. Works only in H/W based PS/2
 					data packet mode.
Signature · 1 line
2.9.3
#47 lore raw

PATCH v2 15/37 docs: input/gpio-tilt: convert it to ReST format

In reply to Mauro Carvalho Chehab

This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.

---
 Documentation/input/gpio-tilt.txt | 124 +++++++++++++++++++-------------------
 1 file changed, 62 insertions(+), 62 deletions(-)
Documentation/input/gpio-tilt.txt +62 -62
index 2cdfd9bcb1af..23de9eff6a34 100644
@@ -28,76 +28,76 @@ Example:
 --------
 
 Example configuration for a single TS1003 tilt switch that rotates around
-one axis in 4 steps and emits the current tilt via two GPIOs.
+one axis in 4 steps and emits the current tilt via two GPIOs::
 
-static int sg060_tilt_enable(struct device *dev) {
-	/* code to enable the sensors */
-};
+    static int sg060_tilt_enable(struct device *dev) {
+	    /* code to enable the sensors */
+    };
 
-static void sg060_tilt_disable(struct device *dev) {
-	/* code to disable the sensors */
-};
+    static void sg060_tilt_disable(struct device *dev) {
+	    /* code to disable the sensors */
+    };
 
-static struct gpio sg060_tilt_gpios[] = {
-	{ SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" },
-	{ SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" },
-};
+    static struct gpio sg060_tilt_gpios[] = {
+	    { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" },
+	    { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" },
+    };
 
-static struct gpio_tilt_state sg060_tilt_states[] = {
-	{
-		.gpios = (0 << 1) | (0 << 0),
-		.axes = (int[]) {
-			0,
-		},
-	}, {
-		.gpios = (0 << 1) | (1 << 0),
-		.axes = (int[]) {
-			1, /* 90 degrees */
-		},
-	}, {
-		.gpios = (1 << 1) | (1 << 0),
-		.axes = (int[]) {
-			2, /* 180 degrees */
-		},
-	}, {
-		.gpios = (1 << 1) | (0 << 0),
-		.axes = (int[]) {
-			3, /* 270 degrees */
-		},
-	},
-};
+    static struct gpio_tilt_state sg060_tilt_states[] = {
+	    {
+		    .gpios = (0 << 1) | (0 << 0),
+		    .axes = (int[]) {
+			    0,
+		    },
+	    }, {
+		    .gpios = (0 << 1) | (1 << 0),
+		    .axes = (int[]) {
+			    1, /* 90 degrees */
+		    },
+	    }, {
+		    .gpios = (1 << 1) | (1 << 0),
+		    .axes = (int[]) {
+			    2, /* 180 degrees */
+		    },
+	    }, {
+		    .gpios = (1 << 1) | (0 << 0),
+		    .axes = (int[]) {
+			    3, /* 270 degrees */
+		    },
+	    },
+    };
 
-static struct gpio_tilt_axis sg060_tilt_axes[] = {
-	{
-		.axis = ABS_RY,
-		.min = 0,
-		.max = 3,
-		.fuzz = 0,
-		.flat = 0,
-	},
-};
+    static struct gpio_tilt_axis sg060_tilt_axes[] = {
+	    {
+		    .axis = ABS_RY,
+		    .min = 0,
+		    .max = 3,
+		    .fuzz = 0,
+		    .flat = 0,
+	    },
+    };
 
-static struct gpio_tilt_platform_data sg060_tilt_pdata= {
-	.gpios = sg060_tilt_gpios,
-	.nr_gpios = ARRAY_SIZE(sg060_tilt_gpios),
+    static struct gpio_tilt_platform_data sg060_tilt_pdata= {
+	    .gpios = sg060_tilt_gpios,
+	    .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios),
 
-	.axes = sg060_tilt_axes,
-	.nr_axes = ARRAY_SIZE(sg060_tilt_axes),
+	    .axes = sg060_tilt_axes,
+	    .nr_axes = ARRAY_SIZE(sg060_tilt_axes),
 
-	.states = sg060_tilt_states,
-	.nr_states = ARRAY_SIZE(sg060_tilt_states),
+	    .states = sg060_tilt_states,
+	    .nr_states = ARRAY_SIZE(sg060_tilt_states),
 
-	.debounce_interval = 100,
+	    .debounce_interval = 100,
 
-	.poll_interval = 1000,
-	.enable = sg060_tilt_enable,
-	.disable = sg060_tilt_disable,
-};
+	    .poll_interval = 1000,
+	    .enable = sg060_tilt_enable,
+	    .disable = sg060_tilt_disable,
+    };
 
-static struct platform_device sg060_device_tilt = {
-	.name = "gpio-tilt-polled",
-	.id = -1,
-	.dev = {
-		.platform_data = &sg060_tilt_pdata,
-	},
-};
+    static struct platform_device sg060_device_tilt = {
+	    .name = "gpio-tilt-polled",
+	    .id = -1,
+	    .dev = {
+		    .platform_data = &sg060_tilt_pdata,
+	    },
+    };
Signature · 1 line
2.9.3
#64 lore raw

PATCH v2 32/37 docs: input/interactive: convert from xfig to svg

In reply to Mauro Carvalho Chehab

We're using svg as the standard format for vectorial images.

Convert it to .svg, in a way that it is easily editable.

---
 Documentation/input/interactive.fig | 42 -------------------------------------
 Documentation/input/interactive.svg | 24 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 42 deletions(-)
 delete mode 100644 Documentation/input/interactive.fig
 create mode 100644 Documentation/input/interactive.svg
Documentation/input/interactive.fig deleted +0 -42
deleted file mode 100644
index 1e7de387723a..000000000000
@@ -1,42 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter  
-100.00
-Single
--2
-1200 2
-2 1 0 2 0 7 50 0 -1 6.000 0 0 -1 0 0 6
-	 1200 3600 1800 3600 2400 4800 3000 4800 4200 5700 4800 5700
-2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
-	 1200 3150 4800 3150 4800 6300 1200 6300 1200 3150
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
-	 1200 4800 4800 4800
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
-	 2400 4800 2400 6525 1950 7125 1950 7800
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
-	 3000 4800 3000 6525 3600 7125 3600 7800
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
-	0 0 1.00 60.00 120.00
-	 3825 5400 4125 5100 5400 5100
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
-	0 0 1.00 60.00 120.00
-	 2100 4200 2400 3900 5400 3900
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
-	 4800 5700 5400 5700
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
-	 1800 3600 5400 3600
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
-	0 0 1.00 60.00 120.00
-	 2700 4800 2700 4425 5400 4425
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
-	0 0 1.00 60.00 120.00
-	0 0 1.00 60.00 120.00
-	 1950 7800 3600 7800
-4 1 0 50 0 0 12 0.0000 4 135 810 2775 7725 Dead band\001
-4 0 0 50 0 0 12 0.0000 4 180 1155 5400 5700 right saturation\001
-4 0 0 50 0 0 12 0.0000 4 135 1065 5400 3600 left saturation\001
-4 0 0 50 0 0 12 0.0000 4 180 2505 5400 3900 left coeff ( positive in that case )\001
-4 0 0 50 0 0 12 0.0000 4 180 2640 5475 5100 right coeff ( negative in that case )\001
-4 0 0 50 0 0 12 0.0000 4 105 480 5400 4425 center\001
Documentation/input/interactive.svg new file +24 -0
new file mode 100644
index 000000000000..a3513709a09b
@@ -0,0 +1,24 @@
+<svg width="5.75in" height="3.90in" version="1.1" viewBox="1178 3138 6779.9424 4671.3427" xmlns="http://www.w3.org/2000/svg">
+ <polyline transform="translate(-18.5,-16.294)" points="1200 3600 1800 3600 2400 4800 3e3 4800 4200 5700 4800 5700" fill="none" stroke="#000" stroke-width="15"/>
+ <rect x="1181.5" y="3133.7" width="3600" height="3150" rx="0" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="1200 4800 4800 4800" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2400 4800 2400 6525 1950 7125 1950 7800" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="3e3 4800 3e3 6525 3600 7125 3600 7800" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="3837 5389 4125 5100 5400 5100" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="3889 5292 3826 5398 3932 5334" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2112 4189 2400 3900 5400 3900" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2164 4092 2101 4198 2207 4134" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="4800 5700 5400 5700" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="1800 3600 5400 3600" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2700 4784 2700 4425 5400 4425" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2670 4678 2700 4798 2730 4678" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="1967 7800 3583 7800" fill="none" stroke="#000" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="3478 7830 3598 7800 3478 7770" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/>
+ <polyline transform="translate(-18.5,-16.294)" points="2072 7770 1952 7800 2072 7830" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/>
+ <text x="2775" y="7725" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" text-anchor="middle" xml:space="preserve">Dead band</text>
+ <text x="5400" y="5700" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">right saturation</text>
+ <text x="5400" y="3600" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">left saturation</text>
+ <text x="5400" y="3900" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">left coeff ( positive in that case )</text>
+ <text x="5475" y="5100" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">right coeff ( negative in that case )</text>
+ <text x="5400" y="4425" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">center</text>
+</svg>
Signature · 1 line
2.9.3
#68 lore raw

PATCH v2 36/37 hid-logitech-hidpp: add support for high res wheel

In reply to Mauro Carvalho Chehab

Some Logitech mouses (MX Anyware 2 and MX Master) have support for a high-resolution wheel.

This wheel can work in backward-compatible mode, generating wheel events via HID normal events, or it can use new HID++ events that report not only the wheel movement, but also the resolution.

Add support for it.

---
 drivers/hid/hid-logitech-hidpp.c | 199 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 199 insertions(+)
drivers/hid/hid-logitech-hidpp.c +199 -0
index 2e2515a4c070..c208a5107511 100644
@@ -62,6 +62,7 @@ MODULE_PARM_DESC(disable_tap_to_click,
 #define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS	BIT(22)
 #define HIDPP_QUIRK_NO_HIDINPUT			BIT(23)
 #define HIDPP_QUIRK_FORCE_OUTPUT_REPORTS	BIT(24)
+#define HIDPP_QUIRK_HIRES_SCROLL		BIT(25)
 
 #define HIDPP_QUIRK_DELAYED_INIT		(HIDPP_QUIRK_NO_HIDINPUT | \
 						 HIDPP_QUIRK_CONNECT_EVENTS)
@@ -1361,6 +1362,67 @@ static int hidpp_ff_deinit(struct hid_device *hid)
 	return 0;
 }
 
+/* -------------------------------------------------------------------------- */
+/* 0x2121: High Resolution Wheel                                              */
+/* -------------------------------------------------------------------------- */
+
+#define HIDPP_HIGH_RES_WHEEL		0x2121
+
+#define CMD_MOUSE_SET_WHEEL_MODE	0x20
+#define CMD_MOUSE_GET_WHEEL_RATCHET	0x30
+
+struct high_res_wheel_data {
+	u8 feature_index;
+	struct input_dev *input;
+	bool ratchet;
+};
+
+/**
+ * hidpp_mouse_set_wheel_mode - Sets high resolution wheel mode
+ *
+ * @invert:	if true, inverts wheel movement
+ * @high_res:	if true, wheel is in high-resolution mode. Otherwise, low res
+ * @hidpp:	if true, report wheel events via HID++ notification. If false,
+ *		use standard HID events
+ */
+static int hidpp_mouse_set_wheel_mode(struct hidpp_device *hidpp,
+				      bool invert,
+				      bool high_res,
+				      bool hidpp_mode)
+{
+	struct high_res_wheel_data *hrd = hidpp->private_data;
+	u8 feature_type;
+	struct hidpp_report response;
+	int ret;
+	u8 params[16] = { 0 };
+
+	if (!hrd->feature_index) {
+		ret = hidpp_root_get_feature(hidpp,
+					    HIDPP_HIGH_RES_WHEEL,
+					    &hrd->feature_index,
+					    &feature_type);
+		if (ret)
+			/* means that the device is not powered up */
+			return ret;
+	}
+
+	params[0] = invert     ? 0x4 : 0  |
+		    high_res   ? 0x2 : 0  |
+		    hidpp_mode ? 0x1 : 0;
+
+	ret = hidpp_send_fap_command_sync(hidpp, hrd->feature_index,
+					  CMD_MOUSE_SET_WHEEL_MODE,
+					  params, 16, &response);
+	if (ret > 0) {
+		hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
+			__func__, ret);
+		return -EPROTO;
+	}
+	if (ret)
+		return ret;
+
+	return 0;
+}
 
 /* ************************************************************************** */
 /*                                                                            */
@@ -1816,6 +1878,119 @@ static int m560_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 }
 
 /* ------------------------------------------------------------------------- */
+/* Logitech mouse devices with high resolution wheel                         */
+/* ------------------------------------------------------------------------- */
+
+static int high_res_raw_event(struct hid_device *hdev, u8 *data, int size)
+{
+	struct hidpp_device *hidpp = hid_get_drvdata(hdev);
+	struct high_res_wheel_data *hrd = hidpp->private_data;
+
+	/* Don't handle special raw events before setting feature_index */
+	if (!hrd || !hrd->feature_index)
+		return 0;
+
+	if (data[0] != REPORT_ID_HIDPP_LONG ||
+	    data[2] != hrd->feature_index)
+		return 1;
+
+	if (size < 8) {
+		hid_err(hdev, "error in report: size = %d: %*ph\n", size,
+			size, data);
+		return 0;
+	}
+
+	/*
+	 * high res wheel mouse events
+	 *
+	 * Wheel movement events are like:
+	 *
+	 * 11 03 0b 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
+	 *
+	 * data[0] = 0x11
+	 * data[1] = device-id
+	 * data[2] = feature index (0b)
+	 * data[3] = event type: 0x00 - wheel movement
+	 * data[4] = bitmask:
+	 *		bits 0-3: number of sampling periods combined
+	 *		bit 4:
+	 *			0 = low resolution
+	 *			1 = high resolution
+	 * data[5] - deltaV MSB
+	 * data[6] = deltaV LSB
+	 * Remaining payload is reserved
+	 *
+	 * Ratchet events are like:
+	 * 11 03 0b 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+	 *
+	 * data[0] = 0x11
+	 * data[1] = device-id
+	 * data[2] = feature index
+	 * data[3] = event type: 0x10 - ratchet state
+	 * data[4] = bit 0:
+	 *		1 = ratchet
+	 *		0 = free wheel
+	 * Remaining payload is reserved
+	 */
+
+	if (data[3] == 0) {
+		s16 delta = data[6] | data[5] << 8;
+		bool res = data[4] & 0x10;
+
+		/*
+		 * Report high-resolution events as REL_HWHEEL and
+		 * low-resolution events as REL_WHEEL.
+		 */
+		if (res)
+			input_report_rel(hrd->input, REL_HIRES_WHEEL, delta);
+		else
+			input_report_rel(hrd->input, REL_WHEEL, delta);
+	}
+
+	/* FIXME: also report ratchet events to userspace */
+
+	return 1;
+}
+
+static void high_res_populate_input(struct hidpp_device *hidpp,
+		struct input_dev *input_dev, bool origin_is_hid_core)
+{
+	struct high_res_wheel_data *hrd = hidpp->private_data;
+
+	hrd->input = input_dev;
+
+	__set_bit(REL_WHEEL, hrd->input->relbit);
+	__set_bit(REL_HIRES_WHEEL, hrd->input->relbit);
+}
+
+
+static int high_res_allocate(struct hid_device *hdev)
+{
+	struct hidpp_device *hidpp = hid_get_drvdata(hdev);
+	struct high_res_wheel_data *hrd;
+
+	hrd = devm_kzalloc(&hdev->dev, sizeof(struct high_res_wheel_data),
+			GFP_KERNEL);
+	if (!hrd)
+		return -ENOMEM;
+
+	hidpp->private_data = hrd;
+
+	return 0;
+};
+
+static int high_res_connect(struct hid_device *hdev, bool connected)
+{
+	struct hidpp_device *hidpp = hid_get_drvdata(hdev);
+
+	if (!connected)
+		return 0;
+
+	/* Enable HID++ wheel event output mode */
+	return hidpp_mouse_set_wheel_mode(hidpp, false, false, true);
+}
+
+/* ------------------------------------------------------------------------- */
 /* Logitech K400 devices                                                     */
 /* ------------------------------------------------------------------------- */
 
@@ -1955,6 +2130,9 @@ static void hidpp_populate_input(struct hidpp_device *hidpp,
 		wtp_populate_input(hidpp, input, origin_is_hid_core);
 	else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560)
 		m560_populate_input(hidpp, input, origin_is_hid_core);
+	else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL)
+		high_res_populate_input(hidpp, input, origin_is_hid_core);
+
 }
 
 static int hidpp_input_configured(struct hid_device *hdev,
@@ -2054,6 +2232,8 @@ static int hidpp_raw_event(struct hid_device *hdev, struct hid_report *report,
 		return wtp_raw_event(hdev, data, size);
 	else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560)
 		return m560_raw_event(hdev, data, size);
+	else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL)
+		return high_res_raw_event(hdev, data, size);
 
 	return 0;
 }
@@ -2141,6 +2321,10 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
 		ret = k400_connect(hdev, connected);
 		if (ret)
 			return;
+	} else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL) {
+		ret = high_res_connect(hdev, connected);
+		if (ret)
+			return;
 	}
 
 	if (!connected || hidpp->delayed_input)
@@ -2215,6 +2399,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		hidpp->quirks &= ~HIDPP_QUIRK_CLASS_WTP;
 		hidpp->quirks &= ~HIDPP_QUIRK_CONNECT_EVENTS;
 		hidpp->quirks &= ~HIDPP_QUIRK_NO_HIDINPUT;
+		hidpp->quirks &= ~HIDPP_QUIRK_HIRES_SCROLL;
 	}
 
 	if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) {
@@ -2229,6 +2414,10 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		ret = k400_allocate(hdev);
 		if (ret)
 			goto allocate_fail;
+	} else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL) {
+		ret = high_res_allocate(hdev);
+		if (ret)
+			goto allocate_fail;
 	}
 
 	INIT_WORK(&hidpp->work, delayed_work_cb);
@@ -2354,6 +2543,16 @@ static const struct hid_device_id hidpp_devices[] = {
 	  HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
 		USB_VENDOR_ID_LOGITECH, 0x402d),
 	  .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 },
+	{ /* Logitech MX Master with high resolution scroll */
+	  HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
+		USB_VENDOR_ID_LOGITECH, 0x4041),
+	  .driver_data = HIDPP_QUIRK_CONNECT_EVENTS |
+			 HIDPP_QUIRK_HIRES_SCROLL },
+	{ /* Logitech MX Anywhere 2 with high resolution scroll */
+	  HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
+		USB_VENDOR_ID_LOGITECH, 0x404a),
+	  .driver_data = HIDPP_QUIRK_CONNECT_EVENTS |
+			 HIDPP_QUIRK_HIRES_SCROLL },
 	{ /* Keyboard logitech K400 */
 	  HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
 		USB_VENDOR_ID_LOGITECH, 0x4024),
Signature · 1 line
2.9.3
#70 lore raw

Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch

In reply to Mauro Carvalho Chehab
Quoted 1 line · Mauro Carvalho Chehab

Some mouses have a switch on their wheel, allowing to switch

isnt' the plural of mouse mice? (non-native english speaker myself)

Quoted 1 line

between ratchet or free wheel mode. Add support for it.

s/or/and/

Quoted 13 lines
---
 Documentation/input/event-codes.rst    | 16 ++++++++++++++++
 include/linux/mod_devicetable.h        |  2 +-
 include/uapi/linux/input-event-codes.h |  4 +++-
 3 files changed, 20 insertions(+), 2 deletions(-)
Documentation/input/event-codes.rst +0 -0
index 0c8591d39bc6..93f14f0ddb3d 100644

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247

Quoted 9 lines
Documentation/input/event-codes.rst +6 -0
@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input
 subsystem will filter out the duplicate switch state reports. The driver does
 not need to keep the state of the switch at any time.
 
+A few EV_SW codes have special meanings:
+
+* SW_RATCHET:
+
+  - Some mouses have a special switch at their wheel that allows to change
+    from free wheel mode to ratchet mode.

"between free wheel mode and ratchet mode"

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+
+    When such switch is ratchet mode (ON state), the wheel will offer some

s/such/the/

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+    resistance for movements movement. It will also provide a tactile
+    feedback when scrolled.

this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256

Quoted 5 lines
Documentation/input/event-codes.rst +5 -0
+
+    When pressed while in ratchet mode, the wheel will switch to free wheel
+    mode (OFF state). In this mode, it will offer no resistance to wheel
+    movements nor any tactile feedback. Pressing again returns to ratchet
+    mode.

nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.

Cheers,
Peter

Quoted 35 lines
Documentation/input/event-codes.rst +1 -0
+
 EV_MSC
 ------
 
include/linux/mod_devicetable.h +1 -1
index 8850fcaf50db..038cddf1436a 100644
@@ -292,7 +292,7 @@ struct pcmcia_device_id {
 #define INPUT_DEVICE_ID_LED_MAX		0x0f
 #define INPUT_DEVICE_ID_SND_MAX		0x07
 #define INPUT_DEVICE_ID_FF_MAX		0x7f
-#define INPUT_DEVICE_ID_SW_MAX		0x0f
+#define INPUT_DEVICE_ID_SW_MAX		0x1f
 
 #define INPUT_DEVICE_ID_MATCH_BUS	1
 #define INPUT_DEVICE_ID_MATCH_VENDOR	2
include/uapi/linux/input-event-codes.h +3 -1
index 23b2d377af59..a3eafd0527f1 100644
@@ -782,7 +782,9 @@
 #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
 #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
 #define SW_PEN_INSERTED		0x0f  /* set = pen inserted */
-#define SW_MAX			0x0f
+#define SW_RATCHET		0x10  /* set = ratchet mode,
+					 unset: free wheel */
+#define SW_MAX			0x1f
 #define SW_CNT			(SW_MAX+1)
 
 /*
Signature · 1 line
2.9.3
#71 lore raw

Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch

Em Wed, 5 Apr 2017 22:03:03 +1000
Peter Hutterer <[email protected]> escreveu:

Quoted 4 lines · Mauro Carvalho Chehab
Quoted 1 line

Some mouses have a switch on their wheel, allowing to switch

isnt' the plural of mouse mice? (non-native english speaker myself)

Yeah, true. I'll fix on a next review.

Quoted 33 lines
Quoted 2 lines

between ratchet or free wheel mode. Add support for it.

s/or/and/

Quoted 13 lines
---
 Documentation/input/event-codes.rst    | 16 ++++++++++++++++
 include/linux/mod_devicetable.h        |  2 +-
 include/uapi/linux/input-event-codes.h |  4 +++-
 3 files changed, 20 insertions(+), 2 deletions(-)
Documentation/input/event-codes.rst +0 -0
index 0c8591d39bc6..93f14f0ddb3d 100644

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247

Quoted 9 lines
Documentation/input/event-codes.rst +6 -0
@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input
 subsystem will filter out the duplicate switch state reports. The driver does
 not need to keep the state of the switch at any time.
 
+A few EV_SW codes have special meanings:
+
+* SW_RATCHET:
+
+  - Some mouses have a special switch at their wheel that allows to change
+    from free wheel mode to ratchet mode.  

"between free wheel mode and ratchet mode"

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+
+    When such switch is ratchet mode (ON state), the wheel will offer some  
Quoted 7 lines

s/such/the/

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+    resistance for movements movement. It will also provide a tactile
+    feedback when scrolled.  

this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.

I just wanted to let it clear about what's the difference between ratchet and free wheel mode. As a non-native speaker, I had to research myself about what the heck "ratchet" means, as I never heard this word before ;)

To be frank, when I received this mouse, I had some troubles to adapt to it, as on other mice I have here, the wheel is used generate the mid button event. On this specific model, there's a small button on south of the wheel the mid button event.

Quoted 10 lines

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256

Quoted 5 lines
Documentation/input/event-codes.rst +5 -0
+
+    When pressed while in ratchet mode, the wheel will switch to free wheel
+    mode (OFF state). In this mode, it will offer no resistance to wheel
+    movements nor any tactile feedback. Pressing again returns to ratchet
+    mode.  

nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.

Ok, I'll remove it. What about this:

* SW_RATCHET:

- Some mice have a special switch at their wheel that allows to change between free wheel mode and ratchet mode via a ratchet switch.

When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.

Regards,
Mauro

#72 lore raw

Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch

Quoted 72 lines · Mauro Carvalho Chehab

Em Wed, 5 Apr 2017 22:03:03 +1000
Peter Hutterer <[email protected]> escreveu:

Quoted 4 lines · Mauro Carvalho Chehab
Quoted 1 line

Some mouses have a switch on their wheel, allowing to switch

isnt' the plural of mouse mice? (non-native english speaker myself)

Yeah, true. I'll fix on a next review.

Quoted 33 lines
Quoted 2 lines

between ratchet or free wheel mode. Add support for it.

s/or/and/

Quoted 13 lines
---
 Documentation/input/event-codes.rst    | 16 ++++++++++++++++
 include/linux/mod_devicetable.h        |  2 +-
 include/uapi/linux/input-event-codes.h |  4 +++-
 3 files changed, 20 insertions(+), 2 deletions(-)
Documentation/input/event-codes.rst +0 -0
index 0c8591d39bc6..93f14f0ddb3d 100644

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247

Quoted 9 lines
Documentation/input/event-codes.rst +6 -0
@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input
 subsystem will filter out the duplicate switch state reports. The driver does
 not need to keep the state of the switch at any time.
 
+A few EV_SW codes have special meanings:
+
+* SW_RATCHET:
+
+  - Some mouses have a special switch at their wheel that allows to change
+    from free wheel mode to ratchet mode.  

"between free wheel mode and ratchet mode"

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+
+    When such switch is ratchet mode (ON state), the wheel will offer some  
Quoted 7 lines

s/such/the/

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251

Quoted 2 lines
Documentation/input/event-codes.rst +2 -0
+    resistance for movements movement. It will also provide a tactile
+    feedback when scrolled.  

this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.

I just wanted to let it clear about what's the difference between ratchet and free wheel mode. As a non-native speaker, I had to research myself about what the heck "ratchet" means, as I never heard this word before ;)

To be frank, when I received this mouse, I had some troubles to adapt to it, as on other mice I have here, the wheel is used generate the mid button event. On this specific model, there's a small button on south of the wheel the mid button event.

Quoted 10 lines

Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256

Quoted 5 lines
Documentation/input/event-codes.rst +5 -0
+
+    When pressed while in ratchet mode, the wheel will switch to free wheel
+    mode (OFF state). In this mode, it will offer no resistance to wheel
+    movements nor any tactile feedback. Pressing again returns to ratchet
+    mode.  

nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.

Ok, I'll remove it. What about this:

Quoted 8 lines

* SW_RATCHET:

- Some mice have a special switch at their wheel that allows to change between free wheel mode and ratchet mode via a ratchet switch.

When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.

yep, close, just a minor nitpick:

- Some mice have a special switch for their wheel that allows to change between free wheel mode and ratchet mode. When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.

And maybe add something like:
Note that some mice have a ratchet switch that does not generate a software event.

Cheers,
Peter