1/*
2 * Copyright (c) 2008, ETH Zurich. All rights reserved.
3 *
4 * This file is distributed under the terms in the attached LICENSE file.
5 * If you do not find this file, copies can be found by writing to:
6 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
7 */
8
9/*
10 * ac97_base_audio.dev
11 *
12 * DESCRIPTION: AC'97 Baseline Audio Register Set
13 * 
14 * Numbers in comments refer to the Intel Audio Codec '97 specification, 
15 * revision 2.3 revision 1.0, April, 2002
16 */
17
18device ac97_base_audio msbfirst ( io base ) "AC97 Baseline Audio" {
19
20  // 5.7.1
21  constants s3dsev "3D stereo enhancement vendor ID" {
22    none	= 0  "No 3D stereo enhancement";
23    analogdev	= 1  "Analog Devices";
24    creative	= 2  "Creative Technology";
25    natsemi	= 3  "National Semiconductor";
26    yamaha	= 4  "Yamaha";
27    bbesound	= 5  "BBE Sound";
28    crystal	= 6  "Crystal Semiconductor";
29    qsound	= 7  "Qsound Labs";
30    spatial	= 8  "Spatializer Audio Laboratories";
31    srs		= 9  "SRS Labs";
32    platform	= 10 "Platform Tech";
33    akm		= 11 "AKM Semiconductor";
34    aureal	= 12 "Aureal";
35    aztech	= 13 "Aztech Labs";
36    binaura	= 14 "Binaura";
37    ess		= 15 "ESS Technology";
38    harman	= 16 "Harman International";
39    nvidia	= 17 "Nvidia";
40    philips	= 18 "Philips";
41    ti		= 19 "Texas Instruments";
42    vlsi	= 20 "VLSI Technology";
43    tritech	= 21 "Tritech";
44    realtek	= 22 "Realtek";
45    samsung	= 23 "Samsung";
46    wolfson	= 24 "Wolfson Microelectronics";
47    delta       = 25 "Delta Integration";
48    sigma       = 26 "SigmaTel";
49    kswav	= 27 "KS Waves";
50    rockwell	= 28 "Rockwell";
51  };
52
53  register reset rwc io( base, 0x00) "Reset" {
54    _		1 rsvd;
55    se		5 ro type(s3dsev) "3D stereo enhancement vendor id";
56    id9		1 ro "20-bit ADC resolution";
57    id8		1 ro "18-bit ADC resolution";
58    id7		1 ro "20-bit DAC resolution";
59    id6		1 ro "18-bit DAC resolution";
60    id5		1 ro "Loudness support";
61    id4		1 ro "Headphone out support";
62    id3		1 ro "Simulated stereo";
63    id2		1 ro "Bass & treble control";
64    id1		1 rsvd;
65    id0		1 ro "Dedicated MIC PCM in";
66  };
67
68  // 5.7.2
69  regtype stereo_vol "Stereo volume" {
70    mute	1 "Mute";
71    _		1 rsvd;
72    ml		6 "Left volume";
73    _		2 rsvd;
74    mr		6 "Right volume";
75  };
76  register master_vol io( base, 0x02 ) "Master volume" type(stereo_vol);
77  register auxout_vol io( base, 0x04 ) "Aux out volume" type(stereo_vol);
78  register mono_vol   io( base, 0x06 ) "Mono volume" {
79    mute	1 "Mute";
80    _		9 rsvd;
81    mm		6 "Volume";
82  };
83  
84  // 5.7.3
85  register master_tone io( base, 0x08 ) "Master tone control" {
86    _		4 rsvd;
87    ba		4 "Bass";
88    _		4 rsvd;
89    tr		4 "Treble";
90  };
91
92  // 5.7.4
93  register pcbeep io( base, 0x0a ) "PC beep" {
94    mute	1 "Mute";
95    _		2 rsvd;
96    freq	8 "Frequency";
97    vol		4 "Volume";
98    _		1 rsvd;
99  };
100
101  // 5.7.5
102  regtype analog_gain "Stereo analog mixer gain" {
103    mute	1 "Mute";
104    _		2 rsvd;
105    left	5 "Left gain";
106    _		3 rsvd;
107    right	5 "Right gain";
108  };
109  register phone_vol io( base, 0x0c ) "Phone volume" {
110    mute	1 "Mute";
111    _		10 rsvd;
112    gain	5  "Gain";
113  };
114  register mic_vol io( base, 0x0e ) "Mic volume" {
115    mute	1 "Mute";
116    _		8 rsvd;
117    db20	1 "20 dB";
118    _		1 rsvd;
119    gain	5  "Gain";
120  };
121  register linein_vol io( base, 0x10 ) "Line in volume" type(analog_gain);
122  register cd_vol io( base, 0x12 ) "CD volume" type(analog_gain);
123  register video_vol io( base, 0x14 ) "Video volume" type(analog_gain);
124  register auxin_vol io( base, 0x16 ) "Aux in volume" type(analog_gain);
125  register pcmout_vol io( base, 0x18 ) "PCM out volume" type(analog_gain);
126
127  // 5.7.6
128  constants rec_src "Record source" {
129    mic		= 0 "Mic";
130    cd		= 1 "CD in";
131    video	= 2 "Video in";
132    aux		= 3 "Aux in";
133    line	= 4 "Line in";
134    stereo	= 5 "Stereo mix";
135    mono	= 6 "Mono mix";
136    phone	= 7 "Phone";
137  };
138  register rec_sec io( base, 0x1a ) "Record select" {
139    _		5 rsvd;
140    left	3 type(rec_src) "Left source";
141    _		5 rsvd;
142    right	3 type(rec_src) "Right source";
143  };
144  
145  // 5.7.7
146  register rec_gain io( base, 0x1c ) "Record gain" {
147    mute	1 "Mute";
148    _		3 rsvd;
149    left	4 "Left gain";
150    _		4 rsvd;
151    right	4 "Right gain";
152  };
153  register rec_gain_mic io( base, 0x1e ) "Record gain mic" {
154    mute	1 "Mute";
155    _		11 rsvd;
156    gain	4 "Gain";
157  };
158
159  // 5.7.8
160  register general io( base, 0x20 ) "General purpose" {
161    pop		1 "PCM out path & mute";
162    st		1 "Simulated stereo enhancement";
163    s3d		1 "3D stereo enhancement";
164    ld		1 "Loudness";
165    drss        2 "Double rate slot select";
166    mix		1 "Mono output select";
167    ms		1 "Mic select";
168    lpbk	1 "ADC/DAC loopback mode";
169    _		7 rsvd;
170  };
171
172  // 5.7.9
173  register s3d_ctrl io( base, 0x22 ) "3D control" {
174    _		4 rsvd;
175    cr		4 "Center";
176    _		4 rsvd;
177    dp		4 "Depth";
178  };
179  
180  // 5.7.10
181  constants page_sel "Page selector" {
182    vs		= 0 "Vendor-specific";
183    p1		= 1 "Paged ID 01";
184  };
185
186  register aipm io( base, 0x24 ) "Audio interrupt and paging" {
187    is		1 rw "Interrupt status";
188    ics		1 ro "Sense status cause";
189    icg		1 ro "GPIO status cause";
190    isense	1 rw "Sense cycle start";
191    ie		1 rw "Interrupt enable";
192    _		7 rsvd;
193    pg		4 rw type(page_sel) "page selector";
194  };
195
196  // 5.7.11
197  register pcsr io( base, 0x26 ) "Powerdown control/status" {
198    eapd	1 rw "External amp powerdown";
199    pr6		1 rw "Aux out powerdown";
200    pr5		1 rw "Internal clk disable";
201    pr4		1 rw "Digital intf powerdown";
202    pr3		1 rw "Analog mixer powerdown (vref off)";
203    pr2		1 rw "Analog mixer powerdown (vref still on)";
204    pr1		1 rw "PCM out DACs powerdown";
205    pr0 	1 rw "PCM in ADCs & input mux powerdown";
206    _		4 rsvd;
207    ref		1 ro "Vref's up to nominal level";
208    anl		1 ro "Analog mixers ready";
209    dac		1 ro "DAC section ready to accept";
210    adc		1 ro "ADC section ready to transmit";
211  };
212
213};
214
215	
216