alsa.audio: Furter work on skeleton
[AROS.git] / workbench / devs / AHI / Drivers / Envy24HT / regs.h
blob167c4e1f318f8d5b0a7afa7474b63453d9eafc88
1 /*
2 Copyright © 2005-2013, Davy Wentzler. All rights reserved.
3 $Id$
4 */
6 #ifndef _REGS_H
7 #define _REGS_H
10 #define SUBVENDOR_AUREON_SKY 0x3b154711
11 #define SUBVENDOR_AUREON_SPACE 0x3b154511
12 #define SUBVENDOR_PHASE28 0x3b154911
13 #define SUBVENDOR_PHASE22 0x3b155011
15 #define SUBVENDOR_MAUDIO_REVOLUTION51 0x12143136
16 #define SUBVENDOR_MAUDIO_REVOLUTION71 0x12143036
18 #define SUBVENDOR_JULIA 0x31305345
23 #define CCS_CTRL 0x0000
24 #define CCS_RESET_ALL 0x80
26 #define CCS_INTR_MASK 0x0001
27 #define CCS_ENABLE_PLAYREC 0x10
29 #define CCS_INTR_STATUS 0x0002
30 #define CCS_INTR_PLAYREC 0x10 // Macro interrupt for any PDMAx and RDMAx.
31 #define CCS_INTR_MIDI_IN 0x80
32 #define CCS_INTR_MIDI_OUT 0x20
34 // To clear individual bits: write a 1 to a bit in MT00 reg
35 #define CCS_SYSTEM_CONFIG 0x0004
36 #define CCS_CONFIG_ADC_MASK 0x03 // 00: 1 stereo adc, 01: 2, 10: 1 + 1 S/PDIF, 11: none
37 #define CCS_CONFIG_ADC_SHIFT 2
38 #define CCS_CONFIG_DAC_MASK 0x03 // 00: 1 stereo adc, 01: 2, 10: 3, 11: 4
39 #define CCS_CONFIG_DAC_SHIFT 0
41 #define CCS_ACLINK_CONFIG 0x0005
42 #define CCS_ACLINK_I2S 0x80 // 0: AC97, 1:I2S
43 #define CCS_ACLINK_MODE 0x02 // 0: split mode, 1: packed mode
46 #define CCS_I2S_FEATURES 0x0006 // when CCS_ACLINK_CONFIG:CCS_ACLINK_TYPE == 1
47 #define CCS_I2S_VOLMUTE 0x80 // 1 when true
48 #define CCS_I2S_96KHZ 0X40 // 1 when supported
49 #define CCS_I2S_24BIT 0x30 // bit(5:4) 00:16, 01:18, 10:20, 11:24
50 #define CCS_I2S_192KHZ 0X08 // 1 when supported
53 #define CCS_SPDIF_CONFIG 0x0007
54 #define CCS_SPDIF_INTEGRATED 0x80 // 1 enable integrated SPDIF transmitter. Only valid when bit 6 is '1'
55 #define CCS_SPDIF_INTERNAL_OUT 0X40 // 1 when implemented (read-only)
56 #define CCS_SPDIF_ID_MASK 0xF // SPDIF chip ID's
57 #define CCS_SPDIF_ID_SHIFT 2
58 #define CCS_SPDIF_IN_PRESENT 0x02 // 1 when present
59 #define CCS_SPDIF_EXTERNAL_OUT 0x01 // 1 when present (default)
61 #define CCS_UART_TX_STATUS 0x000A // number of bytes in transmit queue
62 #define UART_TX_QUEUE_MASK 0x1F
64 #define CCS_UART_RX_STATUS 0x000B // number of bytes in receive queue
65 #define UART_RX_QUEUE_MASK 0x1F
67 #define CCS_UART_DATA 0x000C
68 #define CCS_UART_COMMAND 0x000D // MIDI command/status
69 #define CCS_UART_SETTINGS 0x000E
73 #define CCS_I2C_DEV_ADDRESS 0x0010 // check CCS13 before accessing
74 #define CCS_ADDRESS_MASK 0xFE // I2C device address (bit 7:1)
75 #define CCS_ADDRESS_SHIFT 1
76 #define CCS_ADDRESS_WRITE 0x01 // 0: read, 1:write
79 #define CCS_I2C_ADDR 0x0011 // byte address to read/write
80 #define CCS_I2C_DATA 0x0012
81 #define CCS_I2C_STATUS 0X0013
82 #define CCS_I2C_EPROM 0x80 // 1: E2PROM connected
83 #define CCS_I2C_BUSY 0x01 // 0: idle, 1: busy
85 #define CCS_GPIO_DATA 0x0014 // word: GPIO 0 - 15
86 #define CCS_GPIO_MASK 0x0016 // 0 in mask means CCS14 register bit can be written, GPIO 0 - 15
87 #define CCS_GPIO_DIR 0x0018 // direction control: 3 bytes! GPIO 0 - 22, 1 = output
89 #define CCS_POWER_DOWN 0x001C
90 #define CCS_GPIO_DATA2 0x001E // byte: GPIO22 to GPIO16 (MSB!)
91 #define CCS_GPIO_MASK2 0x001F // mask for GPIO22 to GPIO16
93 // ----------MT regs-------------------
94 #define MT_INTR_STATUS 0x0000 // masks:
95 #define MT_PDMA4 0x80 // SPDIF out pair playback
96 #define MT_PDMA3 0x40 // pair playback
97 #define MT_PDMA2 0x20
98 #define MT_PDMA1 0x10
99 #define MT_DMA_FIFO 0x08 // see MT1A
100 #define MT_RDMA1 0x04 // SPDIF in
101 #define MT_RDMA0 0x02 // ADC
102 #define MT_PDMA0 0x01 // multi-channel interleaved/PDMA0 pair playback
104 #define MT_SAMPLERATE 0x0001 // in slave mode (SPDIF is master): 256X master clock alone selects rate
105 #define MT_SPDIF_MASTER 0x10 // when SPDIF is master, set primary codec to slave mode!
106 #define MT_RATE_MASK 0x0F // ignored if MT_SPDIF_MASTER =
108 #define MT_I2S_FORMAT 0x0002
109 #define MT_CLOCK_128x 0x8 // 0: 256x (default), 1: 128x
111 #define MT_INTR_MASK 0x0003 // default: all are off = '1'
112 #define MT_PDMA4_MASK 0x80 // SPDIF out pair playback
113 #define MT_PDMA3_MASK 0x40 // valid when MT19 > 0
114 #define MT_PDMA2_MASK 0x20 // valid when MT19 > 1
115 #define MT_PDMA1_MASK 0x10 // valid when MT19 = 3
116 #define MT_DMA_FIFO_MASK 0x08 // MT1A reports offending channel
117 #define MT_RDMA1_MASK 0x04 // SPDIF in
118 #define MT_RDMA0_MASK 0x02 // ADC
119 #define MT_PDMA0_MASK 0x01 // multi-channel interleaved/PDMA0 pair playback
122 #define MT_AC97_REG 0x0004 // AC'97 register index
123 #define MT_AC97_CMD_STATUS 0x0005 // valid when CCS_ACLINK_TYPE == 0
124 #define MT_AC97_RESET 0x80 // cold reset (alone will put it into master mode)
125 #define MT_AC97_WARM_RESET 0X40 // when used together with MT_AC97_RESET, will set external VIA AC'97 to slave mode
126 #define MT_AC97_WRITE 0X20 // write 1 for write mode, reading a 1 is WIP
127 #define MT_AC97_READ 0x10 // write 1 for read mode, reading a 1 is RIP
128 #define MT_AC97_READY 0x08 // codec ready status
129 #define MT_AC97_ID_MASK 0x03 // bit 0:1 is ID mode when is split mode.
130 #define MT_AC97_DATA 0x0006
132 #define MT_DMAI_PB_ADDRESS 0x0010 // long: start address of interleaved playback buffer (long boundary)
133 #define MT_DMAI_PB_LENGTH 0X0014 // long, but 3 bytes (0x14-0x16), DMA size - 1, read: counter
135 #define MT_DMA_CONTROL 0x0018 // start/stop (use read-modify-write)
136 #define MT_PDMA4_START 0x80 // SPDIF out / PDMA4 pair playback
137 #define MT_PDMA3_START 0x40 // valid when MT19 > 0
138 #define MT_PDMA2_START 0x20 // valid when MT19 > 1
139 #define MT_PDMA1_START 0x10 // valid when MT19 = 3
140 #define MT_RDMA1_START 0x04 // SPDIF in
141 #define MT_RDMA0_START 0x02 // ADC
142 #define MT_PDMA0_START 0x01 // multi-channel interleaved/PDMA0 pair playback
144 #define MT_DMAI_BURSTSIZE 0x0019 // bits 0 and 1 only:
145 // 00: default 8 ch. on PDMAi
146 // 01: 6 ch on PDMAi, PDMA3 is available independently
147 // 10: 4 ch on PDMAi, PDMA3 and PDMA2 are available independently
148 // 11: 2 ch on PDMA0: 4 stereo pairs
150 #define MT_DMA_UNDERRUN 0x001A // FIFO overrun/underrun register
151 #define MT_PDMA4_UNDERRUN 0x80 // SPDIF out / PDMA4 pair playback
152 #define MT_PDMA3_UNDERRUN 0x40 // valid when MT19 > 0
153 #define MT_PDMA2_UNDERRUN 0x20 // valid when MT19 > 1
154 #define MT_PDMA1_UNDERRUN 0x10 // valid when MT19 = 3
155 #define MT_RDMA1_OVERRUN 0x04 // SPDIF in
156 #define MT_RDMA0_OVERRUN 0x02 // ADC
157 #define MT_PDMA0_UNDERRUN 0x01 // multi-channel interleaved/PDMA0 pair playback
159 #define MT_DMA_PAUSE 0x001B
162 #define MT_DMAI_INTLEN 0x001C // interrupt after this size - 1 (word)
164 // record pair registers
165 #define MT_RDMA0_ADDRESS 0x0020
166 #define MT_RDMA0_LENGTH 0x0024
167 #define MT_RDMA0_INTLEN 0x0026
169 #define MT_RDMA1_ADDRESS 0x0030
170 #define MT_RDMA1_LENGTH 0x0034
171 #define MT_RDMA1_INTLEN 0x0036
174 // stereo pair registers
175 #define MT_PDMA4_ADDRESS 0x0040
176 #define MT_PDMA4_LENGTH 0x0044
177 #define MT_PDMA4_INTLEN 0x0046
179 #define MT_PDMA3_ADDRESS 0x0050
180 #define MT_PDMA3_LENGTH 0x0054
181 #define MT_PDMA3_INTLEN 0x0056
183 #define MT_PDMA2_ADDRESS 0x0060
184 #define MT_PDMA2_LENGTH 0x0064
185 #define MT_PDMA2_INTLEN 0x0066
187 #define MT_PDMA1_ADDRESS 0x0070 // stereo pair 1
188 #define MT_PDMA1_LENGTH 0x0074
189 #define MT_PDMA1_INTLEN 0x0076
191 #define MT_SPDIF_TRANSMIT 0x003C
195 // ----------AC97 regs-----------------
196 #define AC97_RESET 0x0000
198 // Play master volume registers
199 #define AC97_MASTER_VOL_STEREO 0x0002 // -94.5 to 0.0 dB attenuation
200 #define AC97_AUXOUT_VOL 0x0004 // "" + can be impl. as line level out, headphone out or 4ch out. Most likely 4ch out vol.
201 #define AC97_MASTER_VOL_MONO 0x0006 // ""
203 #define AC97_MASTER_TONE 0x0008 // bass / treble
204 #define AC97_PCBEEP_VOL 0x000a
206 // Analog mixer input gain registers
207 // 5-bit gain: -32.5 dB attenuation to +12.0 dB gain
208 // 0x0008 is 0dB gain, 0x8008 is 0dB gain with mute on
209 #define AC97_PHONE_VOL 0x000c // mono: only bits 0-4
210 #define AC97_MIC_VOL 0x000e // mono + bit 6 is 20dB boost switch
211 #define AC97_LINEIN_VOL 0x0010 // stereo
212 #define AC97_CD_VOL 0x0012
213 #define AC97_VIDEO_VOL 0x0014
214 #define AC97_AUX_VOL 0x0016
215 #define AC97_PCMOUT_VOL 0x0018
217 #define AC97_RECORD_SELECT 0x001a
218 // 0dB to 22.5 dB gain on the stereo input
219 #define AC97_RECORD_GAIN 0x001c
220 #define AC97_RECORD_GAIN_MIC 0x001e
222 #define AC97_GENERAL_PURPOSE 0x0020
223 #define AC97_3D_CONTROL 0x0022
225 // mostly a read-only register (except D5 and D4 which control optional DAC slot assignment)
226 // controls variable SRC, double-rate output, multi-channel output and S/PDIF output
227 #define AC97_EXTENDED_ID 0x0028
228 #define AC97_EXTENDED_CTRL 0x002a
230 #define AC97_SPDIF_CTRL 0x003a
232 #define AC97_SURROUND_MASTER 0x0038
234 #define AC97_VENDOR_ID0 0x007C
235 #define AC97_VENDOR_ID1 0x007E
237 #define AC97_MUTE 0x8000
239 #define AC97_RECMUX_MIC 0x0000
240 #define AC97_RECMUX_CD 0x0101
241 #define AC97_RECMUX_VIDEO 0x0202
242 #define AC97_RECMUX_AUX 0x0303
243 #define AC97_RECMUX_LINE 0x0404
244 #define AC97_RECMUX_STEREO_MIX 0x0505
245 #define AC97_RECMUX_MONO_MIX 0x0606
246 #define AC97_RECMUX_PHONE 0x0707
248 // -----------------------------
249 /* GPIO bits */
250 #define AUREON_CS8415_CS (1 << 22)
251 #define AUREON_CS8415_CDOUT (1 << 21) // output data from the control port to GPIO 21
252 #define AUREON_WM_RESET (1 << 20)
253 #define AUREON_WM_CLK (1 << 19)
254 #define AUREON_WM_DATA (1 << 18)
255 #define AUREON_WM_RW (1 << 17)
256 #define AUREON_AC97_RESET (1 << 16)
257 #define AUREON_DIGITAL_SEL1 (1 << 15)
258 #define AUREON_HP_SEL (1 << 14)
259 #define AUREON_WM_CS (1 << 12)
260 #define AUREON_AC97_COMMIT (1 << 11)
261 #define AUREON_AC97_ADDR (1 << 10)
262 #define AUREON_AC97_DATA_LOW (1 << 9)
263 #define AUREON_AC97_DATA_HIGH (1 << 8)
264 #define AUREON_AC97_DATA_MASK 0xFF
267 #define PHASE28_FREQ0 (1 << 22) // input
268 #define PHASE28_FREQ1 (1 << 21)
269 #define PHASE28_WM_RESET (1 << 20)
270 #define PHASE28_SPI_CLK (1 << 19)
271 #define PHASE28_SPI_MOSI (1 << 18)
272 #define PHASE28_WM_RW (1 << 17)
273 #define PHASE28_FREQ2 (1 << 16)
274 #define PHASE28_DIGITAL_SEL1 (1 << 15)
275 #define PHASE28_HP_SEL (1 << 14)
276 #define PHASE28_WM_CS (1 << 12)
277 #define PHASE28_AC97_COMMIT (1 << 11)
278 #define PHASE28_AC97_ADDR (1 << 10)
279 #define PHASE28_AC97_DATA_LOW (1 << 9)
280 #define PHASE28_AC97_DATA_HIGH (1 << 8)
281 #define PHASE28_AC97_DATA_MASK 0xFF
284 #define REVO_CCLK 0x02 // control data input pin on AKM (pin 7 on 4381)
285 #define REVO_CDIN 0x04 /* not used */
286 #define REVO_CDOUT 0x08
287 #define REVO_CS0 0x10 /* not used */
288 #define REVO_CS1 0x20 /* front AKM4381 chipselect */
289 #define REVO_CS2 0x40 /* surround AKM4355 chipselect */
290 #define REVO_MUTE (1<<22) /* 0 = all mute, 1 = normal operation */
291 #define VT1724_REVO_CS3 0x80 /* AK4114 for AP192 */
294 // ESI JULI@
295 #define AK4114_ADDR 0x20 /* S/PDIF receiver */
296 #define AK4358_ADDR 0x22 /* DAC */
298 #define GPIO_FREQ_MASK (3<<0)
299 #define GPIO_FREQ_32KHZ (0<<0)
300 #define GPIO_FREQ_44KHZ (1<<0)
301 #define GPIO_FREQ_48KHZ (2<<0)
302 #define GPIO_MULTI_MASK (3<<2)
303 #define GPIO_MULTI_4X (0<<2)
304 #define GPIO_MULTI_2X (1<<2)
305 #define GPIO_MULTI_1X (2<<2) /* also external */
306 #define GPIO_MULTI_HALF (3<<2)
307 #define GPIO_INTERNAL_CLOCK (1<<4)
308 #define GPIO_ANALOG_PRESENT (1<<5) /* RO only: 0 = present */
309 #define GPIO_RXMCLK_SEL (1<<7) /* must be 0 */
310 #define GPIO_AK5385A_CKS0 (1<<8) // master clock select
311 #define GPIO_AK5385A_DFS0 (1<<9) /* swapped with DFS1 according doc? */
312 #define GPIO_AK5385A_DFS1 (1<<10) // dfs0 + dfs1 = sampling rate select
313 #define GPIO_DIGOUT_MONITOR (1<<11) /* 1 = active */
314 #define GPIO_DIGIN_MONITOR (1<<12) /* 1 = active */
315 #define GPIO_ANAIN_MONITOR (1<<13) /* 1 = active */
316 #define GPIO_AK5385A_MCLK (1<<14) /* must be 0 */
317 #define GPIO_MUTE_CONTROL (1<<15) /* 0 = off, 1 = on */
320 #endif /* _REGS_H */