Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: docs - update joystick documentation a bit

Consolidate use instructions and userspace API notes into the same chapter;
remove completely obsolete references, move into a separate subdirectory.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+71 -83
+2 -4
Documentation/input/index.rst
··· 2 2 The Linux Input Documentation 3 3 ============================= 4 4 5 - Core API 6 - ======== 5 + Contents: 7 6 8 7 .. toctree:: 9 8 :maxdepth: 2 ··· 11 12 input 12 13 input-programming 13 14 event-codes 14 - joystick 15 - joystick-api 15 + joydev/index 16 16 multi-touch-protocol 17 17 gamepad 18 18 gameport-programming
+18
Documentation/input/joydev/index.rst
··· 1 + .. include:: <isonum.txt> 2 + 3 + ====================== 4 + Linux Joystick support 5 + ====================== 6 + 7 + :Copyright: |copy| 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> - Sponsored by SuSE 8 + 9 + .. class:: toc-title 10 + 11 + Table of Contents 12 + 13 + .. toctree:: 14 + :maxdepth: 3 15 + :numbered: 16 + 17 + joystick 18 + joystick-api
+25 -5
Documentation/input/joystick-api.rst Documentation/input/joydev/joystick-api.rst
··· 1 - ========================== 2 - Joystick API Documentation 3 - ========================== 1 + ===================== 2 + Programming Interface 3 + ===================== 4 4 5 5 :Author: Ragnar Hojland Espinosa <ragnar@macula.net> - 7 Aug 1998 6 + 7 + Introduction 8 + ============ 9 + 10 + .. important:: 11 + This document describes legacy ``js`` interface. Newer clients are 12 + encouraged to switch to the generic event (``evdev``) interface. 13 + 14 + The 1.0 driver uses a new, event based approach to the joystick driver. 15 + Instead of the user program polling for the joystick values, the joystick 16 + driver now reports only any changes of its state. See joystick-api.txt, 17 + joystick.h and jstest.c included in the joystick package for more 18 + information. The joystick device can be used in either blocking or 19 + nonblocking mode, and supports select() calls. 20 + 21 + For backward compatibility the old (v0.x) interface is still included. 22 + Any call to the joystick driver using the old interface will return values 23 + that are compatible to the old interface. This interface is still limited 24 + to 2 axes, and applications using it usually decode only 2 buttons, although 25 + the driver provides up to 32. 6 26 7 27 Initialization 8 28 ============== ··· 30 10 Open the joystick device following the usual semantics (that is, with open). 31 11 Since the driver now reports events instead of polling for changes, 32 12 immediately after the open it will issue a series of synthetic events 33 - (JS_EVENT_INIT) that you can read to check the initial state of the 13 + (JS_EVENT_INIT) that you can read to obtain the initial state of the 34 14 joystick. 35 15 36 16 By default, the device is opened in blocking mode:: ··· 202 182 203 183 .. note:: 204 184 205 - As for version 1.2.8, the queue is circular and able to hold 64 185 + As of version 1.2.8, the queue is circular and able to hold 64 206 186 events. You can increment this size bumping up JS_BUFF_SIZE in 207 187 joystick.h and recompiling the driver. 208 188
+6 -6
Documentation/input/joystick-parport.rst
··· 2 2 3 3 .. _joystick-parport: 4 4 5 - =================================== 6 - Linux Joystick parport drivers v2.0 7 - =================================== 5 + ============================== 6 + Parallel port Joystick Drivers 7 + ============================== 8 8 9 9 :Copyright: |copy| 1998-2000 Vojtech Pavlik <vojtech@ucw.cz> 10 10 :Copyright: |copy| 1998 Andree Borrmann <a.borrmann@tu-bs.de> ··· 20 20 happen include burning your parallel port, and/or the sticks and joystick 21 21 and maybe even more. Like when a lightning kills you it is not our problem. 22 22 23 - Intro 24 - ===== 23 + Introduction 24 + ============ 25 25 26 26 The joystick parport drivers are used for joysticks and gamepads not 27 27 originally designed for PCs and other computers Linux runs on. Because of ··· 582 582 for two more interfaces. 583 583 584 584 PC parallel port pinout 585 - ----------------------- 585 + ======================= 586 586 587 587 :: 588 588
+20 -68
Documentation/input/joystick.rst Documentation/input/joydev/joystick.rst
··· 1 1 .. include:: <isonum.txt> 2 2 3 - ============================ 4 - Linux Joystick driver v2.0.0 5 - ============================ 6 - 7 - :Copyright: |copy| 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> - Sponsored by SuSE 8 - 9 - 10 - Disclaimer 11 - ========== 12 - 13 - This program is free software; you can redistribute it and/or modify it 14 - under the terms of the GNU General Public License as published by the Free 15 - Software Foundation; either version 2 of the License, or (at your option) 16 - any later version. 17 - 18 - This program is distributed in the hope that it will be useful, but 19 - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 20 - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 21 - more details. 22 - 23 - You should have received a copy of the GNU General Public License along 24 - with this program; if not, write to the Free Software Foundation, Inc., 59 25 - Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 - 27 - Should you need to contact me, the author, you can do so either by e-mail 28 - - mail your message to <vojtech@ucw.cz>, or by paper mail: Vojtech Pavlik, 29 - Simunkova 1594, Prague 8, 182 00 Czech Republic 30 - 31 - For your convenience, the GNU General Public License version 2 is included 32 - in the package: See the file COPYING. 33 - 34 - Intro 35 - ===== 3 + Introduction 4 + ============ 36 5 37 6 The joystick driver for Linux provides support for a variety of joysticks 38 7 and similar devices. It is based on a larger project aiming to support all 39 8 input devices in Linux. 40 9 41 - Should you encounter any problems while using the driver, or joysticks 42 - this driver can't make complete use of, I'm very interested in hearing about 43 - them. Bug reports and success stories are also welcome. 10 + The mailing list for the project is: 44 11 45 - The input project website is at: 12 + linux-input@vger.kernel.org 46 13 47 - http://atrey.karlin.mff.cuni.cz/~vojtech/input/ 48 - 49 - There is also a mailing list for the driver at: 50 - 51 - listproc@atrey.karlin.mff.cuni.cz 52 - 53 - send "subscribe linux-joystick Your Name" to subscribe to it. 14 + send "subscribe linux-input" to majordomo@vger.kernel.org to subscribe to it. 54 15 55 16 Usage 56 17 ===== ··· 19 58 For basic usage you just choose the right options in kernel config and 20 59 you should be set. 21 60 22 - inpututils 23 - ---------- 61 + Utilities 62 + --------- 24 63 25 - For testing and other purposes (for example serial devices), a set of 26 - utilities is available at the abovementioned website. I suggest you download 27 - and install it before going on. 64 + For testing and other purposes (for example serial devices), there is a set 65 + of utilities, such as ``jstest``, ``jscal``, and ``evtest``, 66 + usually packaged as ``joystick``, ``input-utils``, ``evtest``, and so on. 67 + 68 + ``inputattach`` utility is required if your joystick is connected to a 69 + serial port. 28 70 29 71 Device nodes 30 72 ------------ 31 73 32 - For applications to be able to use the joysticks, 33 - you'll have to manually create these nodes in /dev:: 74 + For applications to be able to use the joysticks, device nodes should be 75 + created in /dev. Normally it is done automatically by the system, but 76 + it can also be done by hand:: 34 77 35 78 cd /dev 36 79 rm js* ··· 130 165 131 166 This way, after the next reboot your joystick will remain calibrated. You 132 167 can also add the ``jscal -p`` line to your shutdown script. 133 - 134 168 135 169 HW specific driver information 136 170 ============================== ··· 431 467 Game console and 8-bit pads and joysticks 432 468 ----------------------------------------- 433 469 470 + These pads and joysticks are not designed for PCs and other computers 471 + Linux runs on, and usually require a special connector for attaching 472 + them through a parallel port. 473 + 434 474 See :ref:`joystick-parport` for more info. 435 475 436 476 SpaceTec/LabTec devices ··· 581 613 :Q: My joystick doesn't work with Quake / Quake 2. What's the cause? 582 614 :A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses 583 615 for them. 584 - 585 - Programming Interface 586 - ===================== 587 - 588 - The 1.0 driver uses a new, event based approach to the joystick driver. 589 - Instead of the user program polling for the joystick values, the joystick 590 - driver now reports only any changes of its state. See joystick-api.txt, 591 - joystick.h and jstest.c included in the joystick package for more 592 - information. The joystick device can be used in either blocking or 593 - nonblocking mode and supports select() calls. 594 - 595 - For backward compatibility the old (v0.x) interface is still included. 596 - Any call to the joystick driver using the old interface will return values 597 - that are compatible to the old interface. This interface is still limited 598 - to 2 axes, and applications using it usually decode only 2 buttons, although 599 - the driver provides up to 32.