Rev 566 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
431 | serge | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
351 | diamond | 7 | |
8 | format MS COFF |
||
9 | |||
10 | |||
11 | include 'proc32.inc' |
||
12 | include 'imports.inc' |
||
13 | |||
465 | serge | 14 | API_VERSION equ 0x01000100 |
15 | |||
566 | serge | 16 | DEBUG equ 1 |
17 | DEBUG_IRQ equ 0 |
||
351 | diamond | 18 | |
566 | serge | 19 | USE_COM_IRQ equ 0 ;make irq 3 and irq 4 available for PCI devices |
20 | IRQ_REMAP equ 0 |
||
21 | IRQ_LINE equ 0 |
||
351 | diamond | 22 | |
566 | serge | 23 | |
351 | diamond | 24 | ;irq 0,1,2,8,12,13 недоступны |
566 | serge | 25 | ; FEDCBA9876543210 |
26 | VALID_IRQ equ 1100111011111000b |
||
27 | ATTCH_IRQ equ 0000111010100000b |
||
351 | diamond | 28 | |
566 | serge | 29 | if USE_COM_IRQ |
30 | ATTCH_IRQ equ 0000111010111000b |
||
31 | end if |
||
351 | diamond | 32 | |
566 | serge | 33 | CPU_FREQ equ 2600d |
351 | diamond | 34 | |
35 | BIT0 EQU 0x00000001 |
||
36 | BIT1 EQU 0x00000002 |
||
37 | BIT2 EQU 0x00000004 |
||
38 | BIT3 EQU 0x00000008 |
||
39 | BIT4 EQU 0x00000010 |
||
40 | BIT5 EQU 0x00000020 |
||
41 | BIT6 EQU 0x00000040 |
||
42 | BIT7 EQU 0x00000080 |
||
43 | BIT8 EQU 0x00000100 |
||
44 | BIT9 EQU 0x00000200 |
||
45 | BIT10 EQU 0x00000400 |
||
46 | BIT11 EQU 0x00000800 |
||
47 | BIT12 EQU 0x00001000 |
||
48 | BIT13 EQU 0x00002000 |
||
49 | BIT14 EQU 0x00004000 |
||
50 | BIT15 EQU 0x00008000 |
||
51 | BIT16 EQU 0x00010000 |
||
52 | BIT17 EQU 0x00020000 |
||
53 | BIT18 EQU 0x00040000 |
||
54 | BIT19 EQU 0x00080000 |
||
55 | BIT20 EQU 0x00100000 |
||
56 | BIT21 EQU 0x00200000 |
||
57 | BIT22 EQU 0x00400000 |
||
58 | BIT23 EQU 0x00800000 |
||
59 | BIT24 EQU 0x00100000 |
||
60 | BIT25 EQU 0x02000000 |
||
61 | BIT26 EQU 0x04000000 |
||
62 | BIT27 EQU 0x08000000 |
||
63 | BIT28 EQU 0x10000000 |
||
64 | BIT29 EQU 0x20000000 |
||
65 | BIT30 EQU 0x40000000 |
||
66 | BIT31 EQU 0x80000000 |
||
67 | |||
465 | serge | 68 | PCM_4 equ BIT20 |
69 | PCM_6 equ BIT21 |
||
70 | |||
562 | serge | 71 | VID_INTEL equ 0x8086 |
72 | VID_NVIDIA equ 0x10DE |
||
351 | diamond | 73 | |
562 | serge | 74 | CTRL_ICH equ 0x2415 |
75 | CTRL_ICH0 equ 0x2425 |
||
76 | CTRL_ICH2 equ 0x2435 |
||
77 | CTRL_ICH3 equ 0x2445 |
||
78 | CTRL_ICH4 equ 0x24C5 |
||
79 | CTRL_ICH5 equ 0x24D5 |
||
80 | CTRL_ICH6 equ 0x266E |
||
81 | CTRL_ICH7 equ 0x27DE |
||
351 | diamond | 82 | |
562 | serge | 83 | CTRL_NFORCE equ 0x01B1 |
84 | CTRL_NFORCE2 equ 0x006A |
||
85 | CTRL_NFORCE3 equ 0x00DA |
||
86 | CTRL_MCP04 equ 0x003A |
||
87 | CTRL_CK804 equ 0x0059 |
||
88 | CTRL_CK8 equ 0x008A |
||
89 | CTRL_CK8S equ 0x00EA |
||
90 | CTRL_MCP51 equ 0x026B |
||
351 | diamond | 91 | |
92 | |||
562 | serge | 93 | PCM_OUT_BDL equ 0x10 ; PCM out buffer descriptors list |
94 | PCM_OUT_CR_REG equ 0x1b ; PCM out Control Register |
||
95 | PCM_OUT_LVI_REG equ 0x15 ; PCM last valid index |
||
96 | PCM_OUT_SR_REG equ 0x16 ; PCM out Status register |
||
97 | PCM_OUT_PIV_REG equ 0x1a |
||
98 | PCM_OUT_CIV_REG equ 0x14 ; PCM out current index |
||
351 | diamond | 99 | |
562 | serge | 100 | PCM_IN_CR_REG equ 0x0b ; PCM in Control Register |
101 | MC_IN_CR_REG equ 0x2b ; MIC in Control Register |
||
102 | RR equ BIT1 ; reset registers. Nukes all regs |
||
351 | diamond | 103 | |
465 | serge | 104 | CODEC_MASTER_VOL_REG equ 0x02 |
105 | CODEC_AUX_VOL equ 0x04 ; |
||
106 | CODEC_PCM_OUT_REG equ 0x18 ; PCM output volume |
||
107 | CODEC_EXT_AUDIO_REG equ 0x28 ; extended audio |
||
108 | CODEC_EXT_AUDIO_CTRL_REG equ 0x2a ; extended audio control |
||
109 | CODEC_PCM_FRONT_DACRATE_REG equ 0x2c ; PCM out sample rate |
||
110 | CODEC_PCM_SURND_DACRATE_REG equ 0x2e ; surround sound sample rate |
||
111 | CODEC_PCM_LFE_DACRATE_REG equ 0x30 ; LFE sample rate |
||
351 | diamond | 112 | |
562 | serge | 113 | GLOB_CTRL equ 0x2C ; Global Control |
114 | CTRL_STAT equ 0x30 ; Global Status |
||
115 | CTRL_CAS equ 0x34 ; Codec Access Semiphore |
||
351 | diamond | 116 | |
562 | serge | 117 | CAS_FLAG equ 0x01 ; Codec Access Semiphore Bit |
351 | diamond | 118 | |
562 | serge | 119 | CTRL_ST_CREADY equ BIT8+BIT9+BIT28 ; Primary Codec Ready |
351 | diamond | 120 | |
562 | serge | 121 | CTRL_ST_RCS equ 0x00008000 ; Read Completion Status |
351 | diamond | 122 | |
562 | serge | 123 | CTRL_CNT_CRIE equ BIT4+BIT5+BIT6 ; Codecs Resume Interrupt Enable |
124 | CTRL_CNT_AC_OFF equ 0x00000008 ; ACLINK Off |
||
125 | CTRL_CNT_WARM equ 0x00000004 ; AC97 Warm Reset |
||
126 | CTRL_CNT_COLD equ 0x00000002 ; AC97 Cold Reset |
||
127 | CTRL_CNT_GIE equ 0x00000001 ; GPI Interrupt Enable |
||
351 | diamond | 128 | |
129 | CODEC_REG_POWERDOWN equ 0x26 |
||
130 | CODEC_REG_ST equ 0x26 |
||
131 | |||
465 | serge | 132 | SRV_GETVERSION equ 0 |
351 | diamond | 133 | DEV_PLAY equ 1 |
134 | DEV_STOP equ 2 |
||
135 | DEV_CALLBACK equ 3 |
||
136 | DEV_SET_BUFF equ 4 |
||
137 | DEV_NOTIFY equ 5 |
||
138 | DEV_SET_MASTERVOL equ 6 |
||
139 | DEV_GET_MASTERVOL equ 7 |
||
140 | DEV_GET_INFO equ 8 |
||
141 | |||
142 | struc AC_CNTRL ;AC controller base class |
||
143 | { .bus dd ? |
||
144 | .devfn dd ? |
||
145 | |||
146 | .vendor dd ? |
||
147 | .dev_id dd ? |
||
148 | .pci_cmd dd ? |
||
149 | .pci_stat dd ? |
||
150 | |||
151 | .codec_io_base dd ? |
||
152 | .codec_mem_base dd ? |
||
153 | |||
154 | .ctrl_io_base dd ? |
||
155 | .ctrl_mem_base dd ? |
||
156 | .cfg_reg dd ? |
||
157 | .int_line dd ? |
||
158 | |||
159 | .vendor_ids dd ? ;vendor id string |
||
160 | .ctrl_ids dd ? ;hub id string |
||
161 | |||
162 | .buffer dd ? |
||
163 | |||
164 | .notify_pos dd ? |
||
165 | .notify_task dd ? |
||
166 | |||
167 | .lvi_reg dd ? |
||
168 | .ctrl_setup dd ? |
||
169 | .user_callback dd ? |
||
170 | .codec_read16 dd ? |
||
171 | .codec_write16 dd ? |
||
172 | |||
173 | .ctrl_read8 dd ? |
||
174 | .ctrl_read16 dd ? |
||
175 | .ctrl_read32 dd ? |
||
176 | |||
177 | .ctrl_write8 dd ? |
||
178 | .ctrl_write16 dd ? |
||
179 | .ctrl_write32 dd ? |
||
180 | } |
||
181 | |||
182 | struc CODEC ;Audio Chip base class |
||
183 | { |
||
184 | .chip_id dd ? |
||
185 | .flags dd ? |
||
186 | .status dd ? |
||
187 | |||
188 | .ac_vendor_ids dd ? ;ac vendor id string |
||
189 | .chip_ids dd ? ;chip model string |
||
190 | |||
191 | .shadow_flag dd ? |
||
192 | dd ? |
||
193 | |||
194 | .regs dw ? ; codec registers |
||
195 | .reg_master_vol dw ? ;0x02 |
||
196 | .reg_aux_out_vol dw ? ;0x04 |
||
197 | .reg_mone_vol dw ? ;0x06 |
||
198 | .reg_master_tone dw ? ;0x08 |
||
199 | .reg_beep_vol dw ? ;0x0A |
||
200 | .reg_phone_vol dw ? ;0x0C |
||
201 | .reg_mic_vol dw ? ;0x0E |
||
202 | .reg_line_in_vol dw ? ;0x10 |
||
203 | .reg_cd_vol dw ? ;0x12 |
||
204 | .reg_video_vol dw ? ;0x14 |
||
205 | .reg_aux_in_vol dw ? ;0x16 |
||
206 | .reg_pcm_out_vol dw ? ;0x18 |
||
207 | .reg_rec_select dw ? ;0x1A |
||
208 | .reg_rec_gain dw ? ;0x1C |
||
209 | .reg_rec_gain_mic dw ? ;0x1E |
||
210 | .reg_gen dw ? ;0x20 |
||
211 | .reg_3d_ctrl dw ? ;0X22 |
||
212 | .reg_page dw ? ;0X24 |
||
213 | .reg_powerdown dw ? ;0x26 |
||
214 | .reg_ext_audio dw ? ;0x28 |
||
215 | .reg_ext_st dw ? ;0x2a |
||
216 | .reg_pcm_front_rate dw ? ;0x2c |
||
217 | .reg_pcm_surr_rate dw ? ;0x2e |
||
218 | .reg_lfe_rate dw ? ;0x30 |
||
219 | .reg_pcm_in_rate dw ? ;0x32 |
||
220 | dw ? ;0x34 |
||
221 | .reg_cent_lfe_vol dw ? ;0x36 |
||
222 | .reg_surr_vol dw ? ;0x38 |
||
223 | .reg_spdif_ctrl dw ? ;0x3A |
||
224 | dw ? ;0x3C |
||
225 | dw ? ;0x3E |
||
226 | dw ? ;0x40 |
||
227 | dw ? ;0x42 |
||
228 | dw ? ;0x44 |
||
229 | dw ? ;0x46 |
||
230 | dw ? ;0x48 |
||
231 | dw ? ;0x4A |
||
232 | dw ? ;0x4C |
||
233 | dw ? ;0x4E |
||
234 | dw ? ;0x50 |
||
235 | dw ? ;0x52 |
||
236 | dw ? ;0x54 |
||
237 | dw ? ;0x56 |
||
238 | dw ? ;0x58 |
||
239 | dw ? ;0x5A |
||
240 | dw ? ;0x5C |
||
241 |