xref: /OK3568_Linux_fs/kernel/Documentation/sound/cards/joystick.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=======================================
2*4882a593SmuzhiyunAnalog Joystick Support on ALSA Drivers
3*4882a593Smuzhiyun=======================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunOct. 14, 2003
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunTakashi Iwai <tiwai@suse.de>
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunGeneral
10*4882a593Smuzhiyun-------
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunFirst of all, you need to enable GAMEPORT support on Linux kernel for
13*4882a593Smuzhiyunusing a joystick with the ALSA driver.  For the details of gameport
14*4882a593Smuzhiyunsupport, refer to Documentation/input/joydev/joystick.rst.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunThe joystick support of ALSA drivers is different between ISA and PCI
17*4882a593Smuzhiyuncards.  In the case of ISA (PnP) cards, it's usually handled by the
18*4882a593Smuzhiyunindependent module (ns558).  Meanwhile, the ALSA PCI drivers have the
19*4882a593Smuzhiyunbuilt-in gameport support.  Hence, when the ALSA PCI driver is built
20*4882a593Smuzhiyunin the kernel, CONFIG_GAMEPORT must be 'y', too.  Otherwise, the
21*4882a593Smuzhiyungameport support on that card will be (silently) disabled.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunSome adapter modules probe the physical connection of the device at
24*4882a593Smuzhiyunthe load time.  It'd be safer to plug in the joystick device before
25*4882a593Smuzhiyunloading the module.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunPCI Cards
29*4882a593Smuzhiyun---------
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunFor PCI cards, the joystick is enabled when the appropriate module
32*4882a593Smuzhiyunoption is specified.  Some drivers don't need options, and the
33*4882a593Smuzhiyunjoystick support is always enabled.  In the former ALSA version, there
34*4882a593Smuzhiyunwas a dynamic control API for the joystick activation.  It was
35*4882a593Smuzhiyunchanged, however, to the static module options because of the system
36*4882a593Smuzhiyunstability and the resource management.
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunThe following PCI drivers support the joystick natively.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun==============	=============	============================================
41*4882a593SmuzhiyunDriver		Module Option	Available Values
42*4882a593Smuzhiyun==============	=============	============================================
43*4882a593Smuzhiyunals4000		joystick_port	0 = disable (default), 1 = auto-detect,
44*4882a593Smuzhiyun	                        manual: any address (e.g. 0x200)
45*4882a593Smuzhiyunau88x0		N/A		N/A
46*4882a593Smuzhiyunazf3328		joystick	0 = disable, 1 = enable, -1 = auto (default)
47*4882a593Smuzhiyunens1370		joystick	0 = disable (default), 1 = enable
48*4882a593Smuzhiyunens1371		joystick_port	0 = disable (default), 1 = auto-detect,
49*4882a593Smuzhiyun	                        manual: 0x200, 0x208, 0x210, 0x218
50*4882a593Smuzhiyuncmipci		joystick_port	0 = disable (default), 1 = auto-detect,
51*4882a593Smuzhiyun	                        manual: any address (e.g. 0x200)
52*4882a593Smuzhiyuncs4281		N/A		N/A
53*4882a593Smuzhiyuncs46xx		N/A		N/A
54*4882a593Smuzhiyunes1938		N/A		N/A
55*4882a593Smuzhiyunes1968		joystick	0 = disable (default), 1 = enable
56*4882a593Smuzhiyunsonicvibes	N/A		N/A
57*4882a593Smuzhiyuntrident		N/A		N/A
58*4882a593Smuzhiyunvia82xx [#f1]_	joystick	0 = disable (default), 1 = enable
59*4882a593Smuzhiyunymfpci		joystick_port	0 = disable (default), 1 = auto-detect,
60*4882a593Smuzhiyun	                        manual: 0x201, 0x202, 0x204, 0x205 [#f2]_
61*4882a593Smuzhiyun==============	=============	============================================
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun.. [#f1] VIA686A/B only
64*4882a593Smuzhiyun.. [#f2] With YMF744/754 chips, the port address can be chosen arbitrarily
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe following drivers don't support gameport natively, but there are
67*4882a593Smuzhiyunadditional modules.  Load the corresponding module to add the gameport
68*4882a593Smuzhiyunsupport.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun=======	=================
71*4882a593SmuzhiyunDriver	Additional Module
72*4882a593Smuzhiyun=======	=================
73*4882a593Smuzhiyunemu10k1	emu10k1-gp
74*4882a593Smuzhiyunfm801	fm801-gp
75*4882a593Smuzhiyun=======	=================
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunNote: the "pcigame" and "cs461x" modules are for the OSS drivers only.
78*4882a593SmuzhiyunThese ALSA drivers (cs46xx, trident and au88x0) have the
79*4882a593Smuzhiyunbuilt-in gameport support.
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunAs mentioned above, ALSA PCI drivers have the built-in gameport
82*4882a593Smuzhiyunsupport, so you don't have to load ns558 module.  Just load "joydev"
83*4882a593Smuzhiyunand the appropriate adapter module (e.g. "analog").
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunISA Cards
87*4882a593Smuzhiyun---------
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunALSA ISA drivers don't have the built-in gameport support.
90*4882a593SmuzhiyunInstead, you need to load "ns558" module in addition to "joydev" and
91*4882a593Smuzhiyunthe adapter module (e.g. "analog").
92