Go to the documentation of this file. 1 #ifndef __SOUND_AZT3328_H
2 #define __SOUND_AZT3328_H
9 #define AZF_IO_SIZE_CTRL 0x80
10 #define AZF_IO_SIZE_CTRL_PM 0x70
19 #define AZF_IO_OFFS_CODEC_PLAYBACK 0x00
20 #define AZF_IO_OFFS_CODEC_CAPTURE 0x20
21 #define AZF_IO_OFFS_CODEC_I2S_OUT 0x40
23 #define IDX_IO_CODEC_DMA_FLAGS 0x00
27 #define DMA_RESUME 0x0001
32 #define DMA_RUN_SOMETHING1 0x0002
34 #define DMA_RUN_SOMETHING2 0x0004
35 #define SOMETHING_ALMOST_ALWAYS_SET 0x0008
36 #define DMA_EPILOGUE_SOMETHING 0x0010
37 #define DMA_SOMETHING_ELSE 0x0020
38 #define SOMETHING_UNMODIFIABLE 0xffc0
39 #define IDX_IO_CODEC_IRQTYPE 0x02
45 #define IRQ_SOMETHING 0x0001
46 #define IRQ_FINISHED_DMABUF_1 0x0002
47 #define IRQ_FINISHED_DMABUF_2 0x0004
48 #define IRQMASK_SOME_STATUS_1 0x0008
49 #define IRQMASK_SOME_STATUS_2 0x0010
50 #define IRQMASK_UNMODIFIABLE 0xffe0
52 #define IDX_IO_CODEC_DMA_START_1 0x04
54 #define IDX_IO_CODEC_DMA_START_2 0x08
57 #define IDX_IO_CODEC_DMA_LENGTHS 0x0c
58 #define IDX_IO_CODEC_DMA_CURRPOS 0x10
60 #define IDX_IO_CODEC_DMA_CURROFS 0x14
61 #define IDX_IO_CODEC_SOUNDFORMAT 0x16
63 #define SOUNDFORMAT_FREQUENCY_MASK 0x000f
64 #define SOUNDFORMAT_XTAL1 0x00
65 #define SOUNDFORMAT_XTAL2 0x01
71 #define SOUNDFORMAT_FREQ_SUSPECTED_4000 0x0c | SOUNDFORMAT_XTAL1
72 #define SOUNDFORMAT_FREQ_SUSPECTED_4800 0x0a | SOUNDFORMAT_XTAL1
73 #define SOUNDFORMAT_FREQ_5510 0x0c | SOUNDFORMAT_XTAL2
74 #define SOUNDFORMAT_FREQ_6620 0x0a | SOUNDFORMAT_XTAL2
75 #define SOUNDFORMAT_FREQ_8000 0x00 | SOUNDFORMAT_XTAL1
76 #define SOUNDFORMAT_FREQ_9600 0x08 | SOUNDFORMAT_XTAL1
77 #define SOUNDFORMAT_FREQ_11025 0x00 | SOUNDFORMAT_XTAL2
78 #define SOUNDFORMAT_FREQ_SUSPECTED_13240 0x08 | SOUNDFORMAT_XTAL2
79 #define SOUNDFORMAT_FREQ_16000 0x02 | SOUNDFORMAT_XTAL1
80 #define SOUNDFORMAT_FREQ_22050 0x02 | SOUNDFORMAT_XTAL2
81 #define SOUNDFORMAT_FREQ_32000 0x04 | SOUNDFORMAT_XTAL1
82 #define SOUNDFORMAT_FREQ_44100 0x04 | SOUNDFORMAT_XTAL2
83 #define SOUNDFORMAT_FREQ_48000 0x06 | SOUNDFORMAT_XTAL1
84 #define SOUNDFORMAT_FREQ_SUSPECTED_66200 0x06 | SOUNDFORMAT_XTAL2
85 #define SOUNDFORMAT_FLAG_16BIT 0x0010
86 #define SOUNDFORMAT_FLAG_2CHANNELS 0x0020
91 #define AZF_FREQ(rate) AZF_FREQ_##rate = rate
110 #define IDX_IO_TIMER_VALUE 0x60
112 #define TIMER_VALUE_MASK 0x000fffffUL
114 #define TIMER_COUNTDOWN_ENABLE 0x01000000UL
116 #define TIMER_IRQ_ENABLE 0x02000000UL
119 #define TIMER_IRQ_ACK 0x04000000UL
120 #define IDX_IO_IRQSTATUS 0x64
128 #define IRQ_PLAYBACK 0x0001
129 #define IRQ_RECORDING 0x0002
130 #define IRQ_I2S_OUT 0x0004
131 #define IRQ_GAMEPORT 0x0008
132 #define IRQ_MPU401 0x0010
133 #define IRQ_TIMER 0x0020
134 #define IRQ_UNKNOWN2 0x0040
135 #define IRQ_UNKNOWN3 0x0080
136 #define IDX_IO_66H 0x66
139 #define IDX_IO_SOME_VALUE 0x68
140 #define IO_68_RANDOM_TOGGLE1 0x0100
141 #define IO_68_RANDOM_TOGGLE2 0x0200
154 #define IDX_IO_6AH 0x6A
160 #define IO_6A_SOMETHING1_GAMEPORT 0x0020
163 #define IO_6A_PAUSE_PLAYBACK_BIT8 0x0100
166 #define IO_6A_PAUSE_PLAYBACK_BIT9 0x0200
175 #define IO_6A_SOMETHING2_GAMEPORT 0x0400
185 #define IDX_IO_6CH 0x6C
186 #define IDX_IO_6EH 0x6E
197 #define AZF_IO_SIZE_GAME 0x08
198 #define AZF_IO_SIZE_GAME_PM 0x06
204 #define IDX_GAME_LEGACY_COMPATIBLE 0x00
211 #define IDX_GAME_AXES_CONFIG 0x01
216 #define GAME_AXES_ENABLE_1 0x01
218 #define GAME_AXES_ENABLE_2 0x02
220 #define GAME_AXES_ENABLE_3 0x04
222 #define GAME_AXES_ENABLE_4 0x08
226 #define GAME_AXES_READ_MASK 0x30
230 #define GAME_AXES_LATCH_ENABLE 0x40
232 #define GAME_AXES_SAMPLING_READY 0x80
246 #define IDX_GAME_AXIS_VALUE 0x02
250 #define IDX_GAME_HWCONFIG 0x04
254 #define GAME_HWCFG_IRQ_ENABLE 0x01
262 #define GAME_HWCFG_ADC_COUNTER_FREQ_MASK 0x06
265 #define GAME_HWCFG_ADC_COUNTER_FREQ_STD 0
266 #define GAME_HWCFG_ADC_COUNTER_FREQ_1_2 1
267 #define GAME_HWCFG_ADC_COUNTER_FREQ_1_20 2
268 #define GAME_HWCFG_ADC_COUNTER_FREQ_1_200 3
272 #define GAME_HWCFG_LEGACY_ADDRESS_ENABLE 0x08
275 #define AZF_IO_SIZE_MPU 0x04
276 #define AZF_IO_SIZE_MPU_PM 0x04
280 #define AZF_IO_SIZE_OPL3 0x08
281 #define AZF_IO_SIZE_OPL3_PM 0x06
289 #define AZF_IO_SIZE_MIXER 0x40
290 #define AZF_IO_SIZE_MIXER_PM 0x22
292 #define MIXER_VOLUME_RIGHT_MASK 0x001f
293 #define MIXER_VOLUME_LEFT_MASK 0x1f00
294 #define MIXER_MUTE_MASK 0x8000
295 #define IDX_MIXER_RESET 0x00
296 #define IDX_MIXER_PLAY_MASTER 0x02
297 #define IDX_MIXER_MODEMOUT 0x04
298 #define IDX_MIXER_BASSTREBLE 0x06
299 #define MIXER_BASSTREBLE_TREBLE_VOLUME_MASK 0x000e
300 #define MIXER_BASSTREBLE_BASS_VOLUME_MASK 0x0e00
301 #define IDX_MIXER_PCBEEP 0x08
302 #define IDX_MIXER_MODEMIN 0x0a
303 #define IDX_MIXER_MIC 0x0c
304 #define MIXER_MIC_MICGAIN_20DB_ENHANCEMENT_MASK 0x0040
305 #define IDX_MIXER_LINEIN 0x0e
306 #define IDX_MIXER_CDAUDIO 0x10
307 #define IDX_MIXER_VIDEO 0x12
308 #define IDX_MIXER_AUX 0x14
309 #define IDX_MIXER_WAVEOUT 0x16
310 #define IDX_MIXER_FMSYNTH 0x18
311 #define IDX_MIXER_REC_SELECT 0x1a
312 #define MIXER_REC_SELECT_MIC 0x00
313 #define MIXER_REC_SELECT_CD 0x01
314 #define MIXER_REC_SELECT_VIDEO 0x02
315 #define MIXER_REC_SELECT_AUX 0x03
316 #define MIXER_REC_SELECT_LINEIN 0x04
317 #define MIXER_REC_SELECT_MIXSTEREO 0x05
318 #define MIXER_REC_SELECT_MIXMONO 0x06
319 #define MIXER_REC_SELECT_MONOIN 0x07
320 #define IDX_MIXER_REC_VOLUME 0x1c
321 #define IDX_MIXER_ADVCTL1 0x1e
323 #define MIXER_ADVCTL1_3DWIDTH_MASK 0x000e
324 #define MIXER_ADVCTL1_HIFI3D_MASK 0x0300
325 #define IDX_MIXER_ADVCTL2 0x20
327 #define MIXER_ADVCTL2_LPBK 0x0080
328 #define MIXER_ADVCTL2_MS 0x0100
329 #define MIXER_ADVCTL2_MIX 0x0200
330 #define MIXER_ADVCTL2_3D 0x2000
331 #define MIXER_ADVCTL2_POP 0x8000
333 #define IDX_MIXER_SOMETHING30H 0x30
336 #define SET_CHAN_LEFT 1
337 #define SET_CHAN_RIGHT 2
340 #define AZF_ALIGN(x) (((x) + 3) & (~3))