VirtualBox

source: vbox/trunk/src/VBox/Devices/Audio/DevIchHdaCommon.h@ 60353

最後變更 在這個檔案從60353是 60353,由 vboxsync 提交於 9 年 前

Audio: Added HDA support for newer Linux guests; more work on surround support (disabled by default).

  • 屬性 svn:executable 設為 *
檔案大小: 24.9 KB
 
1/* $Id$ */
2/** @file
3 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
4 */
5
6/*
7 * Copyright (C) 2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef DEV_HDA_COMMON_H
19#define DEV_HDA_COMMON_H
20
21#define HDA_SDFMT_NON_PCM_SHIFT 15
22#define HDA_SDFMT_NON_PCM_MASK 0x1
23#define HDA_SDFMT_BASE_RATE_SHIFT 14
24#define HDA_SDFMT_BASE_RATE_MASK 0x1
25#define HDA_SDFMT_MULT_SHIFT 11
26#define HDA_SDFMT_MULT_MASK 0x7
27#define HDA_SDFMT_DIV_SHIFT 8
28#define HDA_SDFMT_DIV_MASK 0x7
29#define HDA_SDFMT_BITS_SHIFT 4
30#define HDA_SDFMT_BITS_MASK 0x7
31#define HDA_SDFMT_CHANNELS_MASK 0xF
32
33#define HDA_SDFMT_TYPE RT_BIT(15)
34#define HDA_SDFMT_TYPE_PCM (0)
35#define HDA_SDFMT_TYPE_NON_PCM (1)
36
37#define HDA_SDFMT_BASE RT_BIT(14)
38#define HDA_SDFMT_BASE_48KHZ (0)
39#define HDA_SDFMT_BASE_44KHZ (1)
40
41#define HDA_SDFMT_MULT_1X (0)
42#define HDA_SDFMT_MULT_2X (1)
43#define HDA_SDFMT_MULT_3X (2)
44#define HDA_SDFMT_MULT_4X (3)
45
46#define HDA_SDFMT_DIV_1X (0)
47#define HDA_SDFMT_DIV_2X (1)
48#define HDA_SDFMT_DIV_3X (2)
49#define HDA_SDFMT_DIV_4X (3)
50#define HDA_SDFMT_DIV_5X (4)
51#define HDA_SDFMT_DIV_6X (5)
52#define HDA_SDFMT_DIV_7X (6)
53#define HDA_SDFMT_DIV_8X (7)
54
55#define HDA_SDFMT_8_BIT (0)
56#define HDA_SDFMT_16_BIT (1)
57#define HDA_SDFMT_20_BIT (2)
58#define HDA_SDFMT_24_BIT (3)
59#define HDA_SDFMT_32_BIT (4)
60
61#define HDA_SDFMT_CHAN_MONO (0)
62#define HDA_SDFMT_CHAN_STEREO (1)
63
64/* Emits a SDnFMT register format. */
65/* Also being used in the codec's converter format. */
66#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
67 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
68 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
69 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
70 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
71 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
72 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
73
74#endif /* DEV_HDA_COMMON_H */
75
76/* $Id$ */
77/** @file
78 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
79 */
80
81/*
82 * Copyright (C) 2016 Oracle Corporation
83 *
84 * This file is part of VirtualBox Open Source Edition (OSE), as
85 * available from http://www.alldomusa.eu.org. This file is free software;
86 * you can redistribute it and/or modify it under the terms of the GNU
87 * General Public License (GPL) as published by the Free Software
88 * Foundation, in version 2 as it comes in the "COPYING" file of the
89 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
90 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
91 */
92
93#ifndef DEV_HDA_COMMON_H
94#define DEV_HDA_COMMON_H
95
96#define HDA_SDFMT_NON_PCM_SHIFT 15
97#define HDA_SDFMT_NON_PCM_MASK 0x1
98#define HDA_SDFMT_BASE_RATE_SHIFT 14
99#define HDA_SDFMT_BASE_RATE_MASK 0x1
100#define HDA_SDFMT_MULT_SHIFT 11
101#define HDA_SDFMT_MULT_MASK 0x7
102#define HDA_SDFMT_DIV_SHIFT 8
103#define HDA_SDFMT_DIV_MASK 0x7
104#define HDA_SDFMT_BITS_SHIFT 4
105#define HDA_SDFMT_BITS_MASK 0x7
106#define HDA_SDFMT_CHANNELS_MASK 0xF
107
108#define HDA_SDFMT_TYPE RT_BIT(15)
109#define HDA_SDFMT_TYPE_PCM (0)
110#define HDA_SDFMT_TYPE_NON_PCM (1)
111
112#define HDA_SDFMT_BASE RT_BIT(14)
113#define HDA_SDFMT_BASE_48KHZ (0)
114#define HDA_SDFMT_BASE_44KHZ (1)
115
116#define HDA_SDFMT_MULT_1X (0)
117#define HDA_SDFMT_MULT_2X (1)
118#define HDA_SDFMT_MULT_3X (2)
119#define HDA_SDFMT_MULT_4X (3)
120
121#define HDA_SDFMT_DIV_1X (0)
122#define HDA_SDFMT_DIV_2X (1)
123#define HDA_SDFMT_DIV_3X (2)
124#define HDA_SDFMT_DIV_4X (3)
125#define HDA_SDFMT_DIV_5X (4)
126#define HDA_SDFMT_DIV_6X (5)
127#define HDA_SDFMT_DIV_7X (6)
128#define HDA_SDFMT_DIV_8X (7)
129
130#define HDA_SDFMT_8_BIT (0)
131#define HDA_SDFMT_16_BIT (1)
132#define HDA_SDFMT_20_BIT (2)
133#define HDA_SDFMT_24_BIT (3)
134#define HDA_SDFMT_32_BIT (4)
135
136#define HDA_SDFMT_CHAN_MONO (0)
137#define HDA_SDFMT_CHAN_STEREO (1)
138
139/* Emits a SDnFMT register format. */
140/* Also being used in the codec's converter format. */
141#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
142 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
143 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
144 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
145 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
146 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
147 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
148
149#endif /* DEV_HDA_COMMON_H */
150
151/* $Id$ */
152/** @file
153 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
154 */
155
156/*
157 * Copyright (C) 2016 Oracle Corporation
158 *
159 * This file is part of VirtualBox Open Source Edition (OSE), as
160 * available from http://www.alldomusa.eu.org. This file is free software;
161 * you can redistribute it and/or modify it under the terms of the GNU
162 * General Public License (GPL) as published by the Free Software
163 * Foundation, in version 2 as it comes in the "COPYING" file of the
164 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
165 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
166 */
167
168#ifndef DEV_HDA_COMMON_H
169#define DEV_HDA_COMMON_H
170
171#define HDA_SDFMT_NON_PCM_SHIFT 15
172#define HDA_SDFMT_NON_PCM_MASK 0x1
173#define HDA_SDFMT_BASE_RATE_SHIFT 14
174#define HDA_SDFMT_BASE_RATE_MASK 0x1
175#define HDA_SDFMT_MULT_SHIFT 11
176#define HDA_SDFMT_MULT_MASK 0x7
177#define HDA_SDFMT_DIV_SHIFT 8
178#define HDA_SDFMT_DIV_MASK 0x7
179#define HDA_SDFMT_BITS_SHIFT 4
180#define HDA_SDFMT_BITS_MASK 0x7
181#define HDA_SDFMT_CHANNELS_MASK 0xF
182
183#define HDA_SDFMT_TYPE RT_BIT(15)
184#define HDA_SDFMT_TYPE_PCM (0)
185#define HDA_SDFMT_TYPE_NON_PCM (1)
186
187#define HDA_SDFMT_BASE RT_BIT(14)
188#define HDA_SDFMT_BASE_48KHZ (0)
189#define HDA_SDFMT_BASE_44KHZ (1)
190
191#define HDA_SDFMT_MULT_1X (0)
192#define HDA_SDFMT_MULT_2X (1)
193#define HDA_SDFMT_MULT_3X (2)
194#define HDA_SDFMT_MULT_4X (3)
195
196#define HDA_SDFMT_DIV_1X (0)
197#define HDA_SDFMT_DIV_2X (1)
198#define HDA_SDFMT_DIV_3X (2)
199#define HDA_SDFMT_DIV_4X (3)
200#define HDA_SDFMT_DIV_5X (4)
201#define HDA_SDFMT_DIV_6X (5)
202#define HDA_SDFMT_DIV_7X (6)
203#define HDA_SDFMT_DIV_8X (7)
204
205#define HDA_SDFMT_8_BIT (0)
206#define HDA_SDFMT_16_BIT (1)
207#define HDA_SDFMT_20_BIT (2)
208#define HDA_SDFMT_24_BIT (3)
209#define HDA_SDFMT_32_BIT (4)
210
211#define HDA_SDFMT_CHAN_MONO (0)
212#define HDA_SDFMT_CHAN_STEREO (1)
213
214/* Emits a SDnFMT register format. */
215/* Also being used in the codec's converter format. */
216#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
217 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
218 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
219 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
220 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
221 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
222 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
223
224#endif /* DEV_HDA_COMMON_H */
225
226/* $Id$ */
227/** @file
228 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
229 */
230
231/*
232 * Copyright (C) 2016 Oracle Corporation
233 *
234 * This file is part of VirtualBox Open Source Edition (OSE), as
235 * available from http://www.alldomusa.eu.org. This file is free software;
236 * you can redistribute it and/or modify it under the terms of the GNU
237 * General Public License (GPL) as published by the Free Software
238 * Foundation, in version 2 as it comes in the "COPYING" file of the
239 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
240 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
241 */
242
243#ifndef DEV_HDA_COMMON_H
244#define DEV_HDA_COMMON_H
245
246#define HDA_SDFMT_NON_PCM_SHIFT 15
247#define HDA_SDFMT_NON_PCM_MASK 0x1
248#define HDA_SDFMT_BASE_RATE_SHIFT 14
249#define HDA_SDFMT_BASE_RATE_MASK 0x1
250#define HDA_SDFMT_MULT_SHIFT 11
251#define HDA_SDFMT_MULT_MASK 0x7
252#define HDA_SDFMT_DIV_SHIFT 8
253#define HDA_SDFMT_DIV_MASK 0x7
254#define HDA_SDFMT_BITS_SHIFT 4
255#define HDA_SDFMT_BITS_MASK 0x7
256#define HDA_SDFMT_CHANNELS_MASK 0xF
257
258#define HDA_SDFMT_TYPE RT_BIT(15)
259#define HDA_SDFMT_TYPE_PCM (0)
260#define HDA_SDFMT_TYPE_NON_PCM (1)
261
262#define HDA_SDFMT_BASE RT_BIT(14)
263#define HDA_SDFMT_BASE_48KHZ (0)
264#define HDA_SDFMT_BASE_44KHZ (1)
265
266#define HDA_SDFMT_MULT_1X (0)
267#define HDA_SDFMT_MULT_2X (1)
268#define HDA_SDFMT_MULT_3X (2)
269#define HDA_SDFMT_MULT_4X (3)
270
271#define HDA_SDFMT_DIV_1X (0)
272#define HDA_SDFMT_DIV_2X (1)
273#define HDA_SDFMT_DIV_3X (2)
274#define HDA_SDFMT_DIV_4X (3)
275#define HDA_SDFMT_DIV_5X (4)
276#define HDA_SDFMT_DIV_6X (5)
277#define HDA_SDFMT_DIV_7X (6)
278#define HDA_SDFMT_DIV_8X (7)
279
280#define HDA_SDFMT_8_BIT (0)
281#define HDA_SDFMT_16_BIT (1)
282#define HDA_SDFMT_20_BIT (2)
283#define HDA_SDFMT_24_BIT (3)
284#define HDA_SDFMT_32_BIT (4)
285
286#define HDA_SDFMT_CHAN_MONO (0)
287#define HDA_SDFMT_CHAN_STEREO (1)
288
289/* Emits a SDnFMT register format. */
290/* Also being used in the codec's converter format. */
291#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
292 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
293 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
294 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
295 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
296 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
297 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
298
299#endif /* DEV_HDA_COMMON_H */
300
301/* $Id$ */
302/** @file
303 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
304 */
305
306/*
307 * Copyright (C) 2016 Oracle Corporation
308 *
309 * This file is part of VirtualBox Open Source Edition (OSE), as
310 * available from http://www.alldomusa.eu.org. This file is free software;
311 * you can redistribute it and/or modify it under the terms of the GNU
312 * General Public License (GPL) as published by the Free Software
313 * Foundation, in version 2 as it comes in the "COPYING" file of the
314 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
315 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
316 */
317
318#ifndef DEV_HDA_COMMON_H
319#define DEV_HDA_COMMON_H
320
321#define HDA_SDFMT_NON_PCM_SHIFT 15
322#define HDA_SDFMT_NON_PCM_MASK 0x1
323#define HDA_SDFMT_BASE_RATE_SHIFT 14
324#define HDA_SDFMT_BASE_RATE_MASK 0x1
325#define HDA_SDFMT_MULT_SHIFT 11
326#define HDA_SDFMT_MULT_MASK 0x7
327#define HDA_SDFMT_DIV_SHIFT 8
328#define HDA_SDFMT_DIV_MASK 0x7
329#define HDA_SDFMT_BITS_SHIFT 4
330#define HDA_SDFMT_BITS_MASK 0x7
331#define HDA_SDFMT_CHANNELS_MASK 0xF
332
333#define HDA_SDFMT_TYPE RT_BIT(15)
334#define HDA_SDFMT_TYPE_PCM (0)
335#define HDA_SDFMT_TYPE_NON_PCM (1)
336
337#define HDA_SDFMT_BASE RT_BIT(14)
338#define HDA_SDFMT_BASE_48KHZ (0)
339#define HDA_SDFMT_BASE_44KHZ (1)
340
341#define HDA_SDFMT_MULT_1X (0)
342#define HDA_SDFMT_MULT_2X (1)
343#define HDA_SDFMT_MULT_3X (2)
344#define HDA_SDFMT_MULT_4X (3)
345
346#define HDA_SDFMT_DIV_1X (0)
347#define HDA_SDFMT_DIV_2X (1)
348#define HDA_SDFMT_DIV_3X (2)
349#define HDA_SDFMT_DIV_4X (3)
350#define HDA_SDFMT_DIV_5X (4)
351#define HDA_SDFMT_DIV_6X (5)
352#define HDA_SDFMT_DIV_7X (6)
353#define HDA_SDFMT_DIV_8X (7)
354
355#define HDA_SDFMT_8_BIT (0)
356#define HDA_SDFMT_16_BIT (1)
357#define HDA_SDFMT_20_BIT (2)
358#define HDA_SDFMT_24_BIT (3)
359#define HDA_SDFMT_32_BIT (4)
360
361#define HDA_SDFMT_CHAN_MONO (0)
362#define HDA_SDFMT_CHAN_STEREO (1)
363
364/* Emits a SDnFMT register format. */
365/* Also being used in the codec's converter format. */
366#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
367 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
368 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
369 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
370 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
371 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
372 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
373
374#endif /* DEV_HDA_COMMON_H */
375
376/* $Id$ */
377/** @file
378 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
379 */
380
381/*
382 * Copyright (C) 2016 Oracle Corporation
383 *
384 * This file is part of VirtualBox Open Source Edition (OSE), as
385 * available from http://www.alldomusa.eu.org. This file is free software;
386 * you can redistribute it and/or modify it under the terms of the GNU
387 * General Public License (GPL) as published by the Free Software
388 * Foundation, in version 2 as it comes in the "COPYING" file of the
389 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
390 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
391 */
392
393#ifndef DEV_HDA_COMMON_H
394#define DEV_HDA_COMMON_H
395
396#define HDA_SDFMT_NON_PCM_SHIFT 15
397#define HDA_SDFMT_NON_PCM_MASK 0x1
398#define HDA_SDFMT_BASE_RATE_SHIFT 14
399#define HDA_SDFMT_BASE_RATE_MASK 0x1
400#define HDA_SDFMT_MULT_SHIFT 11
401#define HDA_SDFMT_MULT_MASK 0x7
402#define HDA_SDFMT_DIV_SHIFT 8
403#define HDA_SDFMT_DIV_MASK 0x7
404#define HDA_SDFMT_BITS_SHIFT 4
405#define HDA_SDFMT_BITS_MASK 0x7
406#define HDA_SDFMT_CHANNELS_MASK 0xF
407
408#define HDA_SDFMT_TYPE RT_BIT(15)
409#define HDA_SDFMT_TYPE_PCM (0)
410#define HDA_SDFMT_TYPE_NON_PCM (1)
411
412#define HDA_SDFMT_BASE RT_BIT(14)
413#define HDA_SDFMT_BASE_48KHZ (0)
414#define HDA_SDFMT_BASE_44KHZ (1)
415
416#define HDA_SDFMT_MULT_1X (0)
417#define HDA_SDFMT_MULT_2X (1)
418#define HDA_SDFMT_MULT_3X (2)
419#define HDA_SDFMT_MULT_4X (3)
420
421#define HDA_SDFMT_DIV_1X (0)
422#define HDA_SDFMT_DIV_2X (1)
423#define HDA_SDFMT_DIV_3X (2)
424#define HDA_SDFMT_DIV_4X (3)
425#define HDA_SDFMT_DIV_5X (4)
426#define HDA_SDFMT_DIV_6X (5)
427#define HDA_SDFMT_DIV_7X (6)
428#define HDA_SDFMT_DIV_8X (7)
429
430#define HDA_SDFMT_8_BIT (0)
431#define HDA_SDFMT_16_BIT (1)
432#define HDA_SDFMT_20_BIT (2)
433#define HDA_SDFMT_24_BIT (3)
434#define HDA_SDFMT_32_BIT (4)
435
436#define HDA_SDFMT_CHAN_MONO (0)
437#define HDA_SDFMT_CHAN_STEREO (1)
438
439/* Emits a SDnFMT register format. */
440/* Also being used in the codec's converter format. */
441#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
442 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
443 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
444 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
445 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
446 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
447 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
448
449#endif /* DEV_HDA_COMMON_H */
450
451/* $Id$ */
452/** @file
453 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.
454 */
455
456/*
457 * Copyright (C) 2016 Oracle Corporation
458 *
459 * This file is part of VirtualBox Open Source Edition (OSE), as
460 * available from http://www.alldomusa.eu.org. This file is free software;
461 * you can redistribute it and/or modify it under the terms of the GNU
462 * General Public License (GPL) as published by the Free Software
463 * Foundation, in version 2 as it comes in the "COPYING" file of the
464 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
465 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
466 */
467
468#ifndef DEV_HDA_COMMON_H
469#define DEV_HDA_COMMON_H
470
471#define HDA_SDFMT_NON_PCM_SHIFT 15
472#define HDA_SDFMT_NON_PCM_MASK 0x1
473#define HDA_SDFMT_BASE_RATE_SHIFT 14
474#define HDA_SDFMT_BASE_RATE_MASK 0x1
475#define HDA_SDFMT_MULT_SHIFT 11
476#define HDA_SDFMT_MULT_MASK 0x7
477#define HDA_SDFMT_DIV_SHIFT 8
478#define HDA_SDFMT_DIV_MASK 0x7
479#define HDA_SDFMT_BITS_SHIFT 4
480#define HDA_SDFMT_BITS_MASK 0x7
481#define HDA_SDFMT_CHANNELS_MASK 0xF
482
483#define HDA_SDFMT_TYPE RT_BIT(15)
484#define HDA_SDFMT_TYPE_PCM (0)
485#define HDA_SDFMT_TYPE_NON_PCM (1)
486
487#define HDA_SDFMT_BASE RT_BIT(14)
488#define HDA_SDFMT_BASE_48KHZ (0)
489#define HDA_SDFMT_BASE_44KHZ (1)
490
491#define HDA_SDFMT_MULT_1X (0)
492#define HDA_SDFMT_MULT_2X (1)
493#define HDA_SDFMT_MULT_3X (2)
494#define HDA_SDFMT_MULT_4X (3)
495
496#define HDA_SDFMT_DIV_1X (0)
497#define HDA_SDFMT_DIV_2X (1)
498#define HDA_SDFMT_DIV_3X (2)
499#define HDA_SDFMT_DIV_4X (3)
500#define HDA_SDFMT_DIV_5X (4)
501#define HDA_SDFMT_DIV_6X (5)
502#define HDA_SDFMT_DIV_7X (6)
503#define HDA_SDFMT_DIV_8X (7)
504
505#define HDA_SDFMT_8_BIT (0)
506#define HDA_SDFMT_16_BIT (1)
507#define HDA_SDFMT_20_BIT (2)
508#define HDA_SDFMT_24_BIT (3)
509#define HDA_SDFMT_32_BIT (4)
510
511#define HDA_SDFMT_CHAN_MONO (0)
512#define HDA_SDFMT_CHAN_STEREO (1)
513
514/* Emits a SDnFMT register format. */
515/* Also being used in the codec's converter format. */
516#define HDA_SDFMT_MAKE(_afNonPCM, _aBaseRate, _aMult, _aDiv, _aBits, _aChan) \
517 ( (((_afNonPCM) & HDA_SDFMT_NON_PCM_MASK) << HDA_SDFMT_NON_PCM_SHIFT) \
518 | (((_aBaseRate) & HDA_SDFMT_BASE_RATE_MASK) << HDA_SDFMT_BASE_RATE_SHIFT) \
519 | (((_aMult) & HDA_SDFMT_MULT_MASK) << HDA_SDFMT_MULT_SHIFT) \
520 | (((_aDiv) & HDA_SDFMT_DIV_MASK) << HDA_SDFMT_DIV_SHIFT) \
521 | (((_aBits) & HDA_SDFMT_BITS_MASK) << HDA_SDFMT_BITS_SHIFT) \
522 | ( (_aChan) & HDA_SDFMT_CHANNELS_MASK))
523
524#endif /* DEV_HDA_COMMON_H */
525
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette