- Timestamp:
- Apr 6, 2016 12:13:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHdaCommon.h
r60353 r60355 74 74 #endif /* DEV_HDA_COMMON_H */ 75 75 76 /* $Id$ */77 /** @file78 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.79 */80 81 /*82 * Copyright (C) 2016 Oracle Corporation83 *84 * This file is part of VirtualBox Open Source Edition (OSE), as85 * available from http://www.virtualbox.org. This file is free software;86 * you can redistribute it and/or modify it under the terms of the GNU87 * General Public License (GPL) as published by the Free Software88 * Foundation, in version 2 as it comes in the "COPYING" file of the89 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the90 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.91 */92 93 #ifndef DEV_HDA_COMMON_H94 #define DEV_HDA_COMMON_H95 96 #define HDA_SDFMT_NON_PCM_SHIFT 1597 #define HDA_SDFMT_NON_PCM_MASK 0x198 #define HDA_SDFMT_BASE_RATE_SHIFT 1499 #define HDA_SDFMT_BASE_RATE_MASK 0x1100 #define HDA_SDFMT_MULT_SHIFT 11101 #define HDA_SDFMT_MULT_MASK 0x7102 #define HDA_SDFMT_DIV_SHIFT 8103 #define HDA_SDFMT_DIV_MASK 0x7104 #define HDA_SDFMT_BITS_SHIFT 4105 #define HDA_SDFMT_BITS_MASK 0x7106 #define HDA_SDFMT_CHANNELS_MASK 0xF107 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 /** @file153 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.154 */155 156 /*157 * Copyright (C) 2016 Oracle Corporation158 *159 * This file is part of VirtualBox Open Source Edition (OSE), as160 * available from http://www.virtualbox.org. This file is free software;161 * you can redistribute it and/or modify it under the terms of the GNU162 * General Public License (GPL) as published by the Free Software163 * Foundation, in version 2 as it comes in the "COPYING" file of the164 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the165 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.166 */167 168 #ifndef DEV_HDA_COMMON_H169 #define DEV_HDA_COMMON_H170 171 #define HDA_SDFMT_NON_PCM_SHIFT 15172 #define HDA_SDFMT_NON_PCM_MASK 0x1173 #define HDA_SDFMT_BASE_RATE_SHIFT 14174 #define HDA_SDFMT_BASE_RATE_MASK 0x1175 #define HDA_SDFMT_MULT_SHIFT 11176 #define HDA_SDFMT_MULT_MASK 0x7177 #define HDA_SDFMT_DIV_SHIFT 8178 #define HDA_SDFMT_DIV_MASK 0x7179 #define HDA_SDFMT_BITS_SHIFT 4180 #define HDA_SDFMT_BITS_MASK 0x7181 #define HDA_SDFMT_CHANNELS_MASK 0xF182 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 /** @file228 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.229 */230 231 /*232 * Copyright (C) 2016 Oracle Corporation233 *234 * This file is part of VirtualBox Open Source Edition (OSE), as235 * available from http://www.virtualbox.org. This file is free software;236 * you can redistribute it and/or modify it under the terms of the GNU237 * General Public License (GPL) as published by the Free Software238 * Foundation, in version 2 as it comes in the "COPYING" file of the239 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the240 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.241 */242 243 #ifndef DEV_HDA_COMMON_H244 #define DEV_HDA_COMMON_H245 246 #define HDA_SDFMT_NON_PCM_SHIFT 15247 #define HDA_SDFMT_NON_PCM_MASK 0x1248 #define HDA_SDFMT_BASE_RATE_SHIFT 14249 #define HDA_SDFMT_BASE_RATE_MASK 0x1250 #define HDA_SDFMT_MULT_SHIFT 11251 #define HDA_SDFMT_MULT_MASK 0x7252 #define HDA_SDFMT_DIV_SHIFT 8253 #define HDA_SDFMT_DIV_MASK 0x7254 #define HDA_SDFMT_BITS_SHIFT 4255 #define HDA_SDFMT_BITS_MASK 0x7256 #define HDA_SDFMT_CHANNELS_MASK 0xF257 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 /** @file303 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.304 */305 306 /*307 * Copyright (C) 2016 Oracle Corporation308 *309 * This file is part of VirtualBox Open Source Edition (OSE), as310 * available from http://www.virtualbox.org. This file is free software;311 * you can redistribute it and/or modify it under the terms of the GNU312 * General Public License (GPL) as published by the Free Software313 * Foundation, in version 2 as it comes in the "COPYING" file of the314 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the315 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.316 */317 318 #ifndef DEV_HDA_COMMON_H319 #define DEV_HDA_COMMON_H320 321 #define HDA_SDFMT_NON_PCM_SHIFT 15322 #define HDA_SDFMT_NON_PCM_MASK 0x1323 #define HDA_SDFMT_BASE_RATE_SHIFT 14324 #define HDA_SDFMT_BASE_RATE_MASK 0x1325 #define HDA_SDFMT_MULT_SHIFT 11326 #define HDA_SDFMT_MULT_MASK 0x7327 #define HDA_SDFMT_DIV_SHIFT 8328 #define HDA_SDFMT_DIV_MASK 0x7329 #define HDA_SDFMT_BITS_SHIFT 4330 #define HDA_SDFMT_BITS_MASK 0x7331 #define HDA_SDFMT_CHANNELS_MASK 0xF332 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 /** @file378 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.379 */380 381 /*382 * Copyright (C) 2016 Oracle Corporation383 *384 * This file is part of VirtualBox Open Source Edition (OSE), as385 * available from http://www.virtualbox.org. This file is free software;386 * you can redistribute it and/or modify it under the terms of the GNU387 * General Public License (GPL) as published by the Free Software388 * Foundation, in version 2 as it comes in the "COPYING" file of the389 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the390 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.391 */392 393 #ifndef DEV_HDA_COMMON_H394 #define DEV_HDA_COMMON_H395 396 #define HDA_SDFMT_NON_PCM_SHIFT 15397 #define HDA_SDFMT_NON_PCM_MASK 0x1398 #define HDA_SDFMT_BASE_RATE_SHIFT 14399 #define HDA_SDFMT_BASE_RATE_MASK 0x1400 #define HDA_SDFMT_MULT_SHIFT 11401 #define HDA_SDFMT_MULT_MASK 0x7402 #define HDA_SDFMT_DIV_SHIFT 8403 #define HDA_SDFMT_DIV_MASK 0x7404 #define HDA_SDFMT_BITS_SHIFT 4405 #define HDA_SDFMT_BITS_MASK 0x7406 #define HDA_SDFMT_CHANNELS_MASK 0xF407 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 /** @file453 * DevIchHdaCommon.h - Shared defines / functions between controller and codec.454 */455 456 /*457 * Copyright (C) 2016 Oracle Corporation458 *459 * This file is part of VirtualBox Open Source Edition (OSE), as460 * available from http://www.virtualbox.org. This file is free software;461 * you can redistribute it and/or modify it under the terms of the GNU462 * General Public License (GPL) as published by the Free Software463 * Foundation, in version 2 as it comes in the "COPYING" file of the464 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the465 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.466 */467 468 #ifndef DEV_HDA_COMMON_H469 #define DEV_HDA_COMMON_H470 471 #define HDA_SDFMT_NON_PCM_SHIFT 15472 #define HDA_SDFMT_NON_PCM_MASK 0x1473 #define HDA_SDFMT_BASE_RATE_SHIFT 14474 #define HDA_SDFMT_BASE_RATE_MASK 0x1475 #define HDA_SDFMT_MULT_SHIFT 11476 #define HDA_SDFMT_MULT_MASK 0x7477 #define HDA_SDFMT_DIV_SHIFT 8478 #define HDA_SDFMT_DIV_MASK 0x7479 #define HDA_SDFMT_BITS_SHIFT 4480 #define HDA_SDFMT_BITS_MASK 0x7481 #define HDA_SDFMT_CHANNELS_MASK 0xF482 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
Note:
See TracChangeset
for help on using the changeset viewer.