Changeset 33719 in vbox
- Timestamp:
- Nov 3, 2010 10:22:15 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r33717 r33719 93 93 #define CODEC_MAKE_F00_08(BeepGen, InputDelay, OutputDelay) ((BeepGen)| (((InputDelay) & 0xF) << 8) | ((OutputDelay) & 0xF)) 94 94 #define CODEC_F00_08_BEEP_GEN RT_BIT(16) 95 96 /* Widget Capabilities (7.3.4.6) */ 97 #define CODEC_MAKE_F00_09(type, delay, chanel_count) \ 98 ( (((type) & 0xF) << 20) \ 99 | (((delay) & 0xF) << 16) \ 100 | (((chanel_count) & 0xF) << 13)) 101 /* note: types 0x8-0xe are reserved */ 102 #define CODEC_F00_09_TYPE_AUDIO_OUTPUT (0x0) 103 #define CODEC_F00_09_TYPE_AUDIO_INPUT (0x1) 104 #define CODEC_F00_09_TYPE_AUDIO_MIXER (0x2) 105 #define CODEC_F00_09_TYPE_AUDIO_SELECTOR (0x3) 106 #define CODEC_F00_09_TYPE_PIN_COMPLEX (0x4) 107 #define CODEC_F00_09_TYPE_POWER_WIDGET (0x5) 108 #define CODEC_F00_09_TYPE_VOLUME_KNOB (0x6) 109 #define CODEC_F00_09_TYPE_BEEP_GEN (0x7) 110 #define CODEC_F00_09_TYPE_VENDOR_DEFINED (0xF) 111 112 #define CODEC_F00_09_CAP_CP RT_BIT(12) 113 #define CODEC_F00_09_CAP_L_R_SWAP RT_BIT(11) 114 #define CODEC_F00_09_CAP_POWER_CTRL RT_BIT(10) 115 #define CODEC_F00_09_CAP_DIGITAL RT_BIT(9) 116 #define CODEC_F00_09_CAP_CONNECTION_LIST RT_BIT(8) 117 #define CODEC_F00_09_CAP_UNSOL RT_BIT(7) 118 #define CODEC_F00_09_CAP_PROC_WIDGET RT_BIT(6) 119 #define CODEC_F00_09_CAP_STRIPE RT_BIT(5) 120 #define CODEC_F00_09_CAP_FMT_OVERRIDE RT_BIT(4) 121 #define CODEC_F00_09_CAP_AMP_FMT_OVERRIDE RT_BIT(3) 122 #define CODEC_F00_09_CAP_OUT_AMP_PRESENT RT_BIT(2) 123 #define CODEC_F00_09_CAP_IN_AMP_PRESENT RT_BIT(1) 124 #define CODEC_F00_09_CAP_LSB RT_BIT(0) 95 125 96 126 /* HDA spec 7.3.3.31 defines layout of configuration registers/verbs (0xF1C) */ … … 297 327 AMPLIFIER_REGISTER(pNode->dac.B_params, AMPLIFIER_OUT, AMPLIFIER_RIGHT, 0) = 0x7F | RT_BIT(7); 298 328 299 pNode->dac.node.au32F00_param[9] = (0xD << 16) | RT_BIT(11) | RT_BIT(10) | RT_BIT(2) | RT_BIT(0); 329 pNode->dac.node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_OUTPUT, 0xD, 0) 330 | CODEC_F00_09_CAP_L_R_SWAP 331 | CODEC_F00_09_CAP_POWER_CTRL 332 | CODEC_F00_09_CAP_OUT_AMP_PRESENT 333 | CODEC_F00_09_CAP_LSB;//(0xD << 16) | RT_BIT(11) | RT_BIT(10) | RT_BIT(2) | RT_BIT(0); 300 334 pNode->dac.u32F0c_param = 0; 301 335 pNode->dac.u32F05_param = 0x3 << 4 | 0x3; /* PS-Act: D3, Set: D3 */ … … 314 348 pNode->adc.u32F05_param = 0x3 << 4 | 0x3; /* PS-Act: D3 Set: D3 */ 315 349 pNode->adc.u32F06_param = 0; 316 pNode->adc.node.au32F00_param[9] = RT_BIT(20)| (0xd << 16) | RT_BIT(10) | RT_BIT(8) | RT_BIT(6)| RT_BIT(0); 350 pNode->adc.node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_INPUT, 0xD, 0) 351 | CODEC_F00_09_CAP_L_R_SWAP 352 | CODEC_F00_09_CAP_CONNECTION_LIST 353 | CODEC_F00_09_CAP_PROC_WIDGET 354 | CODEC_F00_09_CAP_LSB;//RT_BIT(20)| (0xd << 16) | RT_BIT(10) | RT_BIT(8) | RT_BIT(6)| RT_BIT(0); 317 355 break; 318 356 case 8: 319 357 pNode->spdifout.node.name = "SPDIFOut"; 320 358 pNode->spdifout.u32A_param = (1<<14)|(0x1<<4) | 0x1; 321 pNode->spdifout.node.au32F00_param[9] = (4 << 16) | RT_BIT(9)|RT_BIT(4)|0x1; 359 pNode->spdifout.node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_OUTPUT, 0x4, 0) 360 | CODEC_F00_09_CAP_DIGITAL 361 | CODEC_F00_09_CAP_FMT_OVERRIDE 362 | CODEC_F00_09_CAP_LSB;//(4 << 16) | RT_BIT(9)|RT_BIT(4)|0x1; 322 363 pNode->node.au32F00_param[0xa] = pState->pNodes[1].node.au32F00_param[0xA]; 323 364 pNode->spdifout.node.au32F00_param[0xB] = RT_BIT(2)|RT_BIT(0); … … 328 369 pNode->node.name = "Reserved_0"; 329 370 pNode->spdifin.u32A_param = (0x1<<4) | 0x1; 330 pNode->spdifin.node.au32F00_param[9] = (0x1 << 20)|(4 << 16) | RT_BIT(9)| RT_BIT(8)|RT_BIT(4)|0x1; 371 pNode->spdifin.node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_INPUT, 0x4, 0) 372 | CODEC_F00_09_CAP_DIGITAL 373 | CODEC_F00_09_CAP_CONNECTION_LIST 374 | CODEC_F00_09_CAP_FMT_OVERRIDE 375 | CODEC_F00_09_CAP_LSB;//(0x1 << 20)|(4 << 16) | RT_BIT(9)| RT_BIT(8)|RT_BIT(4)|0x1; 331 376 pNode->node.au32F00_param[0xA] = pState->pNodes[1].node.au32F00_param[0xA]; 332 377 pNode->node.au32F00_param[0xE] = RT_BIT(0); … … 393 438 pNode->port.u32F09_param = RT_BIT(31)|0x7fffffff; 394 439 pNode->port.u32F08_param = 0; 395 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(0); 440 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0x0, 0) 441 | CODEC_F00_09_CAP_CONNECTION_LIST 442 | CODEC_F00_09_CAP_UNSOL 443 | CODEC_F00_09_CAP_LSB;//(4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(0); 396 444 pNode->node.au32F00_param[0xE] = 0x1; 397 445 break; 398 446 case 0xE: 399 447 pNode->node.name = "PortE"; 400 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(7)|RT_BIT(0); 448 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0x0, 0) 449 | CODEC_F00_09_CAP_UNSOL 450 | CODEC_F00_09_CAP_LSB;//(4 << 20)|RT_BIT(7)|RT_BIT(0); 401 451 pNode->port.u32F08_param = 0; 402 452 pNode->node.au32F00_param[0xC] = 0x34; … … 413 463 case 0xF: 414 464 pNode->node.name = "PortF"; 415 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(2)|RT_BIT(0); 465 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0x0, 0x0) 466 | CODEC_F00_09_CAP_CONNECTION_LIST 467 | CODEC_F00_09_CAP_UNSOL 468 | CODEC_F00_09_CAP_OUT_AMP_PRESENT 469 | CODEC_F00_09_CAP_LSB;//(4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(2)|RT_BIT(0); 416 470 pNode->node.au32F00_param[0xC] = 0x37; 417 471 pNode->node.au32F00_param[0xE] = 0x1; … … 430 484 case 0x10: 431 485 pNode->node.name = "DigOut_0"; 432 pNode->node.au32F00_param[9] = (4<<20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 486 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0x0, 0x0) 487 | CODEC_F00_09_CAP_DIGITAL 488 | CODEC_F00_09_CAP_CONNECTION_LIST 489 | CODEC_F00_09_CAP_LSB;//(4<<20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 433 490 pNode->node.au32F00_param[0xC] = RT_BIT(4); 434 491 pNode->node.au32F00_param[0xE] = 0x3; … … 469 526 pNode->adcmux.u32F01_param = 1; 470 527 adcmux_init: 471 pNode->node.au32F00_param[9] = (3<<20)|RT_BIT(8)|RT_BIT(3)|RT_BIT(2)|RT_BIT(0); 528 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_SELECTOR, 0x0, 0) 529 | CODEC_F00_09_CAP_CONNECTION_LIST 530 | CODEC_F00_09_CAP_AMP_FMT_OVERRIDE 531 | CODEC_F00_09_CAP_OUT_AMP_PRESENT 532 | CODEC_F00_09_CAP_LSB;//(3<<20)|RT_BIT(8)|RT_BIT(3)|RT_BIT(2)|RT_BIT(0); 472 533 pNode->node.au32F00_param[0xe] = 0x7; 473 534 pNode->node.au32F00_param[0x12] = (0x27 << 16)|(0x4 << 8); … … 479 540 case 0x14: 480 541 pNode->node.name = "PCBEEP"; 481 pNode->node.au32F00_param[9] = (7 << 20) | RT_BIT(3) | RT_BIT(2); 542 pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_BEEP_GEN, 0, 0) 543 | CODEC_F00_09_CAP_AMP_FMT_OVERRIDE 544 | CODEC_F00_09_CAP_OUT_AMP_PRESENT;//(7 << 20) | RT_BIT(3) | RT_BIT(2); 482 545 pNode->node.au32F00_param[0x12] = (0x17 << 16)|(0x3 << 8)| 0x3; 483 546 pNode->pcbeep.u32F0a_param = 0; … … 486 549 case 0x15: 487 550 pNode->node.name = "CD"; 488 pNode->node.au32F00_param[0x9] = (4 << 20)|RT_BIT(0); 551 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0, 0) 552 | CODEC_F00_09_CAP_LSB;//(4 << 20)|RT_BIT(0); 489 553 pNode->node.au32F00_param[0xc] = RT_BIT(5); 490 554 pNode->cdnode.u32F07_param = 0; … … 499 563 case 0x16: 500 564 pNode->node.name = "VolumeKnob"; 501 pNode->node.au32F00_param[0x9] = (0x6 << 20);565 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_VOLUME_KNOB, 0x0, 0x0);//(0x6 << 20); 502 566 pNode->node.au32F00_param[0x13] = RT_BIT(7)| 0x7F; 503 567 pNode->node.au32F00_param[0xe] = 0x4; … … 516 580 memset(pNode->adcvol.B_params, 0, AMPLIFIER_SIZE); 517 581 518 pNode->node.au32F00_param[0x9] = (0x3 << 20)|RT_BIT(11)|RT_BIT(8)|RT_BIT(1)|RT_BIT(0); 582 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_SELECTOR, 0, 0) 583 | CODEC_F00_09_CAP_L_R_SWAP 584 | CODEC_F00_09_CAP_CONNECTION_LIST 585 | CODEC_F00_09_CAP_IN_AMP_PRESENT 586 | CODEC_F00_09_CAP_LSB;//(0x3 << 20)|RT_BIT(11)|RT_BIT(8)|RT_BIT(1)|RT_BIT(0); 519 587 pNode->node.au32F00_param[0xe] = 0x1; 520 588 AMPLIFIER_REGISTER(pNode->adcvol.B_params, AMPLIFIER_IN, AMPLIFIER_LEFT, 0) = RT_BIT(7); … … 524 592 case 0x19: 525 593 pNode->node.name = "Reserved_1"; 526 pNode->node.au32F00_param[0x9] = (0xF << 20)|(0x3 << 16)|RT_BIT(9)|RT_BIT(0); 594 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_VENDOR_DEFINED, 0x3, 0) 595 | CODEC_F00_09_CAP_DIGITAL 596 | CODEC_F00_09_CAP_LSB;//(0xF << 20)|(0x3 << 16)|RT_BIT(9)|RT_BIT(0); 527 597 break; 528 598 case 0x1A: 529 599 pNode->node.name = "Reserved_2"; 530 pNode->node.au32F00_param[0x9] = (0x3 << 16)|RT_BIT(9)|RT_BIT(0); 600 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_AUDIO_OUTPUT, 0x3, 0) 601 | CODEC_F00_09_CAP_DIGITAL 602 | CODEC_F00_09_CAP_LSB;//(0x3 << 16)|RT_BIT(9)|RT_BIT(0); 531 603 break; 532 604 case 0x1B: 533 605 pNode->node.name = "Reserved_3"; 534 pNode->node.au32F00_param[0x9] = (0x4 << 20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 606 pNode->node.au32F00_param[0x9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0, 0) 607 | CODEC_F00_09_CAP_DIGITAL 608 | CODEC_F00_09_CAP_CONNECTION_LIST 609 | CODEC_F00_09_CAP_LSB;//(0x4 << 20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 535 610 pNode->node.au32F00_param[0xE] = 0x1; 536 611 pNode->node.au32F00_param[0xC] = 0x10;
Note:
See TracChangeset
for help on using the changeset viewer.