ACPI: sbs: probe smart battery vis SMBus controller
[pandora-kernel.git] / Documentation / sound / oss / cs46xx
1
2 Documentation for the Cirrus Logic/Crystal SoundFusion cs46xx/cs4280 audio 
3 controller chips (2001/05/11)
4
5 The cs46xx audio driver supports the DSP line of Cirrus controllers. 
6 Specifically, the cs4610, cs4612, cs4614, cs4622, cs4624, cs4630 and the cs4280
7 products.  This driver uses the generic ac97_codec driver for AC97 codec
8 support.  
9
10
11 Features:
12
13 Full Duplex Playback/Capture supported from 8k-48k.
14 16Bit Signed LE & 8Bit Unsigned, with Mono or Stereo supported.
15
16 APM/PM - 2.2.x PM is enabled and functional. APM can also
17 be enabled for 2.4.x by modifying the CS46XX_ACPI_SUPPORT macro
18 definition.
19
20 DMA playback buffer size is configurable from 16k (defaultorder=2) up to 2Meg 
21 (defaultorder=11).  DMA capture buffer size is fixed at a single 4k page as
22 two 2k fragments.
23
24 MMAP seems to work well with QuakeIII, and test XMMS plugin.
25
26 Myth2 works, but the polling logic is not fully correct, but is functional.
27
28 The 2.4.4-ac6 gameport code in the cs461x joystick driver has been tested 
29 with a Microsoft Sidewinder joystick (cs461x.o and sidewinder.o).  This 
30 audio driver must be loaded prior to the joystick driver to enable the
31 DSP task image supporting the joystick device.
32
33
34 Limitations:
35
36 SPDIF is currently not supported.
37
38 Primary codec support only.  No secondary codec support is implemented.
39
40
41
42 NOTES:
43
44 Hercules Game Theatre XP - the EGPIO2 pin controls the external Amp,
45 and has been tested.
46 Module parameter hercules_egpio_disable set to 1, will force a 0 to EGPIODR
47 to disable the external amplifier.
48
49 VTB Santa Cruz - the GPIO7/GPIO8 on the Secondary Codec control
50 the external amplifier for the "back" speakers, since we do not
51 support the secondary codec then this external amp is not
52 turned on.  The primary codec external amplifier is supported but
53 note that the AC97 EAPD bit is inverted logic (amp_voyetra()).
54
55 DMA buffer size - there are issues with many of the Linux applications
56 concerning the optimal buffer size.  Several applications request a 
57 certain fragment size and number and then do not verify that the driver
58 has the ability to support the requested configuration.  
59 SNDCTL_DSP_SETFRAGMENT ioctl is used to request a fragment size and
60 number of fragments.  Some applications exit if an error is returned
61 on this particular ioctl. Therefore, in alignment with the other OSS audio 
62 drivers, no error is returned when a SETFRAGs IOCTL is received, but the 
63 values passed from the app are not used in any buffer calculation 
64 (ossfragshift/ossmaxfrags are not used).
65 Use the "defaultorder=N" module parameter to change the buffer size if
66 you have an application that requires a specific number of fragments
67 or a specific buffer size (see below).
68
69 Debug Interface
70 ---------------
71 There is an ioctl debug interface to allow runtime modification of the 
72 debug print levels.  This debug interface code can be disabled from the 
73 compilation process with commenting the following define:
74 #define CSDEBUG_INTERFACE 1
75 There is also a debug print methodolgy to select printf statements from
76 different areas of the driver.  A debug print level is also used to allow
77 additional printfs to be active.  Comment out the following line in the
78 driver to disable compilation of the CS_DBGOUT print statements:
79 #define CSDEBUG 1
80  
81 Please see the definitions for cs_debuglevel and cs_debugmask for additional
82 information on the debug levels and sections.
83
84 There is also a csdbg executable to allow runtime manipulation of these 
85 parameters.  for a copy email: twoller@crystal.cirrus.com
86
87
88
89 MODULE_PARMS definitions
90 ------------------------
91 module_param(defaultorder, ulong, 0);
92 defaultorder=N
93 where N is a value from 1 to 12
94 The buffer order determines the size of the dma buffer for the driver.
95 under Linux, a smaller buffer allows more responsiveness from many of the 
96 applications (e.g. games).  A larger buffer allows some of the apps (esound) 
97 to not underrun the dma buffer as easily.  As default, use 32k (order=3)
98 rather than 64k as some of the games work more responsively.
99 (2^N) * PAGE_SIZE = allocated buffer size
100
101 module_param(cs_debuglevel, ulong, 0644);
102 module_param(cs_debugmask, ulong, 0644);
103 cs_debuglevel=N
104 cs_debugmask=0xMMMMMMMM
105 where N is a value from 0 (no debug printfs), to 9 (maximum)
106 0xMMMMMMMM is a debug mask corresponding to the CS_xxx bits (see driver source).
107
108 module_param(hercules_egpio_disable, ulong, 0);
109 hercules_egpio_disable=N
110 where N is a 0 (enable egpio), or a 1 (disable egpio support)
111
112 module_param(initdelay, ulong, 0);
113 initdelay=N
114 This value is used to determine the millescond delay during the initialization
115 code prior to powering up the PLL.  On laptops this value can be used to
116 assist with errors on resume, mostly with IBM laptops.  Basically, if the 
117 system is booted under battery power then the mdelay()/udelay() functions fail to 
118 properly delay the required time.  Also, if the system is booted under AC power
119 and then the power removed, the mdelay()/udelay() functions will not delay properly.
120  
121 module_param(powerdown, ulong, 0);
122 powerdown=N
123 where N is 0 (disable any powerdown of the internal blocks) or 1 (enable powerdown)
124
125
126 module_param(external_amp, bool, 0);
127 external_amp=1
128 if N is set to 1, then force enabling the EAPD support in the primary AC97 codec.
129 override the detection logic and force the external amp bit in the AC97 0x26 register
130 to be reset (0).  EAPD should be 0 for powerup, and 1 for powerdown.  The VTB Santa Cruz
131 card has inverted logic, so there is a special function for these cards.
132
133 module_param(thinkpad, bool, 0);
134 thinkpad=1
135 if N is set to 1, then force enabling the clkrun functionality.
136 Currently, when the part is being used, then clkrun is disabled for the entire system,
137 but re-enabled when the driver is released or there is no outstanding open count.
138