aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/input
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/input')
-rw-r--r--Documentation/input/amijoy.txt184
-rw-r--r--Documentation/input/atarikbd.txt709
-rw-r--r--Documentation/input/cd32.txt19
-rw-r--r--Documentation/input/cs461x.txt45
-rw-r--r--Documentation/input/ff.txt227
-rw-r--r--Documentation/input/gameport-programming.txt189
-rw-r--r--Documentation/input/iforce-protocol.txt254
-rw-r--r--Documentation/input/input-programming.txt281
-rw-r--r--Documentation/input/input.txt312
-rw-r--r--Documentation/input/interactive.fig42
-rw-r--r--Documentation/input/joystick-api.txt316
-rw-r--r--Documentation/input/joystick-parport.txt542
-rw-r--r--Documentation/input/joystick.txt588
-rw-r--r--Documentation/input/shape.fig65
-rw-r--r--Documentation/input/xpad.txt116
15 files changed, 3889 insertions, 0 deletions
diff --git a/Documentation/input/amijoy.txt b/Documentation/input/amijoy.txt
new file mode 100644
index 000000000000..3b8b2d43a68e
--- /dev/null
+++ b/Documentation/input/amijoy.txt
@@ -0,0 +1,184 @@
1Amiga 4-joystick parport extension
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3Parallel port pins:
4
5 (2) - Up1 (6) - Up2
6 (3) - Down1 (7) - Down2
7 (4) - Left1 (8) - Left2
8 (5) - Right1 (9) - Right2
9(13) - Fire1 (11) - Fire2
10(18) - Gnd1 (18) - Gnd2
11
12Amiga digital joystick pinout
13~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14(1) - Up
15(2) - Down
16(3) - Left
17(4) - Right
18(5) - n/c
19(6) - Fire button
20(7) - +5V (50mA)
21(8) - Gnd
22(9) - Thumb button
23
24Amiga mouse pinout
25~~~~~~~~~~~~~~~~~~
26(1) - V-pulse
27(2) - H-pulse
28(3) - VQ-pulse
29(4) - HQ-pulse
30(5) - Middle button
31(6) - Left button
32(7) - +5V (50mA)
33(8) - Gnd
34(9) - Right button
35
36Amiga analog joystick pinout
37~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38(1) - Top button
39(2) - Top2 button
40(3) - Trigger button
41(4) - Thumb button
42(5) - Analog X
43(6) - n/c
44(7) - +5V (50mA)
45(8) - Gnd
46(9) - Analog Y
47
48Amiga lightpen pinout
49~~~~~~~~~~~~~~~~~~~~~
50(1) - n/c
51(2) - n/c
52(3) - n/c
53(4) - n/c
54(5) - Touch button
55(6) - /Beamtrigger
56(7) - +5V (50mA)
57(8) - Gnd
58(9) - Stylus button
59
60-------------------------------------------------------------------------------
61
62NAME rev ADDR type chip Description
63JOY0DAT 00A R Denise Joystick-mouse 0 data (left vert, horiz)
64JOY1DAT 00C R Denise Joystick-mouse 1 data (right vert,horiz)
65
66 These addresses each read a 16 bit register. These in turn
67 are loaded from the MDAT serial stream and are clocked in on
68 the rising edge of SCLK. MLD output is used to parallel load
69 the external parallel-to-serial converter.This in turn is
70 loaded with the 4 quadrature inputs from each of two game
71 controller ports (8 total) plus 8 miscellaneous control bits
72 which are new for LISA and can be read in upper 8 bits of
73 LISAID.
74 Register bits are as follows:
75 Mouse counter usage (pins 1,3 =Yclock, pins 2,4 =Xclock)
76
77 BIT# 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
78JOY0DAT Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 X7 X6 X5 X4 X3 X2 X1 X0
79JOY1DAT Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 X7 X6 X5 X4 X3 X2 X1 X0
80
81 0=LEFT CONTROLLER PAIR, 1=RIGHT CONTROLLER PAIR.
82 (4 counters total).The bit usage for both left and right
83 addresses is shown below. Each 6 bit counter (Y7-Y2,X7-X2) is
84 clocked by 2 of the signals input from the mouse serial
85 stream. Starting with first bit recived:
86
87 +-------------------+-----------------------------------------+
88 | Serial | Bit Name | Description |
89 +--------+----------+-----------------------------------------+
90 | 0 | M0H | JOY0DAT Horizontal Clock |
91 | 1 | M0HQ | JOY0DAT Horizontal Clock (quadrature) |
92 | 2 | M0V | JOY0DAT Vertical Clock |
93 | 3 | M0VQ | JOY0DAT Vertical Clock (quadrature) |
94 | 4 | M1V | JOY1DAT Horizontall Clock |
95 | 5 | M1VQ | JOY1DAT Horizontall Clock (quadrature) |
96 | 6 | M1V | JOY1DAT Vertical Clock |
97 | 7 | M1VQ | JOY1DAT Vertical Clock (quadrature) |
98 +--------+----------+-----------------------------------------+
99
100 Bits 1 and 0 of each counter (Y1-Y0,X1-X0) may be
101 read to determine the state of the related input signal pair.
102 This allows these pins to double as joystick switch inputs.
103 Joystick switch closures can be deciphered as follows:
104
105 +------------+------+---------------------------------+
106 | Directions | Pin# | Counter bits |
107 +------------+------+---------------------------------+
108 | Forward | 1 | Y1 xor Y0 (BIT#09 xor BIT#08) |
109 | Left | 3 | Y1 |
110 | Back | 2 | X1 xor X0 (BIT#01 xor BIT#00) |
111 | Right | 4 | X1 |
112 +------------+------+---------------------------------+
113
114-------------------------------------------------------------------------------
115
116NAME rev ADDR type chip Description
117JOYTEST 036 W Denise Write to all 4 joystick-mouse counters at once.
118
119 Mouse counter write test data:
120 BIT# 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
121 JOYxDAT Y7 Y6 Y5 Y4 Y3 Y2 xx xx X7 X6 X5 X4 X3 X2 xx xx
122 JOYxDAT Y7 Y6 Y5 Y4 Y3 Y2 xx xx X7 X6 X5 X4 X3 X2 xx xx
123
124-------------------------------------------------------------------------------
125
126NAME rev ADDR type chip Description
127POT0DAT h 012 R Paula Pot counter data left pair (vert, horiz)
128POT1DAT h 014 R Paula Pot counter data right pair (vert,horiz)
129
130 These addresses each read a pair of 8 bit pot counters.
131 (4 counters total). The bit assignment for both
132 addresses is shown below. The counters are stopped by signals
133 from 2 controller connectors (left-right) with 2 pins each.
134
135 BIT# 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
136 RIGHT Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 X7 X6 X5 X4 X3 X2 X1 X0
137 LEFT Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 X7 X6 X5 X4 X3 X2 X1 X0
138
139 +--------------------------+-------+
140 | CONNECTORS | PAULA |
141 +-------+------+-----+-----+-------+
142 | Loc. | Dir. | Sym | pin | pin |
143 +-------+------+-----+-----+-------+
144 | RIGHT | Y | RX | 9 | 33 |
145 | RIGHT | X | RX | 5 | 32 |
146 | LEFT | Y | LY | 9 | 36 |
147 | LEFT | X | LX | 5 | 35 |
148 +-------+------+-----+-----+-------+
149
150 With normal (NTSC or PAL) horiz. line rate, the pots will
151 give a full scale (FF) reading with about 500kohms in one
152 frame time. With proportionally faster horiz line times,
153 the counters will count proportionally faster.
154 This should be noted when doing variable beam displays.
155
156-------------------------------------------------------------------------------
157
158NAME rev ADDR type chip Description
159POTGO 034 W Paula Pot port (4 bit) bi-direction and data, and pot counter start.
160
161-------------------------------------------------------------------------------
162
163NAME rev ADDR type chip Description
164POTINP 016 R Paula Pot pin data read
165
166 This register controls a 4 bit bi-direction I/O port
167 that shares the same 4 pins as the 4 pot counters above.
168
169 +-------+----------+---------------------------------------------+
170 | BIT# | FUNCTION | DESCRIPTION |
171 +-------+----------+---------------------------------------------+
172 | 15 | OUTRY | Output enable for Paula pin 33 |
173 | 14 | DATRY | I/O data Paula pin 33 |
174 | 13 | OUTRX | Output enable for Paula pin 32 |
175 | 12 | DATRX | I/O data Paula pin 32 |
176 | 11 | OUTLY | Out put enable for Paula pin 36 |
177 | 10 | DATLY | I/O data Paula pin 36 |
178 | 09 | OUTLX | Output enable for Paula pin 35 |
179 | 08 | DATLX | I/O data Paula pin 35 |
180 | 07-01 | X | Not used |
181 | 00 | START | Start pots (dump capacitors,start counters) |
182 +-------+----------+---------------------------------------------+
183
184-------------------------------------------------------------------------------
diff --git a/Documentation/input/atarikbd.txt b/Documentation/input/atarikbd.txt
new file mode 100644
index 000000000000..8fb896c74114
--- /dev/null
+++ b/Documentation/input/atarikbd.txt
@@ -0,0 +1,709 @@
1Intelligent Keyboard (ikbd) Protocol
2
3
41. Introduction
5
6The Atari Corp. Intelligent Keyboard (ikbd) is a general purpose keyboard
7controller that is flexible enough that it can be used in a variety of
8products without modification. The keyboard, with its microcontroller,
9provides a convenient connection point for a mouse and switch-type joysticks.
10The ikbd processor also maintains a time-of-day clock with one second
11resolution.
12The ikbd has been designed to be general enough that it can be used with a
13ariety of new computer products. Product variations in a number of
14keyswitches, mouse resolution, etc. can be accommodated.
15The ikbd communicates with the main processor over a high speed bi-directional
16serial interface. It can function in a variety of modes to facilitate
17different applications of the keyboard, joysticks, or mouse. Limited use of
18the controller is possible in applications in which only a unidirectional
19communications medium is available by carefully designing the default modes.
20
213. Keyboard
22
23The keyboard always returns key make/break scan codes. The ikbd generates
24keyboard scan codes for each key press and release. The key scan make (key
25closure) codes start at 1, and are defined in Appendix A. For example, the
26ISO key position in the scan code table should exist even if no keyswitch
27exists in that position on a particular keyboard. The break code for each key
28is obtained by ORing 0x80 with the make code.
29
30The special codes 0xF6 through 0xFF are reserved for use as follows:
31 0xF6 status report
32 0xF7 absolute mouse position record
33 0xF8-0xFB relative mouse position records(lsbs determind by
34 mouse button states)
35 0xFC time-of-day
36 0xFD joystick report (both sticks)
37 0xFE joystick 0 event
38 0xFF joystick 1 event
39
40The two shift keys return different scan codes in this mode. The ENTER key
41and the RETurn key are also distinct.
42
434. Mouse
44
45The mouse port should be capable of supporting a mouse with resolution of
46approximately 200 counts (phase changes or 'clicks') per inch of travel. The
47mouse should be scanned at a rate that will permit accurate tracking at
48velocities up to 10 inches per second.
49The ikbd can report mouse motion in three distinctly different ways. It can
50report relative motion, absolute motion in a coordinate system maintained
51within the ikbd, or by converting mouse motion into keyboard cursor control
52key equivalents.
53The mouse buttons can be treated as part of the mouse or as additional
54keyboard keys.
55
564.1 Relative Position Reporting
57
58In relative position mode, the ikbd will return relative mouse position
59records whenever a mouse event occurs. A mouse event consists of a mouse
60button being pressed or released, or motion in either axis exceeding a
61settable threshold of motion. Regardless of the threshold, all bits of
62resolution are returned to the host computer.
63Note that the ikbd may return mouse relative position reports with
64significantly more than the threshold delta x or y. This may happen since no
65relative mouse motion events will be generated: (a) while the keyboard has
66been 'paused' ( the event will be stored until keyboard communications is
67resumed) (b) while any event is being transmitted.
68
69The relative mouse position record is a three byte record of the form
70(regardless of keyboard mode):
71 %111110xy ; mouse position record flag
72 ; where y is the right button state
73 ; and x is the left button state
74 X ; delta x as twos complement integer
75 Y ; delta y as twos complement integer
76
77Note that the value of the button state bits should be valid even if the
78MOUSE BUTTON ACTION has set the buttons to act like part of the keyboard.
79If the accumulated motion before the report packet is generated exceeds the
80+127...-128 range, the motion is broken into multiple packets.
81Note that the sign of the delta y reported is a function of the Y origin
82selected.
83
844.2 Absolute Position reporting
85
86The ikbd can also maintain absolute mouse position. Commands exist for
87reseting the mouse position, setting X/Y scaling, and interrogating the
88current mouse position.
89
904.3 Mouse Cursor Key Mode
91
92The ikbd can translate mouse motion into the equivalent cursor keystrokes.
93The number of mouse clicks per keystroke is independently programmable in
94each axis. The ikbd internally maintains mouse motion information to the
95highest resolution available, and merely generates a pair of cursor key events
96for each multiple of the scale factor.
97Mouse motion produces the cursor key make code immediately followed by the
98break code for the appropriate cursor key. The mouse buttons produce scan
99codes above those normally assigned for the largest envisioned keyboard (i.e.
100LEFT=0x74 & RIGHT=0x75).
101
1025. Joystick
103
1045.1 Joystick Event Reporting
105
106In this mode, the ikbd generates a record whever the joystick position is
107changed (i.e. for each opening or closing of a joystick switch or trigger).
108
109The joystick event record is two bytes of the form:
110 %1111111x ; Joystick event marker
111 ; where x is Joystick 0 or 1
112 %x000yyyy ; where yyyy is the stick position
113 ; and x is the trigger
114
1155.2 Joystick Interrogation
116
117The current state of the joystick ports may be interrogated at any time in
118this mode by sending an 'Interrogate Joystick' command to the ikbd.
119
120The ikbd response to joystick interrogation is a three byte report of the form
121 0xFD ; joystick report header
122 %x000yyyy ; Joystick 0
123 %x000yyyy ; Joystick 1
124 ; where x is the trigger
125 ; and yyy is the stick position
126
1275.3 Joystick Monitoring
128
129A mode is available that devotes nearly all of the keyboard communications
130time to reporting the state of the joystick ports at a user specifiable rate.
131It remains in this mode until reset or commanded into another mode. The PAUSE
132command in this mode not only stop the output but also temporarily stops
133scanning the joysticks (samples are not queued).
134
1355.4 Fire Button Monitoring
136
137A mode is provided to permit monitoring a single input bit at a high rate. In
138this mode the ikbd monitors the state of the Joystick 1 fire button at the
139maximum rate permitted by the serial communication channel. The data is packed
1408 bits per byte for transmission to the host. The ikbd remains in this mode
141until reset or commanded into another mode. The PAUSE command in this mode not
142only stops the output but also temporarily stops scanning the button (samples
143are not queued).
144
1455.5 Joystick Key Code Mode
146
147The ikbd may be commanded to translate the use of either joystick into the
148equivalent cursor control keystroke(s). The ikbd provides a single breakpoint
149velocity joystick cursor.
150Joystick events produce the make code, immediately followed by the break code
151for the appropriate cursor motion keys. The trigger or fire buttons of the
152joysticks produce pseudo key scan codes above those used by the largest key
153matrix envisioned (i.e. JOYSTICK0=0x74, JOYSTICK1=0x75).
154
1556. Time-of-Day Clock
156
157The ikbd also maintains a time-of-day clock for the system. Commands are
158available to set and interrogate the timer-of-day clock. Time-keeping is
159maintained down to a resolution of one second.
160
1617. Status Inquiries
162
163The current state of ikbd modes and parameters may be found by sending status
164inquiry commands that correspond to the ikbd set commands.
165
1668. Power-Up Mode
167
168The keyboard controller will perform a simple self-test on power-up to detect
169major controller faults (ROM checksum and RAM test) and such things as stuck
170keys. Any keys down at power-up are presumed to be stuck, and their BREAK
171(sic) code is returned (which without the preceding MAKE code is a flag for a
172keyboard error). If the controller self-test completes without error, the code
1730xF0 is returned. (This code will be used to indicate the version/rlease of
174the ikbd controller. The first release of the ikbd is version 0xF0, should
175there be a second release it will be 0xF1, and so on.)
176The ikbd defaults to a mouse position reporting with threshold of 1 unit in
177either axis and the Y=0 origin at the top of the screen, and joystick event
178reporting mode for joystick 1, with both buttons being logically assigned to
179the mouse. After any joystick command, the ikbd assumes that joysticks are
180connected to both Joystick0 and Joystick1. Any mouse command (except MOUSE
181DISABLE) then causes port 0 to again be scanned as if it were a mouse, and
182both buttons are logically connected to it. If a mouse diable command is
183received while port 0 is presumed to be a mouse, the button is logically
184assigned to Joystick1 ( until the mouse is reenabled by another mouse command).
185
1869. ikbd Command Set
187
188This section contains a list of commands that can be sent to the ikbd. Command
189codes (such as 0x00) which are not specified should perform no operation
190(NOPs).
191
1929.1 RESET
193
194 0x80
195 0x01
196
197N.B. The RESET command is the only two byte command understood by the ikbd.
198Any byte following an 0x80 command byte other than 0x01 is ignored (and causes
199the 0x80 to be ignored).
200A reset may also be caused by sending a break lasting at least 200mS to the
201ikbd.
202Executing the RESET command returns the keyboard to its default (power-up)
203mode and parameter settings. It does not affect the time-of-day clock.
204The RESET command or function causes the ikbd to perform a simple self-test.
205If the test is successful, the ikbd will send the code of 0xF0 within 300mS
206of receipt of the RESET command (or the end of the break, or power-up). The
207ikbd will then scan the key matrix for any stuck (closed) keys. Any keys found
208closed will cause the break scan code to be generated (the break code arriving
209without being preceded by the make code is a flag for a key matrix error).
210
2119.2. SET MOUSE BUTTON ACTION
212
213 0x07
214 %00000mss ; mouse button action
215 ; (m is presumed = 1 when in MOUSE KEYCODE mode)
216 ; mss=0xy, mouse button press or release causes mouse
217 ; position report
218 ; where y=1, mouse key press causes absolute report
219 ; and x=1, mouse key release causes absolute report
220 ; mss=100, mouse buttons act like keys
221
222This command sets how the ikbd should treat the buttons on the mouse. The
223default mouse button action mode is %00000000, the buttons are treated as part
224of the mouse logically.
225When buttons act like keys, LEFT=0x74 & RIGHT=0x75.
226
2279.3 SET RELATIVE MOUSE POSITION REPORTING
228
229 0x08
230
231Set relative mouse position reporting. (DEFAULT) Mouse position packets are
232generated asynchronously by the ikbd whenever motion exceeds the setable
233threshold in either axis (see SET MOUSE THRESHOLD). Depending upon the mouse
234key mode, mouse position reports may also be generated when either mouse
235button is pressed or released. Otherwise the mouse buttons behave as if they
236were keyboard keys.
237
2389.4 SET ABSOLUTE MOUSE POSITIONING
239
240 0x09
241 XMSB ; X maximum (in scaled mouse clicks)
242 XLSB
243 YMSB ; Y maximum (in scaled mouse clicks)
244 YLSB
245
246Set absolute mouse position maintenance. Resets the ikbd maintained X and Y
247coordinates.
248In this mode, the value of the internally maintained coordinates does NOT wrap
249between 0 and large positive numbers. Excess motion below 0 is ignored. The
250command sets the maximum positive value that can be attained in the scaled
251coordinate system. Motion beyond that value is also ignored.
252
2539.5 SET MOUSE KEYCODE MOSE
254
255 0x0A
256 deltax ; distance in X clicks to return (LEFT) or (RIGHT)
257 deltay ; distance in Y clicks to return (UP) or (DOWN)
258
259Set mouse monitoring routines to return cursor motion keycodes instead of
260either RELATIVE or ABSOLUTE motion records. The ikbd returns the appropriate
261cursor keycode after mouse travel exceeding the user specified deltas in
262either axis. When the keyboard is in key scan code mode, mouse motion will
263cause the make code immediately followed by the break code. Note that this
264command is not affected by the mouse motion origin.
265
2669..6 SET MOUSE THRESHOLD
267
268 0x0B
269 X ; x threshold in mouse ticks (positive integers)
270 Y ; y threshold in mouse ticks (positive integers)
271
272This command sets the threshold before a mouse event is generated. Note that
273it does NOT affect the resolution of the data returned to the host. This
274command is valid only in RELATIVE MOUSE POSITIONING mode. The thresholds
275default to 1 at RESET (or power-up).
276
2779.7 SET MOUSE SCALE
278
279 0x0C
280 X ; horizontal mouse ticks per internel X
281 Y ; vertical mouse ticks per internel Y
282
283This command sets the scale factor for the ABSOLUTE MOUSE POSITIONING mode.
284In this mode, the specified number of mouse phase changes ('clicks') must
285occur before the internally maintained coordinate is changed by one
286(independently scaled for each axis). Remember that the mouse position
287information is available only by interrogating the ikbd in the ABSOLUTE MOUSE
288POSITIONING mode unless the ikbd has been commanded to report on button press
289or release (see SET MOSE BUTTON ACTION).
290
2919.8 INTERROGATE MOUSE POSITION
292
293 0x0D
294 Returns:
295 0xF7 ; absolute mouse position header
296 BUTTONS
297 0000dcba ; where a is right button down since last interrogation
298 ; b is right button up since last
299 ; c is left button down since last
300 ; d is left button up since last
301 XMSB ; X coordinate
302 XLSB
303 YMSB ; Y coordinate
304 YLSB
305
306The INTERROGATE MOUSE POSITION command is valid when in the ABSOLUTE MOUSE
307POSITIONING mode, regardless of the setting of the MOUSE BUTTON ACTION.
308
3099.9 LOAD MOUSE POSITION
310
311 0x0E
312 0x00 ; filler
313 XMSB ; X coordinate
314 XLSB ; (in scaled coordinate system)
315 YMSB ; Y coordinate
316 YLSB
317
318This command allows the user to preset the internally maintained absolute
319mouse position.
320
3219.10 SET Y=0 AT BOTTOM
322
323 0x0F
324
325This command makes the origin of the Y axis to be at the bottom of the
326logical coordinate system internel to the ikbd for all relative or absolute
327mouse motion. This causes mouse motion toward the user to be negative in sign
328and away from the user to be positive.
329
3309.11 SET Y=0 AT TOP
331
332 0x10
333
334Makes the origin of the Y axis to be at the top of the logical coordinate
335system within the ikbd for all relative or absolute mouse motion. (DEFAULT)
336This causes mouse motion toward the user to be positive in sign and away from
337the user to be negative.
338
3399.12 RESUME
340
341 0x11
342
343Resume sending data to the host. Since any command received by the ikbd after
344its output has been paused also causes an implicit RESUME this command can be
345thought of as a NO OPERATION command. If this command is received by the ikbd
346and it is not PAUSED, it is simply ignored.
347
3489.13 DISABLE MOUSE
349
350 0x12
351
352All mouse event reporting is disabled (and scanning may be internally
353disabled). Any valid mouse mode command resumes mouse motion monitoring. (The
354valid mouse mode commands are SET RELATIVE MOUSE POSITION REPORTING, SET
355ABSOLUTE MOUSE POSITIONING, and SET MOUSE KEYCODE MODE. )
356N.B. If the mouse buttons have been commanded to act like keyboard keys, this
357command DOES affect their actions.
358
3599.14 PAUSE OUTPUT
360
361 0x13
362
363Stop sending data to the host until another valid command is received. Key
364matrix activity is still monitored and scan codes or ASCII characters enqueued
365(up to the maximum supported by the microcontroller) to be sent when the host
366allows the output to be resumed. If in the JOYSTICK EVENT REPORTING mode,
367joystick events are also queued.
368Mouse motion should be accumulated while the output is paused. If the ikbd is
369in RELATIVE MOUSE POSITIONING REPORTING mode, motion is accumulated beyond the
370normal threshold limits to produce the minimum number of packets necessary for
371transmission when output is resumed. Pressing or releasing either mouse button
372causes any accumulated motion to be immediately queued as packets, if the
373mouse is in RELATIVE MOUSE POSITION REPORTING mode.
374Because of the limitations of the microcontroller memory this command should
375be used sparingly, and the output should not be shut of for more than <tbd>
376milliseconds at a time.
377The output is stopped only at the end of the current 'even'. If the PAUSE
378OUTPUT command is received in the middle of a multiple byte report, the packet
379will still be transmitted to conclusion and then the PAUSE will take effect.
380When the ikbd is in either the JOYSTICK MONITORING mode or the FIRE BUTTON
381MONITORING mode, the PAUSE OUTPUT command also temporarily stops the
382monitoring process (i.e. the samples are not enqueued for transmission).
383
3840.15 SET JOYSTICK EVENT REPORTING
385
386 0x14
387
388Enter JOYSTICK EVENT REPORTING mode (DEFAULT). Each opening or closure of a
389joystick switch or trigger causes a joystick event record to be generated.
390
3919.16 SET JOYSTICK INTERROGATION MODE
392
393 0x15
394
395Disables JOYSTICK EVENT REPORTING. Host must send individual JOYSTICK
396INTERROGATE commands to sense joystick state.
397
3989.17 JOYSTICK INTERROGATE
399
400 0x16
401
402Return a record indicating the current state of the joysticks. This command
403is valid in either the JOYSTICK EVENT REPORTING mode or the JOYSTICK
404INTERROGATION MODE.
405
4069.18 SET JOYSTICK MONITORING
407
408 0x17
409 rate ; time between samples in hundreths of a second
410 Returns: (in packets of two as long as in mode)
411 %000000xy ; where y is JOYSTICK1 Fire button
412 ; and x is JOYSTICK0 Fire button
413 %nnnnmmmm ; where m is JOYSTICK1 state
414 ; and n is JOYSTICK0 state
415
416Sets the ikbd to do nothing but monitor the serial command lne, maintain the
417time-of-day clock, and monitor the joystick. The rate sets the interval
418between joystick samples.
419N.B. The user should not set the rate higher than the serial communications
420channel will allow the 2 bytes packets to be transmitted.
421
4229.19 SET FIRE BUTTON MONITORING
423
424 0x18
425 Returns: (as long as in mode)
426 %bbbbbbbb ; state of the JOYSTICK1 fire button packed
427 ; 8 bits per byte, the first sample if the MSB
428
429Set the ikbd to do nothing but monitor the serial command line, maintain the
430time-of-day clock, and monitor the fire button on Joystick 1. The fire button
431is scanned at a rate that causes 8 samples to be made in the time it takes for
432the previous byte to be sent to the host (i.e. scan rate = 8/10 * baud rate).
433The sample interval should be as constant as possible.
434
4359.20 SET JOYSTICK KEYCODE MODE
436
437 0x19
438 RX ; length of time (in tenths of seconds) until
439 ; horizontal velocity breakpoint is reached
440 RY ; length of time (in tenths of seconds) until
441 ; vertical velocity breakpoint is reached
442 TX ; length (in tenths of seconds) of joystick closure
443 ; until horizontal cursor key is generated before RX
444 ; has elapsed
445 TY ; length (in tenths of seconds) of joystick closure
446 ; until vertical cursor key is generated before RY
447 ; has elapsed
448 VX ; length (in tenths of seconds) of joystick closure
449 ; until horizontal cursor keystokes are generated
450 ; after RX has elapsed
451 VY ; length (in tenths of seconds) of joystick closure
452 ; until vertical cursor keystokes are generated
453 ; after RY has elapsed
454
455In this mode, joystick 0 is scanned in a way that simulates cursor keystrokes.
456On initial closure, a keystroke pair (make/break) is generated. Then up to Rn
457tenths of seconds later, keystroke pairs are generated every Tn tenths of
458seconds. After the Rn breakpoint is reached, keystroke pairs are generated
459every Vn tenths of seconds. This provides a velocity (auto-repeat) breakpoint
460feature.
461Note that by setting RX and/or Ry to zero, the velocity feature can be
462disabled. The values of TX and TY then become meaningless, and the generation
463of cursor 'keystrokes' is set by VX and VY.
464
4659.21 DISABLE JOYSTICKS
466
467 0x1A
468
469Disable the generation of any joystick events (and scanning may be internally
470disabled). Any valid joystick mode command resumes joystick monitoring. (The
471joystick mode commands are SET JOYSTICK EVENT REPORTING, SET JOYSTICK
472INTERROGATION MODE, SET JOYSTICK MONITORING, SET FIRE BUTTON MONITORING, and
473SET JOYSTICK KEYCODE MODE.)
474
4759.22 TIME-OF-DAY CLOCK SET
476
477 0x1B
478 YY ; year (2 least significant digits)
479 MM ; month
480 DD ; day
481 hh ; hour
482 mm ; minute
483 ss ; second
484
485All time-of-day data should be sent to the ikbd in packed BCD format.
486Any digit that is not a valid BCD digit should be treated as a 'don't care'
487and not alter that particular field of the date or time. This permits setting
488only some subfields of the time-of-day clock.
489
4909.23 INTERROGATE TIME-OF-DAT CLOCK
491
492 0x1C
493 Returns:
494 0xFC ; time-of-day event header
495 YY ; year (2 least significant digits)
496 MM ; month
497 DD ; day
498 hh ; hour
499 mm ; minute
500 ss ; second
501
502 All time-of-day is sent in packed BCD format.
503
5049.24 MEMORY LOAD
505
506 0x20
507 ADRMSB ; address in controller
508 ADRLSB ; memory to be loaded
509 NUM ; number of bytes (0-128)
510 { data }
511
512This command permits the host to load arbitrary values into the ikbd
513controller memory. The time between data bytes must be less than 20ms.
514
5159.25 MEMORY READ
516
517 0x21
518 ADRMSB ; address in controller
519 ADRLSB ; memory to be read
520 Returns:
521 0xF6 ; status header
522 0x20 ; memory access
523 { data } ; 6 data bytes starting at ADR
524
525This comand permits the host to read from the ikbd controller memory.
526
5279.26 CONTROLLER EXECUTE
528
529 0x22
530 ADRMSB ; address of subroutine in
531 ADRLSB ; controller memory to be called
532
533This command allows the host to command the execution of a subroutine in the
534ikbd controller memory.
535
5369.27 STATUS INQUIRIES
537
538 Status commands are formed by inclusively ORing 0x80 with the
539 relevant SET command.
540
541 Example:
542 0x88 (or 0x89 or 0x8A) ; request mouse mode
543 Returns:
544 0xF6 ; status response header
545 mode ; 0x08 is RELATIVE
546 ; 0x09 is ABSOLUTE
547 ; 0x0A is KEYCODE
548 param1 ; 0 is RELATIVE
549 ; XMSB maximum if ABSOLUTE
550 ; DELTA X is KEYCODE
551 param2 ; 0 is RELATIVE
552 ; YMSB maximum if ABSOLUTE
553 ; DELTA Y is KEYCODE
554 param3 ; 0 if RELATIVE
555 ; or KEYCODE
556 ; YMSB is ABSOLUTE
557 param4 ; 0 if RELATIVE
558 ; or KEYCODE
559 ; YLSB is ABSOLUTE
560 0 ; pad
561 0
562
563The STATUS INQUIRY commands request the ikbd to return either the current mode
564or the parameters associated with a given command. All status reports are
565padded to form 8 byte long return packets. The responses to the status
566requests are designed so that the host may store them away (after stripping
567off the status report header byte) and later send them back as commands to
568ikbd to restore its state. The 0 pad bytes will be treated as NOPs by the
569ikbd.
570
571 Valid STATUS INQUIRY commands are:
572
573 0x87 mouse button action
574 0x88 mouse mode
575 0x89
576 0x8A
577 0x8B mnouse threshold
578 0x8C mouse scale
579 0x8F mouse vertical coordinates
580 0x90 ( returns 0x0F Y=0 at bottom
581 0x10 Y=0 at top )
582 0x92 mouse enable/disable
583 ( returns 0x00 enabled)
584 0x12 disabled )
585 0x94 joystick mode
586 0x95
587 0x96
588 0x9A joystick enable/disable
589 ( returns 0x00 enabled
590 0x1A disabled )
591
592It is the (host) programmer's responsibility to have only one unanswered
593inquiry in process at a time.
594STATUS INQUIRY commands are not valid if the ikbd is in JOYSTICK MONITORING
595mode or FIRE BUTTON MONITORING mode.
596
597
59810. SCAN CODES
599
600The key scan codes return by the ikbd are chosen to simplify the
601implementaion of GSX.
602
603GSX Standard Keyboard Mapping.
604
605Hex Keytop
60601 Esc
60702 1
60803 2
60904 3
61005 4
61106 5
61207 6
61308 7
61409 8
6150A 9
6160B 0
6170C -
6180D ==
6190E BS
6200F TAB
62110 Q
62211 W
62312 E
62413 R
62514 T
62615 Y
62716 U
62817 I
62918 O
63019 P
6311A [
6321B ]
6331C RET
6341D CTRL
6351E A
6361F S
63720 D
63821 F
63922 G
64023 H
64124 J
64225 K
64326 L
64427 ;
64528 '
64629 `
6472A (LEFT) SHIFT
6482B \
6492C Z
6502D X
6512E C
6522F V
65330 B
65431 N
65532 M
65633 ,
65734 .
65835 /
65936 (RIGHT) SHIFT
66037 { NOT USED }
66138 ALT
66239 SPACE BAR
6633A CAPS LOCK
6643B F1
6653C F2
6663D F3
6673E F4
6683F F5
66940 F6
67041 F7
67142 F8
67243 F9
67344 F10
67445 { NOT USED }
67546 { NOT USED }
67647 HOME
67748 UP ARROW
67849 { NOT USED }
6794A KEYPAD -
6804B LEFT ARROW
6814C { NOT USED }
6824D RIGHT ARROW
6834E KEYPAD +
6844F { NOT USED }
68550 DOWN ARROW
68651 { NOT USED }
68752 INSERT
68853 DEL
68954 { NOT USED }
6905F { NOT USED }
69160 ISO KEY
69261 UNDO
69362 HELP
69463 KEYPAD (
69564 KEYPAD /
69665 KEYPAD *
69766 KEYPAD *
69867 KEYPAD 7
69968 KEYPAD 8
70069 KEYPAD 9
7016A KEYPAD 4
7026B KEYPAD 5
7036C KEYPAD 6
7046D KEYPAD 1
7056E KEYPAD 2
7066F KEYPAD 3
70770 KEYPAD 0
70871 KEYPAD .
70972 KEYPAD ENTER
diff --git a/Documentation/input/cd32.txt b/Documentation/input/cd32.txt
new file mode 100644
index 000000000000..a003d9b41eca
--- /dev/null
+++ b/Documentation/input/cd32.txt
@@ -0,0 +1,19 @@
1I have written a small patch that let's me use my Amiga CD32
2joypad connected to the parallel port. Thought I'd share it with you so
3you can add it to the list of supported joysticks (hopefully someone will
4find it useful).
5
6It needs the following wiring:
7
8CD32 pad | Parallel port
9----------------------------
101 (Up) | 2 (D0)
112 (Down) | 3 (D1)
123 (Left) | 4 (D2)
134 (Right) | 5 (D3)
145 (Fire3) | 14 (AUTOFD)
156 (Fire1) | 17 (SELIN)
167 (+5V) | 1 (STROBE)
178 (Gnd) | 18 (Gnd)
189 (Fire2) | 7 (D5)
19
diff --git a/Documentation/input/cs461x.txt b/Documentation/input/cs461x.txt
new file mode 100644
index 000000000000..6181747a14d8
--- /dev/null
+++ b/Documentation/input/cs461x.txt
@@ -0,0 +1,45 @@
1Preface.
2
3This is a new low-level driver to support analog joystick attached to
4Crystal SoundFusion CS4610/CS4612/CS4615. This code is based upon
5Vortex/Solo drivers as an example of decoration style, and ALSA
60.5.8a kernel drivers as an chipset documentation and samples.
7
8This version does not have cooked mode support; the basic code
9is present here, but have not tested completely. The button analysis
10is completed in this mode, but the axis movement is not.
11
12Raw mode works fine with analog joystick front-end driver and cs461x
13driver as a backend. I've tested this driver with CS4610, 4-axis and
144-button joystick; I mean the jstest utility. Also I've tried to
15play in xracer game using joystick, and the result is better than
16keyboard only mode.
17
18The sensitivity and calibrate quality have not been tested; the two
19reasons are performed: the same hardware cannot work under Win95 (blue
20screen in VJOYD); I have no documentation on my chip; and the existing
21behavior in my case was not raised the requirement of joystick calibration.
22So the driver have no code to perform hardware related calibration.
23
24The patch contains minor changes of Config.in and Makefile files. All
25needed code have been moved to one separate file cs461x.c like ns558.c
26This driver have the basic support for PCI devices only; there is no
27ISA or PnP ISA cards supported. AFAIK the ns558 have support for Crystal
28ISA and PnP ISA series.
29
30The driver works witn ALSA drivers simultaneously. For exmple, the xracer
31uses joystick as input device and PCM device as sound output in one time.
32There are no sound or input collisions detected. The source code have
33comments about them; but I've found the joystick can be initialized
34separately of ALSA modules. So, you canm use only one joystick driver
35without ALSA drivers. The ALSA drivers are not needed to compile or
36run this driver.
37
38There are no debug information print have been placed in source, and no
39specific options required to work this driver. The found chipset parameters
40are printed via printk(KERN_INFO "..."), see the /var/log/messages to
41inspect cs461x: prefixed messages to determine possible card detection
42errors.
43
44Regards,
45Viktor
diff --git a/Documentation/input/ff.txt b/Documentation/input/ff.txt
new file mode 100644
index 000000000000..efa7dd6751f3
--- /dev/null
+++ b/Documentation/input/ff.txt
@@ -0,0 +1,227 @@
1Force feedback for Linux.
2By Johann Deneux <deneux@ifrance.com> on 2001/04/22.
3You may redistribute this file. Please remember to include shape.fig and
4interactive.fig as well.
5----------------------------------------------------------------------------
6
70. Introduction
8~~~~~~~~~~~~~~~
9This document describes how to use force feedback devices under Linux. The
10goal is not to support these devices as if they were simple input-only devices
11(as it is already the case), but to really enable the rendering of force
12effects.
13At the moment, only I-Force devices are supported, and not officially. That
14means I had to find out how the protocol works on my own. Of course, the
15information I managed to grasp is far from being complete, and I can not
16guarranty that this driver will work for you.
17This document only describes the force feedback part of the driver for I-Force
18devices. Please read joystick.txt before reading further this document.
19
202. Instructions to the user
21~~~~~~~~~~~~~~~~~~~~~~~~~~~
22Here are instructions on how to compile and use the driver. In fact, this
23driver is the normal iforce, input and evdev drivers written by Vojtech
24Pavlik, plus additions to support force feedback.
25
26Before you start, let me WARN you that some devices shake violently during the
27initialisation phase. This happens for example with my "AVB Top Shot Pegasus".
28To stop this annoying behaviour, move you joystick to its limits. Anyway, you
29should keep a hand on your device, in order to avoid it to brake down if
30something goes wrong.
31
32At the kernel's compilation:
33 - Enable IForce/Serial
34 - Enable Event interface
35
36Compile the modules, install them.
37
38You also need inputattach.
39
40You then need to insert the modules into the following order:
41% modprobe joydev
42% modprobe serport # Only for serial
43% modprobe iforce
44% modprobe evdev
45% ./inputattach -ifor $2 & # Only for serial
46If you are using USB, you don't need the inputattach step.
47
48Please check that you have all the /dev/input entries needed:
49cd /dev
50rm js*
51mkdir input
52mknod input/js0 c 13 0
53mknod input/js1 c 13 1
54mknod input/js2 c 13 2
55mknod input/js3 c 13 3
56ln -s input/js0 js0
57ln -s input/js1 js1
58ln -s input/js2 js2
59ln -s input/js3 js3
60
61mknod input/event0 c 13 64
62mknod input/event1 c 13 65
63mknod input/event2 c 13 66
64mknod input/event3 c 13 67
65
662.1 Does it work ?
67~~~~~~~~~~~~~~~~~~
68There is an utility called fftest that will allow you to test the driver.
69% fftest /dev/input/eventXX
70
713. Instructions to the developper
72~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 All interactions are done using the event API. That is, you can use ioctl()
74and write() on /dev/input/eventXX.
75 This information is subject to change.
76
773.1 Querying device capabilities
78~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79#include <linux/input.h>
80#include <sys/ioctl.h>
81
82unsigned long features[1 + FF_MAX/sizeof(unsigned long)];
83int ioctl(int file_descriptor, int request, unsigned long *features);
84
85"request" must be EVIOCGBIT(EV_FF, size of features array in bytes )
86
87Returns the features supported by the device. features is a bitfield with the
88following bits:
89- FF_X has an X axis (usually joysticks)
90- FF_Y has an Y axis (usually joysticks)
91- FF_WHEEL has a wheel (usually sterring wheels)
92- FF_CONSTANT can render constant force effects
93- FF_PERIODIC can render periodic effects (sine, triangle, square...)
94- FF_RAMP can render ramp effects
95- FF_SPRING can simulate the presence of a spring
96- FF_FRICTION can simulate friction
97- FF_DAMPER can simulate damper effects
98- FF_RUMBLE rumble effects (normally the only effect supported by rumble
99 pads)
100- FF_INERTIA can simulate inertia
101
102
103int ioctl(int fd, EVIOCGEFFECTS, int *n);
104
105Returns the number of effects the device can keep in its memory.
106
1073.2 Uploading effects to the device
108~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109#include <linux/input.h>
110#include <sys/ioctl.h>
111
112int ioctl(int file_descriptor, int request, struct ff_effect *effect);
113
114"request" must be EVIOCSFF.
115
116"effect" points to a structure describing the effect to upload. The effect is
117uploaded, but not played.
118The content of effect may be modified. In particular, its field "id" is set
119to the unique id assigned by the driver. This data is required for performing
120some operations (removing an effect, controlling the playback).
121This if field must be set to -1 by the user in order to tell the driver to
122allocate a new effect.
123See <linux/input.h> for a description of the ff_effect stuct. You should also
124find help in a few sketches, contained in files shape.fig and interactive.fig.
125You need xfig to visualize these files.
126
1273.3 Removing an effect from the device
128~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129int ioctl(int fd, EVIOCRMFF, effect.id);
130
131This makes room for new effects in the device's memory. Please note this won't
132stop the effect if it was playing.
133
1343.4 Controlling the playback of effects
135~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136Control of playing is done with write(). Below is an example:
137
138#include <linux/input.h>
139#include <unistd.h>
140
141 struct input_event play;
142 struct input_event stop;
143 struct ff_effect effect;
144 int fd;
145...
146 fd = open("/dev/input/eventXX", O_RDWR);
147...
148 /* Play three times */
149 play.type = EV_FF;
150 play.code = effect.id;
151 play.value = 3;
152
153 write(fd, (const void*) &play, sizeof(play));
154...
155 /* Stop an effect */
156 stop.type = EV_FF;
157 stop.code = effect.id;
158 stop.value = 0;
159
160 write(fd, (const void*) &play, sizeof(stop));
161
1623.5 Setting the gain
163~~~~~~~~~~~~~~~~~~~~
164Not all devices have the same strength. Therefore, users should set a gain
165factor depending on how strong they want effects to be. This setting is
166persistent across access to the driver, so you should not care about it if
167you are writing games, as another utility probably already set this for you.
168
169/* Set the gain of the device
170int gain; /* between 0 and 100 */
171struct input_event ie; /* structure used to communicate with the driver */
172
173ie.type = EV_FF;
174ie.code = FF_GAIN;
175ie.value = 0xFFFFUL * gain / 100;
176
177if (write(fd, &ie, sizeof(ie)) == -1)
178 perror("set gain");
179
1803.6 Enabling/Disabling autocenter
181~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182The autocenter feature quite disturbs the rendering of effects in my opinion,
183and I think it should be an effect, which computation depends on the game
184type. But you can enable it if you want.
185
186int autocenter; /* between 0 and 100 */
187struct input_event ie;
188
189ie.type = EV_FF;
190ie.code = FF_AUTOCENTER;
191ie.value = 0xFFFFUL * autocenter / 100;
192
193if (write(fd, &ie, sizeof(ie)) == -1)
194 perror("set auto-center");
195
196A value of 0 means "no auto-center".
197
1983.7 Dynamic update of an effect
199~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200Proceed as if you wanted to upload a new effect, except that instead of
201setting the id field to -1, you set it to the wanted effect id.
202Normally, the effect is not stopped and restarted. However, depending on the
203type of device, not all parameters can be dynamically updated. For example,
204the direction of an effect cannot be updated with iforce devices. In this
205case, the driver stops the effect, up-load it, and restart it.
206
207
2083.8 Information about the status of effects
209~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210Every time the status of an effect is changed, an event is sent. The values
211and meanings of the fields of the event are as follows:
212struct input_event {
213/* When the status of the effect changed */
214 struct timeval time;
215
216/* Set to EV_FF_STATUS */
217 unsigned short type;
218
219/* Contains the id of the effect */
220 unsigned short code;
221
222/* Indicates the status */
223 unsigned int value;
224};
225
226FF_STATUS_STOPPED The effect stopped playing
227FF_STATUS_PLAYING The effect started to play
diff --git a/Documentation/input/gameport-programming.txt b/Documentation/input/gameport-programming.txt
new file mode 100644
index 000000000000..1ba3d322e0ac
--- /dev/null
+++ b/Documentation/input/gameport-programming.txt
@@ -0,0 +1,189 @@
1$Id: gameport-programming.txt,v 1.3 2001/04/24 13:51:37 vojtech Exp $
2
3Programming gameport drivers
4~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
61. A basic classic gameport
7~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
9If the gameport doesn't provide more than the inb()/outb() functionality,
10the code needed to register it with the joystick drivers is simple:
11
12 struct gameport gameport;
13
14 gameport.io = MY_IO_ADDRESS;
15 gameport_register_port(&gameport);
16
17Make sure struct gameport is initialized to 0 in all other fields. The
18gameport generic code will take care of the rest.
19
20If your hardware supports more than one io address, and your driver can
21choose which one program the hardware to, starting from the more exotic
22addresses is preferred, because the likelyhood of clashing with the standard
230x201 address is smaller.
24
25Eg. if your driver supports addresses 0x200, 0x208, 0x210 and 0x218, then
260x218 would be the address of first choice.
27
28If your hardware supports a gameport address that is not mapped to ISA io
29space (is above 0x1000), use that one, and don't map the ISA mirror.
30
31Also, always request_region() on the whole io space occupied by the
32gameport. Although only one ioport is really used, the gameport usually
33occupies from one to sixteen addresses in the io space.
34
35Please also consider enabling the gameport on the card in the ->open()
36callback if the io is mapped to ISA space - this way it'll occupy the io
37space only when something really is using it. Disable it again in the
38->close() callback. You also can select the io address in the ->open()
39callback, so that it doesn't fail if some of the possible addresses are
40already occupied by other gameports.
41
422. Memory mapped gameport
43~~~~~~~~~~~~~~~~~~~~~~~~~
44
45When a gameport can be accessed through MMIO, this way is preferred, because
46it is faster, allowing more reads per second. Registering such a gameport
47isn't as easy as a basic IO one, but not so much complex:
48
49 struct gameport gameport;
50
51 void my_trigger(struct gameport *gameport)
52 {
53 my_mmio = 0xff;
54 }
55
56 unsigned char my_read(struct gameport *gameport)
57 {
58 return my_mmio;
59 }
60
61 gameport.read = my_read;
62 gameport.trigger = my_trigger;
63 gameport_register_port(&gameport);
64
653. Cooked mode gameport
66~~~~~~~~~~~~~~~~~~~~~~~
67
68There are gameports that can report the axis values as numbers, that means
69the driver doesn't have to measure them the old way - an ADC is built into
70the gameport. To register a cooked gameport:
71
72 struct gameport gameport;
73
74 int my_cooked_read(struct gameport *gameport, int *axes, int *buttons)
75 {
76 int i;
77
78 for (i = 0; i < 4; i++)
79 axes[i] = my_mmio[i];
80 buttons[i] = my_mmio[4];
81 }
82
83 int my_open(struct gameport *gameport, int mode)
84 {
85 return -(mode != GAMEPORT_MODE_COOKED);
86 }
87
88 gameport.cooked_read = my_cooked_read;
89 gameport.open = my_open;
90 gameport.fuzz = 8;
91 gameport_register_port(&gameport);
92
93The only confusing thing here is the fuzz value. Best determined by
94experimentation, it is the amount of noise in the ADC data. Perfect
95gameports can set this to zero, most common have fuzz between 8 and 32.
96See analog.c and input.c for handling of fuzz - the fuzz value determines
97the size of a gaussian filter window that is used to eliminate the noise
98in the data.
99
1004. More complex gameports
101~~~~~~~~~~~~~~~~~~~~~~~~~
102
103Gameports can support both raw and cooked modes. In that case combine either
104examples 1+2 or 1+3. Gameports can support internal calibration - see below,
105and also lightning.c and analog.c on how that works. If your driver supports
106more than one gameport instance simultaneously, use the ->private member of
107the gameport struct to point to your data.
108
1095. Unregistering a gameport
110~~~~~~~~~~~~~~~~~~~~~~~~~~~
111
112Simple:
113
114gameport_unregister_port(&gameport);
115
1166. The gameport structure
117~~~~~~~~~~~~~~~~~~~~~~~~~
118
119struct gameport {
120
121 void *private;
122
123A private pointer for free use in the gameport driver. (Not the joystick
124driver!)
125
126 int number;
127
128Number assigned to the gameport when registered. Informational purpose only.
129
130 int io;
131
132I/O address for use with raw mode. You have to either set this, or ->read()
133to some value if your gameport supports raw mode.
134
135 int speed;
136
137Raw mode speed of the gameport reads in thousands of reads per second.
138
139 int fuzz;
140
141If the gameport supports cooked mode, this should be set to a value that
142represents the amount of noise in the data. See section 3.
143
144 void (*trigger)(struct gameport *);
145
146Trigger. This function should trigger the ns558 oneshots. If set to NULL,
147outb(0xff, io) will be used.
148
149 unsigned char (*read)(struct gameport *);
150
151Read the buttons and ns558 oneshot bits. If set to NULL, inb(io) will be
152used instead.
153
154 int (*cooked_read)(struct gameport *, int *axes, int *buttons);
155
156If the gameport supports cooked mode, it should point this to its cooked
157read function. It should fill axes[0..3] with four values of the joystick axes
158and buttons[0] with four bits representing the buttons.
159
160 int (*calibrate)(struct gameport *, int *axes, int *max);
161
162Function for calibrating the ADC hardware. When called, axes[0..3] should be
163pre-filled by cooked data by the caller, max[0..3] should be pre-filled with
164expected maximums for each axis. The calibrate() function should set the
165sensitivity of the ADC hardware so that the maximums fit in its range and
166recompute the axes[] values to match the new sensitivity or re-read them from
167the hardware so that they give valid values.
168
169 int (*open)(struct gameport *, int mode);
170
171Open() serves two purposes. First a driver either opens the port in raw or
172in cooked mode, the open() callback can decide which modes are supported.
173Second, resource allocation can happen here. The port can also be enabled
174here. Prior to this call, other fields of the gameport struct (namely the io
175member) need not to be valid.
176
177 void (*close)(struct gameport *);
178
179Close() should free the resources allocated by open, possibly disabling the
180gameport.
181
182 struct gameport_dev *dev;
183 struct gameport *next;
184
185For internal use by the gameport layer.
186
187};
188
189Enjoy!
diff --git a/Documentation/input/iforce-protocol.txt b/Documentation/input/iforce-protocol.txt
new file mode 100644
index 000000000000..95df4ca70e71
--- /dev/null
+++ b/Documentation/input/iforce-protocol.txt
@@ -0,0 +1,254 @@
1** Introduction
2This document describes what I managed to discover about the protocol used to
3specify force effects to I-Force 2.0 devices. None of this information comes
4from Immerse. That's why you should not trust what is written in this
5document. This document is intended to help understanding the protocol.
6This is not a reference. Comments and corrections are welcome. To contact me,
7send an email to: deneux@ifrance.com
8
9** WARNING **
10I may not be held responsible for any dammage or harm caused if you try to
11send data to your I-Force device based on what you read in this document.
12
13** Preliminary Notes:
14All values are hexadecimal with big-endian encoding (msb on the left). Beware,
15values inside packets are encoded using little-endian. Bytes whose roles are
16unknown are marked ??? Information that needs deeper inspection is marked (?)
17
18** General form of a packet **
19This is how packets look when the device uses the rs232 to communicate.
202B OP LEN DATA CS
21CS is the checksum. It is equal to the exclusive or of all bytes.
22
23When using USB:
24OP DATA
25The 2B, LEN and CS fields have disappeared, probably because USB handles frames and
26data corruption is handled or unsignificant.
27
28First, I describe effects that are sent by the device to the computer
29
30** Device input state
31This packet is used to indicate the state of each button and the value of each
32axis
33OP= 01 for a joystick, 03 for a wheel
34LEN= Varies from device to device
3500 X-Axis lsb
3601 X-Axis msb
3702 Y-Axis lsb, or gas pedal for a wheel
3803 Y-Axis msb, or brake pedal for a wheel
3904 Throttle
4005 Buttons
4106 Lower 4 bits: Buttons
42 Upper 4 bits: Hat
4307 Rudder
44
45** Device effects states
46OP= 02
47LEN= Varies
4800 ? Bit 1 (Value 2) is the value of the deadman switch
4901 Bit 8 is set if the effect is playing. Bits 0 to 7 are the effect id.
5002 ??
5103 Address of parameter block changed (lsb)
5204 Address of parameter block changed (msb)
5305 Address of second parameter block changed (lsb)
54... depending on the number of parameter blocks updated
55
56** Force effect **
57OP= 01
58LEN= 0e
5900 Channel (when playing several effects at the same time, each must be assigned a channel)
6001 Wave form
61 Val 00 Constant
62 Val 20 Square
63 Val 21 Triangle
64 Val 22 Sine
65 Val 23 Sawtooth up
66 Val 24 Sawtooth down
67 Val 40 Spring (Force = f(pos))
68 Val 41 Friction (Force = f(velocity)) and Inertia (Force = f(acceleration))
69
70
7102 Axes affected and trigger
72 Bits 4-7: Val 2 = effect along one axis. Byte 05 indicates direction
73 Val 4 = X axis only. Byte 05 must contain 5a
74 Val 8 = Y axis only. Byte 05 must contain b4
75 Val c = X and Y axes. Bytes 05 must contain 60
76 Bits 0-3: Val 0 = No trigger
77 Val x+1 = Button x triggers the effect
78 When the whole byte is 0, cancel the previously set trigger
79
8003-04 Duration of effect (little endian encoding, in ms)
81
8205 Direction of effect, if applicable. Else, see 02 for value to assign.
83
8406-07 Minimum time between triggering.
85
8608-09 Address of periodicity or magnitude parameters
870a-0b Address of attack and fade parameters, or ffff if none.
88*or*
8908-09 Address of interactive parameters for X-axis, or ffff if not applicable
900a-0b Address of interactive parameters for Y-axis, or ffff if not applicable
91
920c-0d Delay before execution of effect (little endian encoding, in ms)
93
94
95** Time based parameters **
96
97*** Attack and fade ***
98OP= 02
99LEN= 08
10000-01 Address where to store the parameteres
10102-03 Duration of attack (little endian encoding, in ms)
10204 Level at end of attack. Signed byte.
10305-06 Duration of fade.
10407 Level at end of fade.
105
106*** Magnitude ***
107OP= 03
108LEN= 03
10900-01 Address
11002 Level. Signed byte.
111
112*** Periodicity ***
113OP= 04
114LEN= 07
11500-01 Address
11602 Magnitude. Signed byte.
11703 Offset. Signed byte.
11804 Phase. Val 00 = 0 deg, Val 40 = 90 degs.
11905-06 Period (little endian encoding, in ms)
120
121** Interactive parameters **
122OP= 05
123LEN= 0a
12400-01 Address
12502 Positive Coeff
12603 Negative Coeff
12704+05 Offset (center)
12806+07 Dead band (Val 01F4 = 5000 (decimal))
12908 Positive saturation (Val 0a = 1000 (decimal) Val 64 = 10000 (decimal))
13009 Negative saturation
131
132The encoding is a bit funny here: For coeffs, these are signed values. The
133maximum value is 64 (100 decimal), the min is 9c.
134For the offset, the minimum value is FE0C, the maximum value is 01F4.
135For the deadband, the minimum value is 0, the max is 03E8.
136
137** Controls **
138OP= 41
139LEN= 03
14000 Channel
14101 Start/Stop
142 Val 00: Stop
143 Val 01: Start and play once.
144 Val 41: Start and play n times (See byte 02 below)
14502 Number of iterations n.
146
147** Init **
148
149*** Querying features ***
150OP= ff
151Query command. Length varies according to the query type.
152The general format of this packet is:
153ff 01 QUERY [INDEX] CHECKSUM
154reponses are of the same form:
155FF LEN QUERY VALUE_QUERIED CHECKSUM2
156where LEN = 1 + length(VALUE_QUERIED)
157
158**** Query ram size ****
159QUERY = 42 ('B'uffer size)
160The device should reply with the same packet plus two additionnal bytes
161containing the size of the memory:
162ff 03 42 03 e8 CS would mean that the device has 1000 bytes of ram available.
163
164**** Query number of effects ****
165QUERY = 4e ('N'umber of effects)
166The device should respond by sending the number of effects that can be played
167at the same time (one byte)
168ff 02 4e 14 CS would stand for 20 effects.
169
170**** Vendor's id ****
171QUERY = 4d ('M'anufacturer)
172Query the vendors'id (2 bytes)
173
174**** Product id *****
175QUERY = 50 ('P'roduct)
176Query the product id (2 bytes)
177
178**** Open device ****
179QUERY = 4f ('O'pen)
180No data returned.
181
182**** Close device *****
183QUERY = 43 ('C')lose
184No data returned.
185
186**** Query effect ****
187QUERY = 45 ('E')
188Send effect type.
189Returns nonzero if supported (2 bytes)
190
191**** Firmware Version ****
192QUERY = 56 ('V'ersion)
193Sends back 3 bytes - major, minor, subminor
194
195*** Initialisation of the device ***
196
197**** Set Control ****
198!!! Device dependent, can be different on different models !!!
199OP= 40 <idx> <val> [<val>]
200LEN= 2 or 3
20100 Idx
202 Idx 00 Set dead zone (0..2048)
203 Idx 01 Ignore Deadman sensor (0..1)
204 Idx 02 Enable comm watchdog (0..1)
205 Idx 03 Set the strength of the spring (0..100)
206 Idx 04 Enable or disable the spring (0/1)
207 Idx 05 Set axis saturation threshold (0..2048)
208
209**** Set Effect State ****
210OP= 42 <val>
211LEN= 1
21200 State
213 Bit 3 Pause force feedback
214 Bit 2 Enable force feedback
215 Bit 0 Stop all effects
216
217**** Set overall gain ****
218OP= 43 <val>
219LEN= 1
22000 Gain
221 Val 00 = 0%
222 Val 40 = 50%
223 Val 80 = 100%
224
225** Parameter memory **
226
227Each device has a certain amount of memory to store parameters of effects.
228The amount of RAM may vary, I encountered values from 200 to 1000 bytes. Below
229is the amount of memory apparently needed for every set of parameters:
230 - period : 0c
231 - magnitude : 02
232 - attack and fade : 0e
233 - interactive : 08
234
235** Appendix: How to study the protocol ? **
236
2371. Generate effects using the force editor provided with the DirectX SDK, or use Immersion Studio (freely available at their web site in the developer section: www.immersion.com)
2382. Start a soft spying RS232 or USB (depending on where you connected your joystick/wheel). I used ComPortSpy from fCoder (alpha version!)
2393. Play the effect, and watch what happens on the spy screen.
240
241A few words about ComPortSpy:
242At first glance, this soft seems, hum, well... buggy. In fact, data appear with a few seconds latency. Personnaly, I restart it every time I play an effect.
243Remember it's free (as in free beer) and alpha!
244
245** URLS **
246Check www.immerse.com for Immersion Studio, and www.fcoder.com for ComPortSpy.
247
248** Author of this document **
249Johann Deneux <deneux@ifrance.com>
250Home page at http://www.esil.univ-mrs.fr/~jdeneux/projects/ff/
251
252Additions by Vojtech Pavlik.
253
254I-Force is trademark of Immersion Corp.
diff --git a/Documentation/input/input-programming.txt b/Documentation/input/input-programming.txt
new file mode 100644
index 000000000000..180e0689676c
--- /dev/null
+++ b/Documentation/input/input-programming.txt
@@ -0,0 +1,281 @@
1$Id: input-programming.txt,v 1.4 2001/05/04 09:47:14 vojtech Exp $
2
3Programming input drivers
4~~~~~~~~~~~~~~~~~~~~~~~~~
5
61. Creating an input device driver
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
91.0 The simplest example
10~~~~~~~~~~~~~~~~~~~~~~~~
11
12Here comes a very simple example of an input device driver. The device has
13just one button and the button is accessible at i/o port BUTTON_PORT. When
14pressed or released a BUTTON_IRQ happens. The driver could look like:
15
16#include <linux/input.h>
17#include <linux/module.h>
18#include <linux/init.h>
19
20#include <asm/irq.h>
21#include <asm/io.h>
22
23static void button_interrupt(int irq, void *dummy, struct pt_regs *fp)
24{
25 input_report_key(&button_dev, BTN_1, inb(BUTTON_PORT) & 1);
26 input_sync(&button_dev);
27}
28
29static int __init button_init(void)
30{
31 if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) {
32 printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
33 return -EBUSY;
34 }
35
36 button_dev.evbit[0] = BIT(EV_KEY);
37 button_dev.keybit[LONG(BTN_0)] = BIT(BTN_0);
38
39 input_register_device(&button_dev);
40}
41
42static void __exit button_exit(void)
43{
44 input_unregister_device(&button_dev);
45 free_irq(BUTTON_IRQ, button_interrupt);
46}
47
48module_init(button_init);
49module_exit(button_exit);
50
511.1 What the example does
52~~~~~~~~~~~~~~~~~~~~~~~~~
53
54First it has to include the <linux/input.h> file, which interfaces to the
55input subsystem. This provides all the definitions needed.
56
57In the _init function, which is called either upon module load or when
58booting the kernel, it grabs the required resources (it should also check
59for the presence of the device).
60
61Then it sets the input bitfields. This way the device driver tells the other
62parts of the input systems what it is - what events can be generated or
63accepted by this input device. Our example device can only generate EV_KEY type
64events, and from those only BTN_0 event code. Thus we only set these two
65bits. We could have used
66
67 set_bit(EV_KEY, button_dev.evbit);
68 set_bit(BTN_0, button_dev.keybit);
69
70as well, but with more than single bits the first approach tends to be
71shorter.
72
73Then the example driver registers the input device structure by calling
74
75 input_register_device(&button_dev);
76
77This adds the button_dev structure to linked lists of the input driver and
78calls device handler modules _connect functions to tell them a new input
79device has appeared. Because the _connect functions may call kmalloc(,
80GFP_KERNEL), which can sleep, input_register_device() must not be called
81from an interrupt or with a spinlock held.
82
83While in use, the only used function of the driver is
84
85 button_interrupt()
86
87which upon every interrupt from the button checks its state and reports it
88via the
89
90 input_report_key()
91
92call to the input system. There is no need to check whether the interrupt
93routine isn't reporting two same value events (press, press for example) to
94the input system, because the input_report_* functions check that
95themselves.
96
97Then there is the
98
99 input_sync()
100
101call to tell those who receive the events that we've sent a complete report.
102This doesn't seem important in the one button case, but is quite important
103for for example mouse movement, where you don't want the X and Y values
104to be interpreted separately, because that'd result in a different movement.
105
1061.2 dev->open() and dev->close()
107~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
109In case the driver has to repeatedly poll the device, because it doesn't
110have an interrupt coming from it and the polling is too expensive to be done
111all the time, or if the device uses a valuable resource (eg. interrupt), it
112can use the open and close callback to know when it can stop polling or
113release the interrupt and when it must resume polling or grab the interrupt
114again. To do that, we would add this to our example driver:
115
116int button_used = 0;
117
118static int button_open(struct input_dev *dev)
119{
120 if (button_used++)
121 return 0;
122
123 if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) {
124 printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
125 button_used--;
126 return -EBUSY;
127 }
128
129 return 0;
130}
131
132static void button_close(struct input_dev *dev)
133{
134 if (!--button_used)
135 free_irq(IRQ_AMIGA_VERTB, button_interrupt);
136}
137
138static int __init button_init(void)
139{
140 ...
141 button_dev.open = button_open;
142 button_dev.close = button_close;
143 ...
144}
145
146Note the button_used variable - we have to track how many times the open
147function was called to know when exactly our device stops being used.
148
149The open() callback should return a 0 in case of success or any nonzero value
150in case of failure. The close() callback (which is void) must always succeed.
151
1521.3 Basic event types
153~~~~~~~~~~~~~~~~~~~~~
154
155The most simple event type is EV_KEY, which is used for keys and buttons.
156It's reported to the input system via:
157
158 input_report_key(struct input_dev *dev, int code, int value)
159
160See linux/input.h for the allowable values of code (from 0 to KEY_MAX).
161Value is interpreted as a truth value, ie any nonzero value means key
162pressed, zero value means key released. The input code generates events only
163in case the value is different from before.
164
165In addition to EV_KEY, there are two more basic event types: EV_REL and
166EV_ABS. They are used for relative and absolute values supplied by the
167device. A relative value may be for example a mouse movement in the X axis.
168The mouse reports it as a relative difference from the last position,
169because it doesn't have any absolute coordinate system to work in. Absolute
170events are namely for joysticks and digitizers - devices that do work in an
171absolute coordinate systems.
172
173Having the device report EV_REL buttons is as simple as with EV_KEY, simply
174set the corresponding bits and call the
175
176 input_report_rel(struct input_dev *dev, int code, int value)
177
178function. Events are generated only for nonzero value.
179
180However EV_ABS requires a little special care. Before calling
181input_register_device, you have to fill additional fields in the input_dev
182struct for each absolute axis your device has. If our button device had also
183the ABS_X axis:
184
185 button_dev.absmin[ABS_X] = 0;
186 button_dev.absmax[ABS_X] = 255;
187 button_dev.absfuzz[ABS_X] = 4;
188 button_dev.absflat[ABS_X] = 8;
189
190This setting would be appropriate for a joystick X axis, with the minimum of
1910, maximum of 255 (which the joystick *must* be able to reach, no problem if
192it sometimes reports more, but it must be able to always reach the min and
193max values), with noise in the data up to +- 4, and with a center flat
194position of size 8.
195
196If you don't need absfuzz and absflat, you can set them to zero, which mean
197that the thing is precise and always returns to exactly the center position
198(if it has any).
199
2001.4 The void *private field
201~~~~~~~~~~~~~~~~~~~~~~~~~~~
202
203This field in the input structure can be used to point to any private data
204structures in the input device driver, in case the driver handles more than
205one device. You'll need it in the open and close callbacks.
206
2071.5 NBITS(), LONG(), BIT()
208~~~~~~~~~~~~~~~~~~~~~~~~~~
209
210These three macros from input.h help some bitfield computations:
211
212 NBITS(x) - returns the length of a bitfield array in longs for x bits
213 LONG(x) - returns the index in the array in longs for bit x
214 BIT(x) - returns the index in a long for bit x
215
2161.6 The number, id* and name fields
217~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218
219The dev->number is assigned by the input system to the input device when it
220is registered. It has no use except for identifying the device to the user
221in system messages.
222
223The dev->name should be set before registering the input device by the input
224device driver. It's a string like 'Generic button device' containing a
225user friendly name of the device.
226
227The id* fields contain the bus ID (PCI, USB, ...), vendor ID and device ID
228of the device. The bus IDs are defined in input.h. The vendor and device ids
229are defined in pci_ids.h, usb_ids.h and similar include files. These fields
230should be set by the input device driver before registering it.
231
232The idtype field can be used for specific information for the input device
233driver.
234
235The id and name fields can be passed to userland via the evdev interface.
236
2371.7 The keycode, keycodemax, keycodesize fields
238~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
239
240These two fields will be used for any input devices that report their data
241as scancodes. If not all scancodes can be known by autodetection, they may
242need to be set by userland utilities. The keycode array then is an array
243used to map from scancodes to input system keycodes. The keycode max will
244contain the size of the array and keycodesize the size of each entry in it
245(in bytes).
246
2471.8 Key autorepeat
248~~~~~~~~~~~~~~~~~~
249
250... is simple. It is handled by the input.c module. Hardware autorepeat is
251not used, because it's not present in many devices and even where it is
252present, it is broken sometimes (at keyboards: Toshiba notebooks). To enable
253autorepeat for your device, just set EV_REP in dev->evbit. All will be
254handled by the input system.
255
2561.9 Other event types, handling output events
257~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258
259The other event types up to now are:
260
261EV_LED - used for the keyboard LEDs.
262EV_SND - used for keyboard beeps.
263
264They are very similar to for example key events, but they go in the other
265direction - from the system to the input device driver. If your input device
266driver can handle these events, it has to set the respective bits in evbit,
267*and* also the callback routine:
268
269 button_dev.event = button_event;
270
271int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
272{
273 if (type == EV_SND && code == SND_BELL) {
274 outb(value, BUTTON_BELL);
275 return 0;
276 }
277 return -1;
278}
279
280This callback routine can be called from an interrupt or a BH (although that
281isn't a rule), and thus must not sleep, and must not take too long to finish.
diff --git a/Documentation/input/input.txt b/Documentation/input/input.txt
new file mode 100644
index 000000000000..47137e75fdb8
--- /dev/null
+++ b/Documentation/input/input.txt
@@ -0,0 +1,312 @@
1 Linux Input drivers v1.0
2 (c) 1999-2001 Vojtech Pavlik <vojtech@ucw.cz>
3 Sponsored by SuSE
4 $Id: input.txt,v 1.8 2002/05/29 03:15:01 bradleym Exp $
5----------------------------------------------------------------------------
6
70. Disclaimer
8~~~~~~~~~~~~~
9 This program is free software; you can redistribute it and/or modify it
10under the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 2 of the License, or (at your option)
12any later version.
13
14 This program is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17more details.
18
19 You should have received a copy of the GNU General Public License along
20with this program; if not, write to the Free Software Foundation, Inc., 59
21Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
23 Should you need to contact me, the author, you can do so either by e-mail
24- mail your message to <vojtech@ucw.cz>, or by paper mail: Vojtech Pavlik,
25Simunkova 1594, Prague 8, 182 00 Czech Republic
26
27 For your convenience, the GNU General Public License version 2 is included
28in the package: See the file COPYING.
29
301. Introduction
31~~~~~~~~~~~~~~~
32 This is a collection of drivers that is designed to support all input
33devices under Linux. While it is currently used only on for USB input
34devices, future use (say 2.5/2.6) is expected to expand to replace
35most of the existing input system, which is why it lives in
36drivers/input/ instead of drivers/usb/.
37
38 The centre of the input drivers is the input module, which must be
39loaded before any other of the input modules - it serves as a way of
40communication between two groups of modules:
41
421.1 Device drivers
43~~~~~~~~~~~~~~~~~~
44 These modules talk to the hardware (for example via USB), and provide
45events (keystrokes, mouse movements) to the input module.
46
471.2 Event handlers
48~~~~~~~~~~~~~~~~~~
49 These modules get events from input and pass them where needed via
50various interfaces - keystrokes to the kernel, mouse movements via a
51simulated PS/2 interface to GPM and X and so on.
52
532. Simple Usage
54~~~~~~~~~~~~~~~
55 For the most usual configuration, with one USB mouse and one USB keyboard,
56you'll have to load the following modules (or have them built in to the
57kernel):
58
59 input
60 mousedev
61 keybdev
62 usbcore
63 uhci_hcd or ohci_hcd or ehci_hcd
64 usbhid
65
66 After this, the USB keyboard will work straight away, and the USB mouse
67will be available as a character device on major 13, minor 63:
68
69 crw-r--r-- 1 root root 13, 63 Mar 28 22:45 mice
70
71 This device has to be created, unless you use devfs, in which case it's
72created automatically. The commands to do create it by hand are:
73
74 cd /dev
75 mkdir input
76 mknod input/mice c 13 63
77
78 After that you have to point GPM (the textmode mouse cut&paste tool) and
79XFree to this device to use it - GPM should be called like:
80
81 gpm -t ps2 -m /dev/input/mice
82
83 And in X:
84
85 Section "Pointer"
86 Protocol "ImPS/2"
87 Device "/dev/input/mice"
88 ZAxisMapping 4 5
89 EndSection
90
91 When you do all of the above, you can use your USB mouse and keyboard.
92
933. Detailed Description
94~~~~~~~~~~~~~~~~~~~~~~~
953.1 Device drivers
96~~~~~~~~~~~~~~~~~~
97 Device drivers are the modules that generate events. The events are
98however not useful without being handled, so you also will need to use some
99of the modules from section 3.2.
100
1013.1.1 usbhid
102~~~~~~~~~~~~
103 usbhid is the largest and most complex driver of the whole suite. It
104handles all HID devices, and because there is a very wide variety of them,
105and because the USB HID specification isn't simple, it needs to be this big.
106
107 Currently, it handles USB mice, joysticks, gamepads, steering wheels
108keyboards, trackballs and digitizers.
109
110 However, USB uses HID also for monitor controls, speaker controls, UPSs,
111LCDs and many other purposes.
112
113 The monitor and speaker controls should be easy to add to the hid/input
114interface, but for the UPSs and LCDs it doesn't make much sense. For this,
115the hiddev interface was designed. See Documentation/usb/hiddev.txt
116for more information about it.
117
118 The usage of the usbhid module is very simple, it takes no parameters,
119detects everything automatically and when a HID device is inserted, it
120detects it appropriately.
121
122 However, because the devices vary wildly, you might happen to have a
123device that doesn't work well. In that case #define DEBUG at the beginning
124of hid-core.c and send me the syslog traces.
125
1263.1.2 usbmouse
127~~~~~~~~~~~~~~
128 For embedded systems, for mice with broken HID descriptors and just any
129other use when the big usbhid wouldn't be a good choice, there is the
130usbmouse driver. It handles USB mice only. It uses a simpler HIDBP
131protocol. This also means the mice must support this simpler protocol. Not
132all do. If you don't have any strong reason to use this module, use usbhid
133instead.
134
1353.1.3 usbkbd
136~~~~~~~~~~~~
137 Much like usbmouse, this module talks to keyboards with a simplified
138HIDBP protocol. It's smaller, but doesn't support any extra special keys.
139Use usbhid instead if there isn't any special reason to use this.
140
1413.1.4 wacom
142~~~~~~~~~~~
143 This is a driver for Wacom Graphire and Intuos tablets. Not for Wacom
144PenPartner, that one is handled by the HID driver. Although the Intuos and
145Graphire tablets claim that they are HID tablets as well, they are not and
146thus need this specific driver.
147
1483.1.5 iforce
149~~~~~~~~~~~~
150 A driver for I-Force joysticks and wheels, both over USB and RS232.
151It includes ForceFeedback support now, even though Immersion
152Corp. considers the protocol a trade secret and won't disclose a word
153about it.
154
1553.2 Event handlers
156~~~~~~~~~~~~~~~~~~
157 Event handlers distrubite the events from the devices to userland and
158kernel, as needed.
159
1603.2.1 keybdev
161~~~~~~~~~~~~~
162 keybdev is currently a rather ugly hack that translates the input
163events into architecture-specific keyboard raw mode (Xlated AT Set2 on
164x86), and passes them into the handle_scancode function of the
165keyboard.c module. This works well enough on all architectures that
166keybdev can generate rawmode on, other architectures can be added to
167it.
168
169 The right way would be to pass the events to keyboard.c directly,
170best if keyboard.c would itself be an event handler. This is done in
171the input patch, available on the webpage mentioned below.
172
1733.2.2 mousedev
174~~~~~~~~~~~~~~
175 mousedev is also a hack to make programs that use mouse input
176work. It takes events from either mice or digitizers/tablets and makes
177a PS/2-style (a la /dev/psaux) mouse device available to the
178userland. Ideally, the programs could use a more reasonable interface,
179for example evdev
180
181 Mousedev devices in /dev/input (as shown above) are:
182
183 crw-r--r-- 1 root root 13, 32 Mar 28 22:45 mouse0
184 crw-r--r-- 1 root root 13, 33 Mar 29 00:41 mouse1
185 crw-r--r-- 1 root root 13, 34 Mar 29 00:41 mouse2
186 crw-r--r-- 1 root root 13, 35 Apr 1 10:50 mouse3
187 ...
188 ...
189 crw-r--r-- 1 root root 13, 62 Apr 1 10:50 mouse30
190 crw-r--r-- 1 root root 13, 63 Apr 1 10:50 mice
191
192Each 'mouse' device is assigned to a single mouse or digitizer, except
193the last one - 'mice'. This single character device is shared by all
194mice and digitizers, and even if none are connected, the device is
195present. This is useful for hotplugging USB mice, so that programs
196can open the device even when no mice are present.
197
198 CONFIG_INPUT_MOUSEDEV_SCREEN_[XY] in the kernel configuration are
199the size of your screen (in pixels) in XFree86. This is needed if you
200want to use your digitizer in X, because its movement is sent to X
201via a virtual PS/2 mouse and thus needs to be scaled
202accordingly. These values won't be used if you use a mouse only.
203
204 Mousedev will generate either PS/2, ImPS/2 (Microsoft IntelliMouse) or
205ExplorerPS/2 (IntelliMouse Explorer) protocols, depending on what the
206program reading the data wishes. You can set GPM and X to any of
207these. You'll need ImPS/2 if you want to make use of a wheel on a USB
208mouse and ExplorerPS/2 if you want to use extra (up to 5) buttons.
209
2103.2.3 joydev
211~~~~~~~~~~~~
212 Joydev implements v0.x and v1.x Linux joystick api, much like
213drivers/char/joystick/joystick.c used to in earlier versions. See
214joystick-api.txt in the Documentation subdirectory for details. As
215soon as any joystick is connected, it can be accessed in /dev/input
216on:
217
218 crw-r--r-- 1 root root 13, 0 Apr 1 10:50 js0
219 crw-r--r-- 1 root root 13, 1 Apr 1 10:50 js1
220 crw-r--r-- 1 root root 13, 2 Apr 1 10:50 js2
221 crw-r--r-- 1 root root 13, 3 Apr 1 10:50 js3
222 ...
223
224And so on up to js31.
225
2263.2.4 evdev
227~~~~~~~~~~~
228 evdev is the generic input event interface. It passes the events
229generated in the kernel straight to the program, with timestamps. The
230API is still evolving, but should be useable now. It's described in
231section 5.
232
233 This should be the way for GPM and X to get keyboard and mouse mouse
234events. It allows for multihead in X without any specific multihead
235kernel support. The event codes are the same on all architectures and
236are hardware independent.
237
238 The devices are in /dev/input:
239
240 crw-r--r-- 1 root root 13, 64 Apr 1 10:49 event0
241 crw-r--r-- 1 root root 13, 65 Apr 1 10:50 event1
242 crw-r--r-- 1 root root 13, 66 Apr 1 10:50 event2
243 crw-r--r-- 1 root root 13, 67 Apr 1 10:50 event3
244 ...
245
246And so on up to event31.
247
2484. Verifying if it works
249~~~~~~~~~~~~~~~~~~~~~~~~
250 Typing a couple keys on the keyboard should be enough to check that
251a USB keyboard works and is correctly connected to the kernel keyboard
252driver.
253
254 Doing a cat /dev/input/mouse0 (c, 13, 32) will verify that a mouse
255is also emulated, characters should appear if you move it.
256
257 You can test the joystick emulation with the 'jstest' utility,
258available in the joystick package (see Documentation/input/joystick.txt).
259
260 You can test the event devices with the 'evtest' utility available
261in the LinuxConsole project CVS archive (see the URL below).
262
2635. Event interface
264~~~~~~~~~~~~~~~~~~
265 Should you want to add event device support into any application (X, gpm,
266svgalib ...) I <vojtech@ucw.cz> will be happy to provide you any help I
267can. Here goes a description of the current state of things, which is going
268to be extended, but not changed incompatibly as time goes:
269
270 You can use blocking and nonblocking reads, also select() on the
271/dev/input/eventX devices, and you'll always get a whole number of input
272events on a read. Their layout is:
273
274struct input_event {
275 struct timeval time;
276 unsigned short type;
277 unsigned short code;
278 unsigned int value;
279};
280
281 'time' is the timestamp, it returns the time at which the event happened.
282Type is for example EV_REL for relative momement, REL_KEY for a keypress or
283release. More types are defined in include/linux/input.h.
284
285 'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete
286list is in include/linux/input.h.
287
288 'value' is the value the event carries. Either a relative change for
289EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for
290release, 1 for keypress and 2 for autorepeat.
291
2926. Contacts
293~~~~~~~~~~~
294 This effort has its home page at:
295
296 http://www.suse.cz/development/input/
297
298You'll find both the latest HID driver and the complete Input driver
299there as well as information how to access the CVS repository for
300latest revisions of the drivers.
301
302 There is also a mailing list for this:
303
304 majordomo@atrey.karlin.mff.cuni.cz
305
306Send "subscribe linux-input" to subscribe to it.
307
308The input changes are also being worked on as part of the LinuxConsole
309project, see:
310
311 http://sourceforge.net/projects/linuxconsole/
312
diff --git a/Documentation/input/interactive.fig b/Documentation/input/interactive.fig
new file mode 100644
index 000000000000..1e7de387723a
--- /dev/null
+++ b/Documentation/input/interactive.fig
@@ -0,0 +1,42 @@
1#FIG 3.2
2Landscape
3Center
4Inches
5Letter
6100.00
7Single
8-2
91200 2
102 1 0 2 0 7 50 0 -1 6.000 0 0 -1 0 0 6
11 1200 3600 1800 3600 2400 4800 3000 4800 4200 5700 4800 5700
122 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
13 1200 3150 4800 3150 4800 6300 1200 6300 1200 3150
142 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
15 1200 4800 4800 4800
162 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
17 2400 4800 2400 6525 1950 7125 1950 7800
182 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
19 3000 4800 3000 6525 3600 7125 3600 7800
202 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
21 0 0 1.00 60.00 120.00
22 3825 5400 4125 5100 5400 5100
232 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
24 0 0 1.00 60.00 120.00
25 2100 4200 2400 3900 5400 3900
262 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
27 4800 5700 5400 5700
282 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
29 1800 3600 5400 3600
302 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3
31 0 0 1.00 60.00 120.00
32 2700 4800 2700 4425 5400 4425
332 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
34 0 0 1.00 60.00 120.00
35 0 0 1.00 60.00 120.00
36 1950 7800 3600 7800
374 1 0 50 0 0 12 0.0000 4 135 810 2775 7725 Dead band\001
384 0 0 50 0 0 12 0.0000 4 180 1155 5400 5700 right saturation\001
394 0 0 50 0 0 12 0.0000 4 135 1065 5400 3600 left saturation\001
404 0 0 50 0 0 12 0.0000 4 180 2505 5400 3900 left coeff ( positive in that case )\001
414 0 0 50 0 0 12 0.0000 4 180 2640 5475 5100 right coeff ( negative in that case )\001
424 0 0 50 0 0 12 0.0000 4 105 480 5400 4425 center\001
diff --git a/Documentation/input/joystick-api.txt b/Documentation/input/joystick-api.txt
new file mode 100644
index 000000000000..acbd32b88454
--- /dev/null
+++ b/Documentation/input/joystick-api.txt
@@ -0,0 +1,316 @@
1 Joystick API Documentation -*-Text-*-
2
3 Ragnar Hojland Espinosa
4 <ragnar@macula.net>
5
6 7 Aug 1998
7
8 $Id: joystick-api.txt,v 1.2 2001/05/08 21:21:23 vojtech Exp $
9
101. Initialization
11~~~~~~~~~~~~~~~~~
12
13Open the joystick device following the usual semantics (that is, with open).
14Since the driver now reports events instead of polling for changes,
15immediately after the open it will issue a series of synthetic events
16(JS_EVENT_INIT) that you can read to check the initial state of the
17joystick.
18
19By default, the device is opened in blocking mode.
20
21 int fd = open ("/dev/js0", O_RDONLY);
22
23
242. Event Reading
25~~~~~~~~~~~~~~~~
26
27 struct js_event e;
28 read (fd, &e, sizeof(struct js_event));
29
30where js_event is defined as
31
32 struct js_event {
33 __u32 time; /* event timestamp in milliseconds */
34 __s16 value; /* value */
35 __u8 type; /* event type */
36 __u8 number; /* axis/button number */
37 };
38
39If the read is successful, it will return sizeof(struct js_event), unless
40you wanted to read more than one event per read as described in section 3.1.
41
42
432.1 js_event.type
44~~~~~~~~~~~~~~~~~
45
46The possible values of ``type'' are
47
48 #define JS_EVENT_BUTTON 0x01 /* button pressed/released */
49 #define JS_EVENT_AXIS 0x02 /* joystick moved */
50 #define JS_EVENT_INIT 0x80 /* initial state of device */
51
52As mentioned above, the driver will issue synthetic JS_EVENT_INIT ORed
53events on open. That is, if it's issuing a INIT BUTTON event, the
54current type value will be
55
56 int type = JS_EVENT_BUTTON | JS_EVENT_INIT; /* 0x81 */
57
58If you choose not to differentiate between synthetic or real events
59you can turn off the JS_EVENT_INIT bits
60
61 type &= ~JS_EVENT_INIT; /* 0x01 */
62
63
642.2 js_event.number
65~~~~~~~~~~~~~~~~~~~
66
67The values of ``number'' correspond to the axis or button that
68generated the event. Note that they carry separate numeration (that
69is, you have both an axis 0 and a button 0). Generally,
70
71 number
72 1st Axis X 0
73 1st Axis Y 1
74 2nd Axis X 2
75 2nd Axis Y 3
76 ...and so on
77
78Hats vary from one joystick type to another. Some can be moved in 8
79directions, some only in 4, The driver, however, always reports a hat as two
80independent axis, even if the hardware doesn't allow independent movement.
81
82
832.3 js_event.value
84~~~~~~~~~~~~~~~~~~
85
86For an axis, ``value'' is a signed integer between -32767 and +32767
87representing the position of the joystick along that axis. If you
88don't read a 0 when the joystick is `dead', or if it doesn't span the
89full range, you should recalibrate it (with, for example, jscal).
90
91For a button, ``value'' for a press button event is 1 and for a release
92button event is 0.
93
94Though this
95
96 if (js_event.type == JS_EVENT_BUTTON) {
97 buttons_state ^= (1 << js_event.number);
98 }
99
100may work well if you handle JS_EVENT_INIT events separately,
101
102 if ((js_event.type & ~JS_EVENT_INIT) == JS_EVENT_BUTTON) {
103 if (js_event.value)
104 buttons_state |= (1 << js_event.number);
105 else
106 buttons_state &= ~(1 << js_event.number);
107 }
108
109is much safer since it can't lose sync with the driver. As you would
110have to write a separate handler for JS_EVENT_INIT events in the first
111snippet, this ends up being shorter.
112
113
1142.4 js_event.time
115~~~~~~~~~~~~~~~~~
116
117The time an event was generated is stored in ``js_event.time''. It's a time
118in milliseconds since ... well, since sometime in the past. This eases the
119task of detecting double clicks, figuring out if movement of axis and button
120presses happened at the same time, and similar.
121
122
1233. Reading
124~~~~~~~~~~
125
126If you open the device in blocking mode, a read will block (that is,
127wait) forever until an event is generated and effectively read. There
128are two alternatives if you can't afford to wait forever (which is,
129admittedly, a long time;)
130
131 a) use select to wait until there's data to be read on fd, or
132 until it timeouts. There's a good example on the select(2)
133 man page.
134
135 b) open the device in non-blocking mode (O_NONBLOCK)
136
137
1383.1 O_NONBLOCK
139~~~~~~~~~~~~~~
140
141If read returns -1 when reading in O_NONBLOCK mode, this isn't
142necessarily a "real" error (check errno(3)); it can just mean there
143are no events pending to be read on the driver queue. You should read
144all events on the queue (that is, until you get a -1).
145
146For example,
147
148 while (1) {
149 while (read (fd, &e, sizeof(struct js_event)) > 0) {
150 process_event (e);
151 }
152 /* EAGAIN is returned when the queue is empty */
153 if (errno != EAGAIN) {
154 /* error */
155 }
156 /* do something interesting with processed events */
157 }
158
159One reason for emptying the queue is that if it gets full you'll start
160missing events since the queue is finite, and older events will get
161overwritten.
162
163The other reason is that you want to know all what happened, and not
164delay the processing till later.
165
166Why can get the queue full? Because you don't empty the queue as
167mentioned, or because too much time elapses from one read to another
168and too many events to store in the queue get generated. Note that
169high system load may contribute to space those reads even more.
170
171If time between reads is enough to fill the queue and lose an event,
172the driver will switch to startup mode and next time you read it,
173synthetic events (JS_EVENT_INIT) will be generated to inform you of
174the actual state of the joystick.
175
176[As for version 1.2.8, the queue is circular and able to hold 64
177 events. You can increment this size bumping up JS_BUFF_SIZE in
178 joystick.h and recompiling the driver.]
179
180
181In the above code, you might as well want to read more than one event
182at a time using the typical read(2) functionality. For that, you would
183replace the read above with something like
184
185 struct js_event mybuffer[0xff];
186 int i = read (fd, mybuffer, sizeof(struct mybuffer));
187
188In this case, read would return -1 if the queue was empty, or some
189other value in which the number of events read would be i /
190sizeof(js_event) Again, if the buffer was full, it's a good idea to
191process the events and keep reading it until you empty the driver queue.
192
193
1944. IOCTLs
195~~~~~~~~~
196
197The joystick driver defines the following ioctl(2) operations.
198
199 /* function 3rd arg */
200 #define JSIOCGAXES /* get number of axes char */
201 #define JSIOCGBUTTONS /* get number of buttons char */
202 #define JSIOCGVERSION /* get driver version int */
203 #define JSIOCGNAME(len) /* get identifier string char */
204 #define JSIOCSCORR /* set correction values &js_corr */
205 #define JSIOCGCORR /* get correction values &js_corr */
206
207For example, to read the number of axes
208
209 char number_of_axes;
210 ioctl (fd, JSIOCGAXES, &number_of_axes);
211
212
2134.1 JSIOGCVERSION
214~~~~~~~~~~~~~~~~~
215
216JSIOGCVERSION is a good way to check in run-time whether the running
217driver is 1.0+ and supports the event interface. If it is not, the
218IOCTL will fail. For a compile-time decision, you can test the
219JS_VERSION symbol
220
221 #ifdef JS_VERSION
222 #if JS_VERSION > 0xsomething
223
224
2254.2 JSIOCGNAME
226~~~~~~~~~~~~~~
227
228JSIOCGNAME(len) allows you to get the name string of the joystick - the same
229as is being printed at boot time. The 'len' argument is the length of the
230buffer provided by the application asking for the name. It is used to avoid
231possible overrun should the name be too long.
232
233 char name[128];
234 if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
235 strncpy(name, "Unknown", sizeof(name));
236 printf("Name: %s\n", name);
237
238
2394.3 JSIOC[SG]CORR
240~~~~~~~~~~~~~~~~~
241
242For usage on JSIOC[SG]CORR I suggest you to look into jscal.c They are
243not needed in a normal program, only in joystick calibration software
244such as jscal or kcmjoy. These IOCTLs and data types aren't considered
245to be in the stable part of the API, and therefore may change without
246warning in following releases of the driver.
247
248Both JSIOCSCORR and JSIOCGCORR expect &js_corr to be able to hold
249information for all axis. That is, struct js_corr corr[MAX_AXIS];
250
251struct js_corr is defined as
252
253 struct js_corr {
254 __s32 coef[8];
255 __u16 prec;
256 __u16 type;
257 };
258
259and ``type''
260
261 #define JS_CORR_NONE 0x00 /* returns raw values */
262 #define JS_CORR_BROKEN 0x01 /* broken line */
263
264
2655. Backward compatibility
266~~~~~~~~~~~~~~~~~~~~~~~~~
267
268The 0.x joystick driver API is quite limited and its usage is deprecated.
269The driver offers backward compatibility, though. Here's a quick summary:
270
271 struct JS_DATA_TYPE js;
272 while (1) {
273 if (read (fd, &js, JS_RETURN) != JS_RETURN) {
274 /* error */
275 }
276 usleep (1000);
277 }
278
279As you can figure out from the example, the read returns immediately,
280with the actual state of the joystick.
281
282 struct JS_DATA_TYPE {
283 int buttons; /* immediate button state */
284 int x; /* immediate x axis value */
285 int y; /* immediate y axis value */
286 };
287
288and JS_RETURN is defined as
289
290 #define JS_RETURN sizeof(struct JS_DATA_TYPE)
291
292To test the state of the buttons,
293
294 first_button_state = js.buttons & 1;
295 second_button_state = js.buttons & 2;
296
297The axis values do not have a defined range in the original 0.x driver,
298except for that the values are non-negative. The 1.2.8+ drivers use a
299fixed range for reporting the values, 1 being the minimum, 128 the
300center, and 255 maximum value.
301
302The v0.8.0.2 driver also had an interface for 'digital joysticks', (now
303called Multisystem joysticks in this driver), under /dev/djsX. This driver
304doesn't try to be compatible with that interface.
305
306
3076. Final Notes
308~~~~~~~~~~~~~~
309
310____/| Comments, additions, and specially corrections are welcome.
311\ o.O| Documentation valid for at least version 1.2.8 of the joystick
312 =(_)= driver and as usual, the ultimate source for documentation is
313 U to "Use The Source Luke" or, at your convenience, Vojtech ;)
314
315 - Ragnar
316EOF
diff --git a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt
new file mode 100644
index 000000000000..88a011c9f985
--- /dev/null
+++ b/Documentation/input/joystick-parport.txt
@@ -0,0 +1,542 @@
1 Linux Joystick parport drivers v2.0
2 (c) 1998-2000 Vojtech Pavlik <vojtech@ucw.cz>
3 (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de>
4 Sponsored by SuSE
5 $Id: joystick-parport.txt,v 1.6 2001/09/25 09:31:32 vojtech Exp $
6----------------------------------------------------------------------------
7
80. Disclaimer
9~~~~~~~~~~~~~
10 Any information in this file is provided as-is, without any guarantee that
11it will be true. So, use it at your own risk. The possible damages that can
12happen include burning your parallel port, and/or the sticks and joystick
13and maybe even more. Like when a lightning kills you it is not our problem.
14
151. Intro
16~~~~~~~~
17 The joystick parport drivers are used for joysticks and gamepads not
18originally designed for PCs and other computers Linux runs on. Because of
19that, PCs usually lack the right ports to connect these devices to. Parallel
20port, because of its ability to change single bits at will, and providing
21both output and input bits is the most suitable port on the PC for
22connecting such devices.
23
242. Devices supported
25~~~~~~~~~~~~~~~~~~~~
26 Many console and 8-bit computer gamepads and joysticks are supported. The
27following subsections discuss usage of each.
28
292.1 NES and SNES
30~~~~~~~~~~~~~~~~
31 The Nintendo Entertainment System and Super Nintendo Entertainment System
32gamepads are widely available, and easy to get. Also, they are quite easy to
33connect to a PC, and don't need much processing speed (108 us for NES and
34165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
35with them.
36
37 All NES and SNES use the same synchronous serial protocol, clocked from
38the computer's side (and thus timing insensitive). To allow up to 5 NES
39and/or SNES gamepads connected to the parallel port at once, the output
40lines of the parallel port are shared, while one of 5 available input lines
41is assigned to each gamepad.
42
43 This protocol is handled by the gamecon.c driver, so that's the one
44you'll use for NES and SNES gamepads.
45
46 The main problem with PC parallel ports is that they don't have +5V power
47source on any of their pins. So, if you want a reliable source of power
48for your pads, use either keyboard or joystick port, and make a pass-through
49cable. You can also pull the power directly from the power supply (the red
50wire is +5V).
51
52 If you want to use the parallel port only, you can take the power is from
53some data pin. For most gamepad and parport implementations only one pin is
54needed, and I'd recommend pin 9 for that, the highest data bit. On the other
55hand, if you are not planning to use anything else than NES / SNES on the
56port, anything between and including pin 4 and pin 9 will work.
57
58(pin 9) -----> Power
59
60 Unfortunately, there are pads that need a lot more of power, and parallel
61ports that can't give much current through the data pins. If this is your
62case, you'll need to use diodes (as a prevention of destroying your parallel
63port), and combine the currents of two or more data bits together.
64
65 Diodes
66(pin 9) ----|>|-------+------> Power
67 |
68(pin 8) ----|>|-------+
69 |
70(pin 7) ----|>|-------+
71 |
72 <and so on> :
73 |
74(pin 4) ----|>|-------+
75
76 Ground is quite easy. On PC's parallel port the ground is on any of the
77pins from pin 18 to pin 25. So use any pin of these you like for the ground.
78
79(pin 18) -----> Ground
80
81 NES and SNES pads have two input bits, Clock and Latch, which drive the
82serial transfer. These are connected to pins 2 and 3 of the parallel port,
83respectively.
84
85(pin 2) -----> Clock
86(pin 3) -----> Latch
87
88 And the last thing is the NES / SNES data wire. Only that isn't shared and
89each pad needs its own data pin. The parallel port pins are:
90
91(pin 10) -----> Pad 1 data
92(pin 11) -----> Pad 2 data
93(pin 12) -----> Pad 3 data
94(pin 13) -----> Pad 4 data
95(pin 15) -----> Pad 5 data
96
97 Note that pin 14 is not used, since it is not an input pin on the parallel
98port.
99
100 This is everything you need on the PC's side of the connection, now on to
101the gamepads side. The NES and SNES have different connectors. Also, there
102are quite a lot of NES clones, and because Nintendo used proprietary
103connectors for their machines, the cloners couldn't and used standard D-Cannon
104connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
105A, Turbo B, Select and Start, and is connected through 5 wires, then it is
106either a NES or NES clone and will work with this connection. SNES gamepads
107also use 5 wires, but have more buttons. They will work as well, of course.
108
109Pinout for NES gamepads Pinout for SNES gamepads
110
111 +----> Power +-----------------------\
112 | 7 | o o o o | x x o | 1
113 5 +---------+ 7 +-----------------------/
114 | x x o \ | | | | |
115 | o o o o | | | | | +-> Ground
116 4 +------------+ 1 | | | +------------> Data
117 | | | | | | +---------------> Latch
118 | | | +-> Ground | +------------------> Clock
119 | | +----> Clock +---------------------> Power
120 | +-------> Latch
121 +----------> Data
122
123Pinout for NES clone (db9) gamepads Pinout for NES clone (db15) gamepads
124
125 +---------> Clock +-----------------> Data
126 | +-------> Latch | +---> Ground
127 | | +-----> Data | |
128 | | | ___________________
129 _____________ 8 \ o x x x x x x o / 1
130 5 \ x o o o x / 1 \ o x x o x x o /
131 \ x o x o / 15 `~~~~~~~~~~~~~' 9
132 9 `~~~~~~~' 6 | | |
133 | | | | +----> Clock
134 | +----> Power | +----------> Latch
135 +--------> Ground +----------------> Power
136
1372.2 Multisystem joysticks
138~~~~~~~~~~~~~~~~~~~~~~~~~
139 In the era of 8-bit machines, there was something like de-facto standard
140for joystick ports. They were all digital, and all used D-Cannon 9 pin
141connectors (db9). Because of that, a single joystick could be used without
142hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
143Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
144joysticks are called "Multisystem".
145
146 Now their pinout:
147
148 +---------> Right
149 | +-------> Left
150 | | +-----> Down
151 | | | +---> Up
152 | | | |
153 _____________
1545 \ x o o o o / 1
155 \ x o x o /
156 9 `~~~~~~~' 6
157 | |
158 | +----> Button
159 +--------> Ground
160
161 However, as time passed, extensions to this standard developed, and these
162were not compatible with each other:
163
164
165 Atari 130, 800/XL/XE MSX
166
167 +-----------> Power
168 +---------> Right | +---------> Right
169 | +-------> Left | | +-------> Left
170 | | +-----> Down | | | +-----> Down
171 | | | +---> Up | | | | +---> Up
172 | | | | | | | | |
173 _____________ _____________
1745 \ x o o o o / 1 5 \ o o o o o / 1
175 \ x o o o / \ o o o o /
176 9 `~~~~~~~' 6 9 `~~~~~~~' 6
177 | | | | | | |
178 | | +----> Button | | | +----> Button 1
179 | +------> Power | | +------> Button 2
180 +--------> Ground | +--------> Output 3
181 +----------> Ground
182
183 Amstrad CPC Commodore C64
184
185 +-----------> Analog Y
186 +---------> Right | +---------> Right
187 | +-------> Left | | +-------> Left
188 | | +-----> Down | | | +-----> Down
189 | | | +---> Up | | | | +---> Up
190 | | | | | | | | |
191 _____________ _____________
1925 \ x o o o o / 1 5 \ o o o o o / 1
193 \ x o o o / \ o o o o /
194 9 `~~~~~~~' 6 9 `~~~~~~~' 6
195 | | | | | | |
196 | | +----> Button 1 | | | +----> Button
197 | +------> Button 2 | | +------> Power
198 +--------> Ground | +--------> Ground
199 +----------> Analog X
200
201 Sinclair Spectrum +2A/+3 Amiga 1200
202
203 +-----------> Up +-----------> Button 3
204 | +---------> Fire | +---------> Right
205 | | | | +-------> Left
206 | | +-----> Ground | | | +-----> Down
207 | | | | | | | +---> Up
208 | | | | | | | |
209 _____________ _____________
2105 \ o o x o x / 1 5 \ o o o o o / 1
211 \ o o o o / \ o o o o /
212 9 `~~~~~~~' 6 9 `~~~~~~~' 6
213 | | | | | | | |
214 | | | +----> Right | | | +----> Button 1
215 | | +------> Left | | +------> Power
216 | +--------> Ground | +--------> Ground
217 +----------> Down +----------> Button 2
218
219 And there were many others.
220
2212.2.1 Multisystem joysticks using db9.c
222~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223 For the Multisystem joysticks, and their derivatives, the db9.c driver
224was written. It allows only one joystick / gamepad per parallel port, but
225the interface is easy to build and works with almost anything.
226
227 For the basic 1-button Multisystem joystick you connect its wires to the
228parallel port like this:
229
230(pin 1) -----> Power
231(pin 18) -----> Ground
232
233(pin 2) -----> Up
234(pin 3) -----> Down
235(pin 4) -----> Left
236(pin 5) -----> Right
237(pin 6) -----> Button 1
238
239 However, if the joystick is switch based (eg. clicks when you move it),
240you might or might not, depending on your parallel port, need 10 kOhm pullup
241resistors on each of the direction and button signals, like this:
242
243(pin 2) ------------+------> Up
244 Resistor |
245(pin 1) --[10kOhm]--+
246
247 Try without, and if it doesn't work, add them. For TTL based joysticks /
248gamepads the pullups are not needed.
249
250 For joysticks with two buttons you connect the second button to pin 7 on
251the parallel port.
252
253(pin 7) -----> Button 2
254
255 And that's it.
256
257 On a side note, if you have already built a different adapter for use with
258the digital joystick driver 0.8.0.2, this is also supported by the db9.c
259driver, as device type 8. (See section 3.2)
260
2612.2.2 Multisystem joysticks using gamecon.c
262~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263 For some people just one joystick per parallel port is not enough, and/or
264want to use them on one parallel port together with NES/SNES/PSX pads. This is
265possible using the gamecon.c. It supports up to 5 devices of the above types,
266including 1 and 2 buttons Multisystem joysticks.
267
268 However, there is nothing for free. To allow more sticks to be used at
269once, you need the sticks to be purely switch based (that is non-TTL), and
270not to need power. Just a plain simple six switches inside. If your
271joystick can do more (eg. turbofire) you'll need to disable it totally first
272if you want to use gamecon.c.
273
274 Also, the connection is a bit more complex. You'll need a bunch of diodes,
275and one pullup resistor. First, you connect the Directions and the button
276the same as for db9, however with the diodes inbetween.
277
278 Diodes
279(pin 2) -----|<|----> Up
280(pin 3) -----|<|----> Down
281(pin 4) -----|<|----> Left
282(pin 5) -----|<|----> Right
283(pin 6) -----|<|----> Button 1
284
285 For two button sticks you also connect the other button.
286
287(pin 7) -----|<|----> Button 2
288
289 And finally, you connect the Ground wire of the joystick, like done in
290this little schematic to Power and Data on the parallel port, as described
291for the NES / SNES pads in section 2.1 of this file - that is, one data pin
292for each joystick. The power source is shared.
293
294Data ------------+-----> Ground
295 Resistor |
296Power --[10kOhm]--+
297
298 And that's all, here we go!
299
3002.2.3 Multisystem joysticks using turbografx.c
301~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302 The TurboGraFX interface, designed by
303
304 Steffen Schwenke <schwenke@burg-halle.de>
305
306 allows up to 7 Multisystem joysticks connected to the parallel port. In
307Steffen's version, there is support for up to 5 buttons per joystick. However,
308since this doesn't work reliably on all parallel ports, the turbografx.c driver
309supports only one button per joystick. For more information on how to build the
310interface, see
311
312 http://www2.burg-halle.de/~schwenke/parport.html
313
3142.3 Sony Playstation
315~~~~~~~~~~~~~~~~~~~~
316
317 The PSX controller is supported by the gamecon.c. Pinout of the PSX
318controller (compatible with DirectPadPro):
319
320 +---------+---------+---------+
3219 | o o o | o o o | o o o | 1 parallel
322 \________|_________|________/ port pins
323 | | | | | |
324 | | | | | +--------> Clock --- (4)
325 | | | | +------------> Select --- (3)
326 | | | +---------------> Power --- (5-9)
327 | | +------------------> Ground --- (18-25)
328 | +-------------------------> Command --- (2)
329 +----------------------------> Data --- (one of 10,11,12,13,15)
330
331 The driver supports these controllers:
332
333 * Standard PSX Pad
334 * NegCon PSX Pad
335 * Analog PSX Pad (red mode)
336 * Analog PSX Pad (green mode)
337 * PSX Rumble Pad
338 * PSX DDR Pad
339
3402.4 Sega
341~~~~~~~~
342 All the Sega controllers are more or less based on the standard 2-button
343Multisystem joystick. However, since they don't use switches and use TTL
344logic, the only driver usable with them is the db9.c driver.
345
3462.4.1 Sega Master System
347~~~~~~~~~~~~~~~~~~~~~~~~
348 The SMS gamepads are almost exactly the same as normal 2-button
349Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
350parallel port pins, and the following schematic:
351
352 +-----------> Power
353 | +---------> Right
354 | | +-------> Left
355 | | | +-----> Down
356 | | | | +---> Up
357 | | | | |
358 _____________
3595 \ o o o o o / 1
360 \ o o x o /
361 9 `~~~~~~~' 6
362 | | |
363 | | +----> Button 1
364 | +--------> Ground
365 +----------> Button 2
366
3672.4.2 Sega Genesis aka MegaDrive
368~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369 The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
370to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1). Use
371the following schematic:
372
373 +-----------> Power
374 | +---------> Right
375 | | +-------> Left
376 | | | +-----> Down
377 | | | | +---> Up
378 | | | | |
379 _____________
3805 \ o o o o o / 1
381 \ o o o o /
382 9 `~~~~~~~' 6
383 | | | |
384 | | | +----> Button 1
385 | | +------> Select
386 | +--------> Ground
387 +----------> Button 2
388
389 The Select pin goes to pin 14 on the parallel port.
390
391(pin 14) -----> Select
392
393 The rest is the same as for Multi2 joysticks using db9.c
394
3952.4.3 Sega Saturn
396~~~~~~~~~~~~~~~~~
397 Sega Saturn has eight buttons, and to transfer that, without hacks like
398Genesis 6 pads use, it needs one more select pin. Anyway, it is still
399handled by the db9.c driver. Its pinout is very different from anything
400else. Use this schematic:
401
402 +-----------> Select 1
403 | +---------> Power
404 | | +-------> Up
405 | | | +-----> Down
406 | | | | +---> Ground
407 | | | | |
408 _____________
4095 \ o o o o o / 1
410 \ o o o o /
411 9 `~~~~~~~' 6
412 | | | |
413 | | | +----> Select 2
414 | | +------> Right
415 | +--------> Left
416 +----------> Power
417
418 Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
419parallel port.
420
421(pin 14) -----> Select 1
422(pin 16) -----> Select 2
423
424 The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
425Multi joysticks using db9.c
426
4273. The drivers
428~~~~~~~~~~~~~~
429 There are three drivers for the parallel port interfaces. Each, as
430described above, allows to connect a different group of joysticks and pads.
431Here are described their command lines:
432
4333.1 gamecon.c
434~~~~~~~~~~~~~
435 Using gamecon.c you can connect up to five devices to one parallel port. It
436uses the following kernel/module command line:
437
438 gamecon.map=port,pad1,pad2,pad3,pad4,pad5
439
440 Where 'port' the number of the parport interface (eg. 0 for parport0).
441
442 And 'pad1' to 'pad5' are pad types connected to different data input pins
443(10,11,12,13,15), as described in section 2.1 of this file.
444
445 The types are:
446
447 Type | Joystick/Pad
448 --------------------
449 0 | None
450 1 | SNES pad
451 2 | NES pad
452 4 | Multisystem 1-button joystick
453 5 | Multisystem 2-button joystick
454 6 | N64 pad
455 7 | Sony PSX controller
456 8 | Sony PSX DDR controller
457
458 The exact type of the PSX controller type is autoprobed when used so
459hot swapping should work (but is not recomended).
460
461 Should you want to use more than one of parallel ports at once, you can use
462gamecon.map2 and gamecon.map3 as additional command line parameters for two
463more parallel ports.
464
465 There are two options specific to PSX driver portion. gamecon.psx_delay sets
466the command delay when talking to the controllers. The default of 25 should
467work but you can try lowering it for better performace. If your pads don't
468respond try raising it untill they work. Setting the type to 8 allows the
469driver to be used with Dance Dance Revolution or similar games. Arrow keys are
470registered as key presses instead of X and Y axes.
471
4723.2 db9.c
473~~~~~~~~~
474 Apart from making an interface, there is nothing difficult on using the
475db9.c driver. It uses the following kernel/module command line:
476
477 db9.dev=port,type
478
479 Where 'port' is the number of the parport interface (eg. 0 for parport0).
480
481 Caveat here: This driver only works on bidirectional parallel ports. If
482your parallel port is recent enough, you should have no trouble with this.
483Old parallel ports may not have this feature.
484
485 'Type' is the type of joystick or pad attached:
486
487 Type | Joystick/Pad
488 --------------------
489 0 | None
490 1 | Multisystem 1-button joystick
491 2 | Multisystem 2-button joystick
492 3 | Genesis pad (3+1 buttons)
493 5 | Genesis pad (5+1 buttons)
494 6 | Genesis pad (6+2 buttons)
495 7 | Saturn pad (8 buttons)
496 8 | Multisystem 1-button joystick (v0.8.0.2 pin-out)
497 9 | Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
498 10 | Amiga CD32 pad
499
500 Should you want to use more than one of these joysticks/pads at once, you
501can use db9.dev2 and db9.dev3 as additional command line parameters for two
502more joysticks/pads.
503
5043.3 turbografx.c
505~~~~~~~~~~~~~~~~
506 The turbografx.c driver uses a very simple kernel/module command line:
507
508 turbografx.map=port,js1,js2,js3,js4,js5,js6,js7
509
510 Where 'port' is the number of the parport interface (eg. 0 for parport0).
511
512 'jsX' is the number of buttons the Multisystem joysticks connected to the
513interface ports 1-7 have. For a standard multisystem joystick, this is 1.
514
515 Should you want to use more than one of these interfaces at once, you can
516use turbografx.map2 and turbografx.map3 as additional command line parameters
517for two more interfaces.
518
5193.4 PC parallel port pinout
520~~~~~~~~~~~~~~~~~~~~~~~~~~~
521 .----------------------------------------.
522 At the PC: \ 13 12 11 10 9 8 7 6 5 4 3 2 1 /
523 \ 25 24 23 22 21 20 19 18 17 16 15 14 /
524 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525
526 Pin | Name | Description
527 ~~~~~~|~~~~~~~~~|~~~~~~~~~~
528 1 | /STROBE | Strobe
529 2-9 | D0-D7 | Data Bit 0-7
530 10 | /ACK | Acknowledge
531 11 | BUSY | Busy
532 12 | PE | Paper End
533 13 | SELIN | Select In
534 14 | /AUTOFD | Autofeed
535 15 | /ERROR | Error
536 16 | /INIT | Initialize
537 17 | /SEL | Select
538 18-25 | GND | Signal Ground
539
5403.5 End
541~~~~~~~
542 That's all, folks! Have fun!
diff --git a/Documentation/input/joystick.txt b/Documentation/input/joystick.txt
new file mode 100644
index 000000000000..d53b857a3710
--- /dev/null
+++ b/Documentation/input/joystick.txt
@@ -0,0 +1,588 @@
1 Linux Joystick driver v2.0.0
2 (c) 1996-2000 Vojtech Pavlik <vojtech@ucw.cz>
3 Sponsored by SuSE
4 $Id: joystick.txt,v 1.12 2002/03/03 12:13:07 jdeneux Exp $
5----------------------------------------------------------------------------
6
70. Disclaimer
8~~~~~~~~~~~~~
9 This program is free software; you can redistribute it and/or modify it
10under the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 2 of the License, or (at your option)
12any later version.
13
14 This program is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17more details.
18
19 You should have received a copy of the GNU General Public License along
20with this program; if not, write to the Free Software Foundation, Inc., 59
21Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
23 Should you need to contact me, the author, you can do so either by e-mail
24- mail your message to <vojtech@ucw.cz>, or by paper mail: Vojtech Pavlik,
25Simunkova 1594, Prague 8, 182 00 Czech Republic
26
27 For your convenience, the GNU General Public License version 2 is included
28in the package: See the file COPYING.
29
301. Intro
31~~~~~~~~
32 The joystick driver for Linux provides support for a variety of joysticks
33and similar devices. It is based on a larger project aiming to support all
34input devices in Linux.
35
36 Should you encounter any problems while using the driver, or joysticks
37this driver can't make complete use of, I'm very interested in hearing about
38them. Bug reports and success stories are also welcome.
39
40 The input project website is at:
41
42 http://www.suse.cz/development/input/
43 http://atrey.karlin.mff.cuni.cz/~vojtech/input/
44
45 There is also a mailing list for the driver at:
46
47 listproc@atrey.karlin.mff.cuni.cz
48
49send "subscribe linux-joystick Your Name" to subscribe to it.
50
512. Usage
52~~~~~~~~
53 For basic usage you just choose the right options in kernel config and
54you should be set.
55
562.1 inpututils
57~~~~~~~~~~~~~~
58For testing and other purposes (for example serial devices), a set of
59utilities is available at the abovementioned website. I suggest you download
60and install it before going on.
61
622.2 Device nodes
63~~~~~~~~~~~~~~~~
64For applications to be able to use the joysticks, in you don't use devfs,
65you'll have to manually create these nodes in /dev:
66
67cd /dev
68rm js*
69mkdir input
70mknod input/js0 c 13 0
71mknod input/js1 c 13 1
72mknod input/js2 c 13 2
73mknod input/js3 c 13 3
74ln -s input/js0 js0
75ln -s input/js1 js1
76ln -s input/js2 js2
77ln -s input/js3 js3
78
79For testing with inpututils it's also convenient to create these:
80
81mknod input/event0 c 13 64
82mknod input/event1 c 13 65
83mknod input/event2 c 13 66
84mknod input/event3 c 13 67
85
862.4 Modules needed
87~~~~~~~~~~~~~~~~~~
88 For all joystick drivers to function, you'll need the userland interface
89module in kernel, either loaded or compiled in:
90
91 modprobe joydev
92
93 For gameport joysticks, you'll have to load the gameport driver as well;
94
95 modprobe ns558
96
97 And for serial port joysticks, you'll need the serial input line
98discipline module loaded and the inputattach utility started:
99
100 modprobe serport
101 inputattach -xxx /dev/tts/X &
102
103 In addition to that, you'll need the joystick driver module itself, most
104usually you'll have an analog joystick:
105
106 modprobe analog
107
108 For automatic module loading, something like this might work - tailor to
109your needs:
110
111 alias tty-ldisc-2 serport
112 alias char-major-13 input
113 above input joydev ns558 analog
114 options analog map=gamepad,none,2btn
115
1162.5 Verifying that it works
117~~~~~~~~~~~~~~~~~~~~~~~~~~~
118 For testing the joystick driver functionality, there is the jstest
119program in the utilities package. You run it by typing:
120
121 jstest /dev/js0
122
123 And it should show a line with the joystick values, which update as you
124move the stick, and press its buttons. The axes should all be zero when the
125joystick is in the center position. They should not jitter by themselves to
126other close values, and they also should be steady in any other position of
127the stick. They should have the full range from -32767 to 32767. If all this
128is met, then it's all fine, and you can play the games. :)
129
130 If it's not, then there might be a problem. Try to calibrate the joystick,
131and if it still doesn't work, read the drivers section of this file, the
132troubleshooting section, and the FAQ.
133
1342.6. Calibration
135~~~~~~~~~~~~~~~~
136 For most joysticks you won't need any manual calibration, since the
137joystick should be autocalibrated by the driver automagically. However, with
138some analog joysticks, that either do not use linear resistors, or if you
139want better precision, you can use the jscal program
140
141 jscal -c /dev/js0
142
143 included in the joystick package to set better correction coefficients than
144what the driver would choose itself.
145
146 After calibrating the joystick you can verify if you like the new
147calibration using the jstest command, and if you do, you then can save the
148correction coefficients into a file
149
150 jscal -p /dev/js0 > /etc/joystick.cal
151
152 And add a line to your rc script executing that file
153
154 source /etc/joystick.cal
155
156 This way, after the next reboot your joystick will remain calibrated. You
157can also add the jscal -p line to your shutdown script.
158
159
1603. HW specific driver information
161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162In this section each of the separate hardware specific drivers is described.
163
1643.1 Analog joysticks
165~~~~~~~~~~~~~~~~~~~~
166 The analog.c uses the standard analog inputs of the gameport, and thus
167supports all standard joysticks and gamepads. It uses a very advanced
168routine for this, allowing for data precision that can't be found on any
169other system.
170
171 It also supports extensions like additional hats and buttons compatible
172with CH Flightstick Pro, ThrustMaster FCS or 6 and 8 button gamepads. Saitek
173Cyborg 'digital' joysticks are also supported by this driver, because
174they're basically souped up CHF sticks.
175
176 However the only types that can be autodetected are:
177
178* 2-axis, 4-button joystick
179* 3-axis, 4-button joystick
180* 4-axis, 4-button joystick
181* Saitek Cyborg 'digital' joysticks
182
183 For other joystick types (more/less axes, hats, and buttons) support
184you'll need to specify the types either on the kernel command line or on the
185module command line, when inserting analog into the kernel. The
186parameters are:
187
188 analog.map=<type1>,<type2>,<type3>,....
189
190 'type' is type of the joystick from the table below, defining joysticks
191present on gameports in the system, starting with gameport0, second 'type'
192entry defining joystick on gameport1 and so on.
193
194 Type | Meaning
195 -----------------------------------
196 none | No analog joystick on that port
197 auto | Autodetect joystick
198 2btn | 2-button n-axis joystick
199 y-joy | Two 2-button 2-axis joysticks on an Y-cable
200 y-pad | Two 2-button 2-axis gamepads on an Y-cable
201 fcs | Thrustmaster FCS compatible joystick
202 chf | Joystick with a CH Flightstick compatible hat
203 fullchf | CH Flightstick compatible with two hats and 6 buttons
204 gamepad | 4/6-button n-axis gamepad
205 gamepad8 | 8-button 2-axis gamepad
206
207 In case your joystick doesn't fit in any of the above categories, you can
208specify the type as a number by combining the bits in the table below. This
209is not recommended unless you really know what are you doing. It's not
210dangerous, but not simple either.
211
212 Bit | Meaning
213 --------------------------
214 0 | Axis X1
215 1 | Axis Y1
216 2 | Axis X2
217 3 | Axis Y2
218 4 | Button A
219 5 | Button B
220 6 | Button C
221 7 | Button D
222 8 | CHF Buttons X and Y
223 9 | CHF Hat 1
224 10 | CHF Hat 2
225 11 | FCS Hat
226 12 | Pad Button X
227 13 | Pad Button Y
228 14 | Pad Button U
229 15 | Pad Button V
230 16 | Saitek F1-F4 Buttons
231 17 | Saitek Digital Mode
232 19 | GamePad
233 20 | Joy2 Axis X1
234 21 | Joy2 Axis Y1
235 22 | Joy2 Axis X2
236 23 | Joy2 Axis Y2
237 24 | Joy2 Button A
238 25 | Joy2 Button B
239 26 | Joy2 Button C
240 27 | Joy2 Button D
241 31 | Joy2 GamePad
242
2433.2 Microsoft SideWinder joysticks
244~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
245 Microsoft 'Digital Overdrive' protocol is supported by the sidewinder.c
246module. All currently supported joysticks:
247
248* Microsoft SideWinder 3D Pro
249* Microsoft SideWinder Force Feedback Pro
250* Microsoft SideWinder Force Feedback Wheel
251* Microsoft SideWinder FreeStyle Pro
252* Microsoft SideWinder GamePad (up to four, chained)
253* Microsoft SideWinder Precision Pro
254* Microsoft SideWinder Precision Pro USB
255
256 are autodetected, and thus no module parameters are needed.
257
258 There is one caveat with the 3D Pro. There are 9 buttons reported,
259although the joystick has only 8. The 9th button is the mode switch on the
260rear side of the joystick. However, moving it, you'll reset the joystick,
261and make it unresponsive for about a one third of a second. Furthermore, the
262joystick will also re-center itself, taking the position it was in during
263this time as a new center position. Use it if you want, but think first.
264
265 The SideWinder Standard is not a digital joystick, and thus is supported
266by the analog driver described above.
267
2683.3 Logitech ADI devices
269~~~~~~~~~~~~~~~~~~~~~~~~
270 Logitech ADI protocol is supported by the adi.c module. It should support
271any Logitech device using this protocol. This includes, but is not limited
272to:
273
274* Logitech CyberMan 2
275* Logitech ThunderPad Digital
276* Logitech WingMan Extreme Digital
277* Logitech WingMan Formula
278* Logitech WingMan Interceptor
279* Logitech WingMan GamePad
280* Logitech WingMan GamePad USB
281* Logitech WingMan GamePad Extreme
282* Logitech WingMan Extreme Digital 3D
283
284 ADI devices are autodetected, and the driver supports up to two (any
285combination of) devices on a single gameport, using an Y-cable or chained
286together.
287
288 Logitech WingMan Joystick, Logitech WingMan Attack, Logitech WingMan
289Extreme and Logitech WingMan ThunderPad are not digital joysticks and are
290handled by the analog driver described above. Logitech WingMan Warrior and
291Logitech Magellan are supported by serial drivers described below. Logitech
292WingMan Force and Logitech WingMan Formula Force are supported by the
293I-Force driver described below. Logitech CyberMan is not supported yet.
294
2953.4 Gravis GrIP
296~~~~~~~~~~~~~~~
297 Gravis GrIP protocol is supported by the grip.c module. It currently
298supports:
299
300* Gravis GamePad Pro
301* Gravis BlackHawk Digital
302* Gravis Xterminator
303* Gravis Xterminator DualControl
304
305 All these devices are autodetected, and you can even use any combination
306of up to two of these pads either chained together or using an Y-cable on a
307single gameport.
308
309GrIP MultiPort isn't supported yet. Gravis Stinger is a serial device and is
310supported by the stinger driver. Other Gravis joysticks are supported by the
311analog driver.
312
3133.5 FPGaming A3D and MadCatz A3D
314~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315 The Assassin 3D protocol created by FPGaming, is used both by FPGaming
316themselves and is licensed to MadCatz. A3D devices are supported by the
317a3d.c module. It currently supports:
318
319* FPGaming Assassin 3D
320* MadCatz Panther
321* MadCatz Panther XL
322
323 All these devices are autodetected. Because the Assassin 3D and the Panther
324allow connecting analog joysticks to them, you'll need to load the analog
325driver as well to handle the attached joysticks.
326
327 The trackball should work with USB mousedev module as a normal mouse. See
328the USB documentation for how to setup an USB mouse.
329
3303.6 ThrustMaster DirectConnect (BSP)
331~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332 The TM DirectConnect (BSP) protocol is supported by the tmdc.c
333module. This includes, but is not limited to:
334
335* ThrustMaster Millenium 3D Inceptor
336* ThrustMaster 3D Rage Pad
337* ThrustMaster Fusion Digital Game Pad
338
339 Devices not directly supported, but hopefully working are:
340
341* ThrustMaster FragMaster
342* ThrustMaster Attack Throttle
343
344 If you have one of these, contact me.
345
346 TMDC devices are autodetected, and thus no parameters to the module
347are needed. Up to two TMDC devices can be connected to one gameport, using
348an Y-cable.
349
3503.7 Creative Labs Blaster
351~~~~~~~~~~~~~~~~~~~~~~~~~
352 The Blaster protocol is supported by the cobra.c module. It supports only
353the:
354
355* Creative Blaster GamePad Cobra
356
357 Up to two of these can be used on a single gameport, using an Y-cable.
358
3593.8 Genius Digital joysticks
360~~~~~~~~~~~~~~~~~~~~~~~~~~~~
361 The Genius digitally communicating joysticks are supported by the gf2k.c
362module. This includes:
363
364* Genius Flight2000 F-23 joystick
365* Genius Flight2000 F-31 joystick
366* Genius G-09D gamepad
367
368 Other Genius digital joysticks are not supported yet, but support can be
369added fairly easily.
370
3713.9 InterAct Digital joysticks
372~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373 The InterAct digitally communicating joysticks are supported by the
374interact.c module. This includes:
375
376* InterAct HammerHead/FX gamepad
377* InterAct ProPad8 gamepad
378
379 Other InterAct digital joysticks are not supported yet, but support can be
380added fairly easily.
381
3823.10 PDPI Lightning 4 gamecards
383~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384 PDPI Lightning 4 gamecards are supported by the lightning.c module.
385Once the module is loaded, the analog driver can be used to handle the
386joysticks. Digitally communicating joystick will work only on port 0, while
387using Y-cables, you can connect up to 8 analog joysticks to a single L4
388card, 16 in case you have two in your system.
389
3903.11 Trident 4DWave / Aureal Vortex
391~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
392 Soundcards with a Trident 4DWave DX/NX or Aureal Vortex/Vortex2 chipsets
393provide an "Enhanced Game Port" mode where the soundcard handles polling the
394joystick. This mode is supported by the pcigame.c module. Once loaded the
395analog driver can use the enhanced features of these gameports..
396
3973.13 Crystal SoundFusion
398~~~~~~~~~~~~~~~~~~~~~~~~
399 Soundcards with Crystal SoundFusion chipsets provide an "Enhanced Game
400Port", much like the 4DWave or Vortex above. This, and also the normal mode
401for the port of the SoundFusion is supported by the cs461x.c module.
402
4033.14 SoundBlaster Live!
404~~~~~~~~~~~~~~~~~~~~~~~~
405 The Live! has a special PCI gameport, which, although it doesn't provide
406any "Enhanced" stuff like 4DWave and friends, is quite a bit faster than
407it's ISA counterparts. It also requires special support, hence the
408emu10k1-gp.c module for it instead of the normal ns558.c one.
409
4103.15 SoundBlaster 64 and 128 - ES1370 and ES1371, ESS Solo1 and S3 SonicVibes
411~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
412 These PCI soundcards have specific gameports. They are handled by the
413sound drivers themselves. Make sure you select gameport support in the
414joystick menu and sound card support in the sound menu for your appropriate
415card.
416
4173.16 Amiga
418~~~~~~~~~~
419 Amiga joysticks, connected to an Amiga, are supported by the amijoy.c
420driver. Since they can't be autodetected, the driver has a command line.
421
422 amijoy.map=<a>,<b>
423
424 a and b define the joysticks connected to the JOY0DAT and JOY1DAT ports of
425the Amiga.
426
427 Value | Joystick type
428 ---------------------
429 0 | None
430 1 | 1-button digital joystick
431
432 No more joystick types are supported now, but that should change in the
433future if I get an Amiga in the reach of my fingers.
434
4353.17 Game console and 8-bit pads and joysticks
436~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
437See joystick-parport.txt for more info.
438
4393.18 SpaceTec/LabTec devices
440~~~~~~~~~~~~~~~~~~~~~~~~~~~~
441 SpaceTec serial devices communicate using the SpaceWare protocol. It is
442supported by the spaceorb.c and spaceball.c drivers. The devices currently
443supported by spaceorb.c are:
444
445* SpaceTec SpaceBall Avenger
446* SpaceTec SpaceOrb 360
447
448Devices currently supported by spaceball.c are:
449
450* SpaceTec SpaceBall 4000 FLX
451
452 In addition to having the spaceorb/spaceball and serport modules in the
453kernel, you also need to attach a serial port to it. to do that, run the
454inputattach program:
455
456 inputattach --spaceorb /dev/tts/x &
457or
458 inputattach --spaceball /dev/tts/x &
459
460where /dev/tts/x is the serial port which the device is connected to. After
461doing this, the device will be reported and will start working.
462
463 There is one caveat with the SpaceOrb. The button #6, the on the bottom
464side of the orb, although reported as an ordinary button, causes internal
465recentering of the spaceorb, moving the zero point to the position in which
466the ball is at the moment of pressing the button. So, think first before
467you bind it to some other function.
468
469SpaceTec SpaceBall 2003 FLX and 3003 FLX are not supported yet.
470
4713.19 Logitech SWIFT devices
472~~~~~~~~~~~~~~~~~~~~~~~~~~~
473 The SWIFT serial protocol is supported by the warrior.c module. It
474currently supports only the:
475
476* Logitech WingMan Warrior
477
478but in the future, Logitech CyberMan (the original one, not CM2) could be
479supported as well. To use the module, you need to run inputattach after you
480insert/compile the module into your kernel:
481
482 inputattach --warrior /dev/tts/x &
483
484/dev/tts/x is the serial port your Warrior is attached to.
485
4863.20 Magellan / Space Mouse
487~~~~~~~~~~~~~~~~~~~~~~~~~~~
488 The Magellan (or Space Mouse), manufactured by LogiCad3d (formerly Space
489Systems), for many other companies (Logitech, HP, ...) is supported by the
490joy-magellan module. It currently supports only the:
491
492* Magellan 3D
493* Space Mouse
494
495models, the additional buttons on the 'Plus' versions are not supported yet.
496
497 To use it, you need to attach the serial port to the driver using the
498
499 inputattach --magellan /dev/tts/x &
500
501command. After that the Magellan will be detected, initialized, will beep,
502and the /dev/input/jsX device should become usable.
503
5043.21 I-Force devices
505~~~~~~~~~~~~~~~~~~~~
506 All I-Force devices are supported by the iforce module. This includes:
507
508* AVB Mag Turbo Force
509* AVB Top Shot Pegasus
510* AVB Top Shot Force Feedback Racing Wheel
511* Logitech WingMan Force
512* Logitech WingMan Force Wheel
513* Guillemot Race Leader Force Feedback
514* Guillemot Force Feedback Racing Wheel
515* Thrustmaster Motor Sport GT
516
517 To use it, you need to attach the serial port to the driver using the
518
519 inputattach --iforce /dev/tts/x &
520
521command. After that the I-Force device will be detected, and the
522/dev/input/jsX device should become usable.
523
524 In case you're using the device via the USB port, the inputattach command
525isn't needed.
526
527 The I-Force driver now supports force feedback via the event interface.
528
529 Please note that Logitech WingMan *3D devices are _not_ supported by this
530module, rather by hid. Force feedback is not supported for those devices.
531Logitech gamepads are also hid devices.
532
5333.22 Gravis Stinger gamepad
534~~~~~~~~~~~~~~~~~~~~~~~~~~~
535 The Gravis Stinger serial port gamepad, designed for use with laptop
536computers, is supported by the stinger.c module. To use it, attach the
537serial port to the driver using:
538
539 inputattach --stinger /dev/tty/x &
540
541where x is the number of the serial port.
542
5434. Troubleshooting
544~~~~~~~~~~~~~~~~~~
545 There is quite a high probability that you run into some problems. For
546testing whether the driver works, if in doubt, use the jstest utility in
547some of its modes. The most useful modes are "normal" - for the 1.x
548interface, and "old" for the "0.x" interface. You run it by typing:
549
550 jstest --normal /dev/input/js0
551 jstest --old /dev/input/js0
552
553 Additionally you can do a test with the evtest utility:
554
555 evtest /dev/input/event0
556
557 Oh, and read the FAQ! :)
558
5595. FAQ
560~~~~~~
561Q: Running 'jstest /dev/js0' results in "File not found" error. What's the
562 cause?
563A: The device files don't exist. Create them (see section 2.2).
564
565Q: Is it possible to connect my old Atari/Commodore/Amiga/console joystick
566 or pad that uses a 9-pin D-type cannon connector to the serial port of my
567 PC?
568A: Yes, it is possible, but it'll burn your serial port or the pad. It
569 won't work, of course.
570
571Q: My joystick doesn't work with Quake / Quake 2. What's the cause?
572A: Quake / Quake 2 don't support joystick. Use joy2key to simulate keypresses
573 for them.
574
5756. Programming Interface
576~~~~~~~~~~~~~~~~~~~~~~~~
577 The 1.0 driver uses a new, event based approach to the joystick driver.
578Instead of the user program polling for the joystick values, the joystick
579driver now reports only any changes of its state. See joystick-api.txt,
580joystick.h and jstest.c included in the joystick package for more
581information. The joystick device can be used in either blocking or
582nonblocking mode and supports select() calls.
583
584 For backward compatibility the old (v0.x) interface is still included.
585Any call to the joystick driver using the old interface will return values
586that are compatible to the old interface. This interface is still limited
587to 2 axes, and applications using it usually decode only 2 buttons, although
588the driver provides up to 32.
diff --git a/Documentation/input/shape.fig b/Documentation/input/shape.fig
new file mode 100644
index 000000000000..c22bff83d06f
--- /dev/null
+++ b/Documentation/input/shape.fig
@@ -0,0 +1,65 @@
1#FIG 3.2
2Landscape
3Center
4Inches
5Letter
6100.00
7Single
8-2
91200 2
102 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 6
11 4200 3600 4200 3075 4950 2325 7425 2325 8250 3150 8250 3600
122 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
13 4200 3675 4200 5400
142 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
15 8250 3675 8250 5400
162 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
17 3675 3600 8700 3600
182 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
19 8775 3600 10200 3600
202 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
21 8325 3150 9075 3150
222 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
23 7500 2325 10200 2325
242 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
25 3600 3600 3000 3600
262 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
27 4125 3075 3000 3075
282 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
29 0 0 1.00 60.00 120.00
30 0 0 1.00 60.00 120.00
31 4200 5400 8175 5400
322 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
33 0 0 1.00 60.00 120.00
34 0 0 1.00 60.00 120.00
35 10125 2325 10125 3600
362 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
37 0 0 1.00 60.00 120.00
38 0 0 1.00 60.00 120.00
39 3000 3150 3000 3600
402 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
41 0 0 1.00 60.00 120.00
42 0 0 1.00 60.00 120.00
43 9075 3150 9075 3600
442 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
45 4950 2325 4950 1200
462 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
47 7425 2325 7425 1200
482 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
49 4200 3075 4200 2400 3600 1800 3600 1200
502 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4
51 8250 3150 8250 2475 8775 1950 8775 1200
522 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
53 0 0 1.00 60.00 120.00
54 0 0 1.00 60.00 120.00
55 3600 1275 4950 1275
562 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2
57 0 0 1.00 60.00 120.00
58 0 0 1.00 60.00 120.00
59 7425 1275 8700 1275
604 1 0 50 0 0 12 0.0000 4 135 1140 6075 5325 Effect duration\001
614 0 0 50 0 0 12 0.0000 4 180 1305 10200 3000 Effect magnitude\001
624 0 0 50 0 0 12 0.0000 4 135 780 9150 3450 Fade level\001
634 1 0 50 0 0 12 0.0000 4 180 1035 4275 1200 Attack length\001
644 1 0 50 0 0 12 0.0000 4 180 885 8175 1200 Fade length\001
654 2 0 50 0 0 12 0.0000 4 135 930 2925 3375 Attack level\001
diff --git a/Documentation/input/xpad.txt b/Documentation/input/xpad.txt
new file mode 100644
index 000000000000..b9111a703ce0
--- /dev/null
+++ b/Documentation/input/xpad.txt
@@ -0,0 +1,116 @@
1xpad - Linux USB driver for X-Box gamepads
2
3This is the very first release of a driver for X-Box gamepads.
4Basically, this was hacked away in just a few hours, so don't expect
5miracles.
6In particular, there is currently NO support for the rumble pack.
7You won't find many ff-aware linux applications anyway.
8
9
100. Status
11---------
12
13For now, this driver has only been tested on just one Linux-Box.
14This one is running a 2.4.18 kernel with usb-uhci on an amd athlon 600.
15
16The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) reports
178 axes and 10 buttons.
18
19Alls 8 axes work, though they all have the same range (-32768..32767)
20and the zero-setting is not correct for the triggers (I don't know if that
21is some limitation of jstest, since the input device setup should be fine. I
22didn't have a look at jstest itself yet).
23
24All of the 10 buttons work (in digital mode). The six buttons on the
25right side (A, B, X, Y, black, white) are said to be "analog" and
26report their values as 8 bit unsigned, not sure what this is good for.
27
28I tested the controller with quake3, and configuration and
29in game functionality were OK. However, I find it rather difficult to
30play first person shooters with a pad. Your mileage may vary.
31
32
331. USB adapter
34--------------
35
36Before you can actually use the driver, you need to get yourself an
37adapter cable to connect the X-Box controller to your Linux-Box.
38
39Such a cable is pretty easy to build. The Controller itself is a USB compound
40device (a hub with three ports for two expansion slots and the controller
41device) with the only difference in a nonstandard connector (5 pins vs. 4 on
42standard USB connector).
43
44You just need to solder a USB connector onto the cable and keep the
45yellow wire unconnected. The other pins have the same order on both
46connectors so there is no magic to it. Detailed info on these matters
47can be found on the net ([1], [2], [3]).
48
49Thanks to the trip splitter found on the cable you don't even need to cut the
50original one. You can buy an extension cable and cut that instead. That way,
51you can still use the controller with your X-Box, if you have one ;)
52
53
542. driver installation
55----------------------
56
57Once you have the adapter cable and the controller is connected, you need
58to load your USB subsystem and should cat /proc/bus/usb/devices.
59There should be an entry like the one at the end [4].
60
61Currently (as of version 0.0.4), the following three devices are included:
62 original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202
63 original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
64 InterAct PowerPad Pro (Germany), vendor=0x05fd, product=0x107a
65
66If you have another controller that is not listed above and is not recognized
67by the driver, please drop me a line with the appropriate info (that is, include
68the name, vendor and product ID, as well as the country where you bought it;
69sending the whole dump out of /proc/bus/usb/devices along would be even better).
70
71In theory, the driver should work with other controllers than mine
72(InterAct PowerPad pro, bought in Germany) just fine, but I cannot test this
73for I only have this one controller.
74
75If you compiled and installed the driver, test the functionality:
76> modprobe xpad
77> modprobe joydev
78> jstest /dev/js0
79
80There should be a single line showing 18 inputs (8 axes, 10 buttons), and
81it's values should change if you move the sticks and push the buttons.
82
83It works? Voila, your done ;)
84
85
863. Thanks
87---------
88
89I have to thank ITO Takayuki for the detailed info on his site
90 http://euc.jp/periphs/xbox-controller.ja.html.
91
92His useful info and both the usb-skeleton as well as the iforce input driver
93(Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping
94the basic functionality.
95
96
974. References
98-------------
99
1001. http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki)
1012. http://xpad.xbox-scene.com/
1023. http://www.xboxhackz.com/Hackz-Reference.htm
103
1044. /proc/bus/usb/devices - dump from InterAct PowerPad Pro (Germany):
105
106T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
107D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
108P: Vendor=05fd ProdID=107a Rev= 1.00
109C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
110I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none)
111E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms
112E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms
113
114--
115Marko Friedemann <mfr@bmx-chemnitz.de>
1162002-07-16