Changeset 33327 in vbox
- Timestamp:
- Oct 22, 2010 2:36:38 AM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r32933 r33327 95 95 unconst(pState->cTotalNodes) = 0x1C; 96 96 pState->pfnCodecNodeReset = stac9220ResetNode; 97 pState->u16VendorId = 0x8384; 98 pState->u16DeviceId = 0x7680; 97 99 pState->pNodes = (PCODECNODE)RTMemAllocZ(sizeof(CODECNODE) * pState->cTotalNodes); 98 100 pState->fInReset = false; … … 144 146 pNode->node.au32F00_param[0xD] = RT_BIT(31)|(0x5 << 16)|(0xE)<<8; 145 147 pNode->node.au32F00_param[0x12] = RT_BIT(31)|(0x2 << 16)|(0x7f << 8)|0x7f; 146 pNode->node.au32F00_param[0x11] = 0 ;148 pNode->node.au32F00_param[0x11] = 0xc0000004; 147 149 pNode->node.au32F00_param[0xF] = 0xF; 148 150 pNode->afg.u32F05_param = 0x2 << 4| 0x2; /* PS-Act: D3, PS->Set D3 */ 149 pNode->afg.u32F20_param = 0x83847882;151 pNode->afg.u32F20_param = pState->u16VendorId << 16 | pState->u16DeviceId; 150 152 pNode->afg.u32F08_param = 0; 153 pNode->afg.u32F17_param = 0; 151 154 break; 152 155 case 2: … … 212 215 pNode->node.au32F00_param[0xC] = 0x173f; 213 216 pNode->node.au32F02_param[0] = 0x2; 214 pNode->port.u32F07_param = RT_BIT(6);217 pNode->port.u32F07_param = 0xc0;//RT_BIT(6); 215 218 pNode->port.u32F08_param = 0; 216 219 pNode->port.u32F09_param = RT_BIT(31)|0x9920; /* 39.2 kOm */ … … 231 234 pNode->node.au32F02_param[0] = 0x3; 232 235 pNode->node.au32F00_param[0xC] = 0x1737; 233 pNode->port.u32F09_param = 0;234 236 pNode->port.u32F07_param = RT_BIT(5); 235 237 if (!pState->fInReset) … … 238 240 case 0xD: 239 241 pNode->node.name = "PortD"; 240 pNode->node.au32F00_param[0xC] = 0x173 f;241 pNode->port.u32F09_param = 0 ;242 pNode->node.au32F00_param[0xC] = 0x173c; 243 pNode->port.u32F09_param = 0x173f; 242 244 pNode->port.u32F07_param = RT_BIT(6); 243 245 pNode->node.au32F02_param[0] = 0x2; … … 245 247 pNode->port.u32F1c_param = 0x01013040; /* Line Out */ 246 248 port_init: 249 pNode->port.u32F09_param = RT_BIT(31)|0x7fffffff; 247 250 pNode->port.u32F08_param = 0; 248 251 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(0); … … 253 256 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(7)|RT_BIT(0); 254 257 pNode->port.u32F08_param = 0; 255 pNode->node.au32F00_param[0xC] = RT_BIT(5)|RT_BIT(2); 258 pNode->node.au32F00_param[0xC] = 0x34; 259 pNode->port.u32F09_param = 0; 260 //pNode->node.au32F00_param[0xC] = RT_BIT(5)|RT_BIT(2); 256 261 pNode->port.u32F07_param = RT_BIT(5); 257 pNode->port.u32F09_param = RT_BIT(31);262 //pNode->port.u32F09_param = RT_BIT(31); 258 263 if (!pState->fInReset) 259 264 pNode->port.u32F1c_param = RT_MAKE_U32_FROM_U8(0x50, 0x90, 0xA1, 0x02); /* Microphone */ … … 261 266 case 0xF: 262 267 pNode->node.name = "PortF"; 263 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT( 0);268 pNode->node.au32F00_param[9] = (4 << 20)|RT_BIT(8)|RT_BIT(7)|RT_BIT(2)|RT_BIT(0); 264 269 pNode->node.au32F00_param[0xC] = 0x37; 265 270 pNode->node.au32F00_param[0xE] = 0x1; 266 271 pNode->port.u32F08_param = 0; 267 pNode->port.u32F07_param = 0 ;272 pNode->port.u32F07_param = 0x40; 268 273 if (!pState->fInReset) 269 274 pNode->port.u32F1c_param = RT_MAKE_U32_FROM_U8(0x12, 0x60, 0x11, 0x01); 270 275 pNode->node.au32F02_param[0] = 0x5; 271 pNode->port.u32F09_param = 0 ;276 pNode->port.u32F09_param = 0x7fffffff; 272 277 break; 273 278 case 0x10: … … 286 291 pNode->node.name = "DigIn_0"; 287 292 pNode->node.au32F00_param[9] = (4 << 20)|(3<<16)|RT_BIT(10)|RT_BIT(9)|RT_BIT(7)|RT_BIT(0); 288 pNode->node.au32F00_param[0xC] = /* RT_BIT(16)|*/RT_BIT(5)|RT_BIT(2);293 pNode->node.au32F00_param[0xC] = RT_BIT(16)| RT_BIT(5)|RT_BIT(2); 289 294 pNode->digin.u32F05_param = 0x3 << 4 | 0x3; /* PS-Act: D3 -> D3 */ 290 295 pNode->digin.u32F07_param = 0; … … 363 368 pNode->node.au32F00_param[0x9] = (0x4 << 20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 364 369 pNode->node.au32F00_param[0xE] = 0x1; 370 pNode->node.au32F00_param[0xC] = 0x10; 365 371 pNode->node.au32F02_param[0] = 0x1a; 366 372 pNode->reserved.u32F07_param = 0; 367 pNode->reserved.u32F1c_param = 0x400000 fb; /* dumped from real stac9220 chip */373 pNode->reserved.u32F1c_param = 0x4000000f; 368 374 break; 369 375 default: … … 374 380 375 381 /* ALC885 */ 376 const static uint8_t au8Alc88 9aPorts[] = { 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0};377 const static uint8_t au8Alc88 9aDacs[] = { 0x2, 0x3, 0x4, 0x5, 0x25, 0};378 const static uint8_t au8Alc88 9aAdcs[] = { 0x7, 0x8, 0x9, 0};379 const static uint8_t au8Alc88 9aSpdifOuts[] = { 0x6, 0 };380 const static uint8_t au8Alc88 9aSpdifIns[] = { 0xA, 0 };381 const static uint8_t au8Alc88 9aDigOutPins[] = { 0x1E, 0 };382 const static uint8_t au8Alc88 9aDigInPins[] = { 0x1F, 0 };383 const static uint8_t au8Alc88 9aAdcVols[] = { 0xE, 0xF, 0xD, 0xC, 0x26, 0xB, 0};384 const static uint8_t au8Alc88 9aAdcMuxs[] = { 0x22, 0x23, 0x24, 0};385 const static uint8_t au8Alc88 9aPcbeeps[] = { 0x1D, 0 };386 const static uint8_t au8Alc88 9aCds[] = { 0x1C, 0 };387 const static uint8_t au8Alc88 9aVolKnobs[] = { 0x21, 0 };388 const static uint8_t au8Alc88 9aReserveds[] = { 0x10, 0x11, 0x12, 0x13, 0 };382 const static uint8_t au8Alc885Ports[] = { 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0}; 383 const static uint8_t au8Alc885Dacs[] = { 0x2, 0x3, 0x4, 0x5, 0x25, 0}; 384 const static uint8_t au8Alc885Adcs[] = { 0x7, 0x8, 0x9, 0}; 385 const static uint8_t au8Alc885SpdifOuts[] = { 0x6, 0 }; 386 const static uint8_t au8Alc885SpdifIns[] = { 0xA, 0 }; 387 const static uint8_t au8Alc885DigOutPins[] = { 0x1E, 0 }; 388 const static uint8_t au8Alc885DigInPins[] = { 0x1F, 0 }; 389 const static uint8_t au8Alc885AdcVols[] = { 0xE, 0xF, 0xD, 0xC, 0x26, 0xB, 0}; 390 const static uint8_t au8Alc885AdcMuxs[] = { 0x22, 0x23, 0x24, 0}; 391 const static uint8_t au8Alc885Pcbeeps[] = { 0x1D, 0 }; 392 const static uint8_t au8Alc885Cds[] = { 0x1C, 0 }; 393 const static uint8_t au8Alc885VolKnobs[] = { 0x21, 0 }; 394 const static uint8_t au8Alc885Reserveds[] = { 0x10, 0x11, 0x12, 0x13, 0 }; 389 395 390 396 … … 394 400 { 395 401 unconst(pState->cTotalNodes) = 0x27; 402 pState->u16VendorId = 0x10ec; 403 pState->u16DeviceId = 0x0885; 396 404 pState->pfnCodecNodeReset = alc885ResetNode; 397 405 pState->pNodes = (PCODECNODE)RTMemAllocZ(sizeof(CODECNODE) * pState->cTotalNodes); 398 406 pState->fInReset = false; 399 #define ALC885WIDGET(type) pState->au8##type##s = au8Alc88 9a##type##s407 #define ALC885WIDGET(type) pState->au8##type##s = au8Alc885##type##s 400 408 ALC885WIDGET(Port); 401 409 ALC885WIDGET(Dac); … … 435 443 pNode->node.au32F00_param[5] = RT_BIT(8) | 0x1; /* UnSol: enabled, function group type: AFG */ 436 444 pNode->node.au32F00_param[0xa] = 0xe0560; 437 pNode->afg.u32F20_param = 0x10ec0889;445 pNode->afg.u32F20_param = pState->u16VendorId << 16 | pState->u16DeviceId; 438 446 pNode->node.au32F00_param[0xB] = 0x1; 447 pNode->node.au32F00_param[0x11] = RT_BIT(30)|0x2; 439 448 break; 440 449 /* DACs */ … … 484 493 goto vendor_define_init; 485 494 case 0x11: 486 pNode->node.name = "VENDEF- 1";495 pNode->node.name = "VENDEF-0"; 487 496 goto vendor_define_init; 488 497 case 0x12: … … 512 521 break; 513 522 case 0x1F: 514 pNode->node.name = "DIG OUT-0";523 pNode->node.name = "DIGIN-0"; 515 524 pNode->node.au32F00_param[9] = 0x400200; 516 525 /* N = 0~3 */ … … 701 710 pNode->node.au32F00_param[0xD] = 0x80000000; 702 711 pNode->node.au32F00_param[0xE] = 0xb; 703 goto adc_mux_init;704 case 0x24:705 pNode->node.name = "AdcMux-2";706 pNode->node.au32F00_param[0x9] = 0x20010b;707 pNode->node.au32F00_param[0xD] = 0x80000000;708 pNode->node.au32F00_param[0xE] = 0xb;709 712 adc_mux_init: 710 713 /* N = 0~3 */ … … 723 726 pNode->node.au32F02_param[10] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0); 724 727 pNode->node.au32F02_param[11] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0); 728 break; 729 case 0x24: 730 pNode->node.name = "AdcMux-2"; 731 pNode->node.au32F00_param[0x9] = 0x20010b; 732 pNode->node.au32F00_param[0xD] = 0x80000000; 733 pNode->node.au32F00_param[0xE] = 0xb; 734 /* N = 0~3 */ 735 pNode->node.au32F02_param[0] = RT_MAKE_U32_FROM_U8(0x18, 0x19, 0x1A, 0x1B); 736 pNode->node.au32F02_param[1] = RT_MAKE_U32_FROM_U8(0x18, 0x19, 0x1A, 0x1B); 737 pNode->node.au32F02_param[2] = RT_MAKE_U32_FROM_U8(0x18, 0x19, 0x1A, 0x1B); 738 pNode->node.au32F02_param[3] = RT_MAKE_U32_FROM_U8(0x18, 0x19, 0x1A, 0x1B); 739 /* N = 4~7 */ 740 pNode->node.au32F02_param[4] = RT_MAKE_U32_FROM_U8(0x1C, 0x1D, 0x14, 0x15); 741 pNode->node.au32F02_param[5] = RT_MAKE_U32_FROM_U8(0x1C, 0x1D, 0x14, 0x15); 742 pNode->node.au32F02_param[6] = RT_MAKE_U32_FROM_U8(0x1C, 0x1D, 0x14, 0x15); 743 pNode->node.au32F02_param[7] = RT_MAKE_U32_FROM_U8(0x1C, 0x1D, 0x14, 0x15); 744 /* N = 8~11 */ 745 pNode->node.au32F02_param[8] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0x12); 746 pNode->node.au32F02_param[9] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0x12); 747 pNode->node.au32F02_param[10] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0x12); 748 pNode->node.au32F02_param[11] = RT_MAKE_U32_FROM_U8(0x16, 0x17, 0xB, 0x12); 725 749 break; 726 750 /* PCBEEP */ … … 985 1009 else if (codecIsAdcNode(pState, CODEC_NID(cmd))) 986 1010 *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F01_param; 1011 else if (codecIsAdcVolNode(pState, CODEC_NID(cmd))) 1012 *pResp = pState->pNodes[CODEC_NID(cmd)].adcvol.u32F01_param; 987 1013 return VINF_SUCCESS; 988 1014 } … … 1007 1033 else if (codecIsAdcNode(pState, CODEC_NID(cmd))) 1008 1034 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adc.u32F01_param; 1035 else if (codecIsAdcVolNode(pState, CODEC_NID(cmd))) 1036 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adcvol.u32F01_param; 1009 1037 Assert((pu32Reg)); 1010 1038 if (pu32Reg) … … 1032 1060 else if (codecIsCdNode(pState, CODEC_NID(cmd))) 1033 1061 *pResp = pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param; 1034 else if ( codecIsReservedNode(pState, CODEC_NID(cmd)) 1035 && CODEC_NID(cmd) == 0x1b) 1062 else if (codecIsPcbeepNode(pState, CODEC_NID(cmd))) 1063 *pResp = pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F07_param; 1064 else if (codecIsReservedNode(pState, CODEC_NID(cmd))) 1036 1065 *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F07_param; 1037 1066 else … … 1060 1089 else if (codecIsCdNode(pState, CODEC_NID(cmd))) 1061 1090 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param; 1091 else if (codecIsPcbeepNode(pState, CODEC_NID(cmd))) 1092 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F07_param; 1062 1093 else if ( codecIsReservedNode(pState, CODEC_NID(cmd)) 1063 && CODEC_NID(cmd) == 0x1b) 1094 && CODEC_NID(cmd) == 0x1b 1095 && pState->enmCodec == STAC9220_CODEC) 1064 1096 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F07_param; 1065 1097 Assert((pu32Reg)); … … 1088 1120 else if (codecIsVolKnobNode(pState, CODEC_NID(cmd))) 1089 1121 *pResp = pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param; 1122 else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd))) 1123 *pResp = pState->pNodes[CODEC_NID(cmd)].digout.u32F08_param; 1124 else if (codecIsDigInPinNode(pState, CODEC_NID(cmd))) 1125 *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param; 1090 1126 else 1091 1127 AssertMsgFailed(("unsupported operation %x on node: %x\n", CODEC_VERB_CMD8(cmd), CODEC_NID(cmd))); … … 1113 1149 else if (codecIsVolKnobNode(pState, CODEC_NID(cmd))) 1114 1150 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].volumeKnob.u32F08_param; 1151 else if (codecIsDigInPinNode(pState, CODEC_NID(cmd))) 1152 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F08_param; 1153 else if (codecIsDigOutPinNode(pState, CODEC_NID(cmd))) 1154 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digout.u32F08_param; 1115 1155 else 1116 1156 AssertMsgFailed(("unsupported operation %x on node: %x\n", CODEC_VERB_CMD8(cmd), CODEC_NID(cmd))); … … 1263 1303 } 1264 1304 1305 /* F20 */ 1265 1306 static int codecGetSubId(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1266 1307 { … … 1278 1319 } 1279 1320 return VINF_SUCCESS; 1321 } 1322 1323 static int codecSetSubIdX(struct CODECState *pState, uint32_t cmd, uint8_t u8Offset) 1324 { 1325 Assert((CODEC_CAD(cmd) == pState->id)); 1326 Assert((CODEC_NID(cmd) < pState->cTotalNodes)); 1327 if (CODEC_NID(cmd) >= pState->cTotalNodes) 1328 { 1329 Log(("HDAcodec: invalid node address %d\n", CODEC_NID(cmd))); 1330 return VINF_SUCCESS; 1331 } 1332 uint32_t *pu32Reg = NULL; 1333 if (CODEC_NID(cmd) == 0x1 /* AFG */) 1334 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].afg.u32F20_param; 1335 Assert((pu32Reg)); 1336 if (pu32Reg) 1337 codecSetRegisterU8(pu32Reg, cmd, u8Offset); 1338 return VINF_SUCCESS; 1339 } 1340 /* 720 */ 1341 static int codecSetSubId0 (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1342 { 1343 *pResp = 0; 1344 return codecSetSubIdX(pState, cmd, 0); 1345 } 1346 1347 /* 721 */ 1348 static int codecSetSubId1 (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1349 { 1350 *pResp = 0; 1351 return codecSetSubIdX(pState, cmd, 8); 1352 } 1353 /* 722 */ 1354 static int codecSetSubId2 (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1355 { 1356 *pResp = 0; 1357 return codecSetSubIdX(pState, cmd, 16); 1358 } 1359 /* 723 */ 1360 static int codecSetSubId3 (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1361 { 1362 *pResp = 0; 1363 return codecSetSubIdX(pState, cmd, 24); 1280 1364 } 1281 1365 … … 1319 1403 else if (codecIsAdcNode(pState, CODEC_NID(cmd))) 1320 1404 *pResp = pState->pNodes[CODEC_NID(cmd)].adc.u32F05_param; 1405 else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd))) 1406 *pResp = pState->pNodes[CODEC_NID(cmd)].spdifout.u32F05_param; 1407 else if (codecIsSpdifInNode(pState, CODEC_NID(cmd))) 1408 *pResp = pState->pNodes[CODEC_NID(cmd)].spdifin.u32F05_param; 1409 else if (codecIsReservedNode(pState, CODEC_NID(cmd))) 1410 *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F05_param; 1321 1411 return VINF_SUCCESS; 1322 1412 } … … 1342 1432 else if (codecIsAdcNode(pState, CODEC_NID(cmd))) 1343 1433 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].adc.u32F05_param; 1434 else if (codecIsSpdifOutNode(pState, CODEC_NID(cmd))) 1435 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].spdifout.u32F05_param; 1436 else if (codecIsSpdifInNode(pState, CODEC_NID(cmd))) 1437 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].spdifin.u32F05_param; 1438 else if (codecIsReservedNode(pState, CODEC_NID(cmd))) 1439 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F05_param; 1344 1440 Assert((pu32Reg)); 1345 1441 if (!pu32Reg) … … 1548 1644 } 1549 1645 1646 /* F17 */ 1647 static int codecGetGPIOUnsolisted (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1648 { 1649 Assert((CODEC_CAD(cmd) == pState->id)); 1650 Assert((CODEC_NID(cmd) < pState->cTotalNodes)); 1651 if (CODEC_NID(cmd) >= pState->cTotalNodes) 1652 { 1653 Log(("HDAcodec: invalid node address %d\n", CODEC_NID(cmd))); 1654 return VINF_SUCCESS; 1655 } 1656 *pResp = 0; 1657 /* note: this is true for ALC885 */ 1658 if (CODEC_NID(cmd) == 0x1 /* AFG */) 1659 *pResp = pState->pNodes[1].afg.u32F17_param; 1660 return VINF_SUCCESS; 1661 } 1662 1663 /* 717 */ 1664 static int codecSetGPIOUnsolisted (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 1665 { 1666 Assert((CODEC_CAD(cmd) == pState->id)); 1667 Assert((CODEC_NID(cmd) < pState->cTotalNodes)); 1668 if (CODEC_NID(cmd) >= pState->cTotalNodes) 1669 { 1670 Log(("HDAcodec: invalid node address %d\n", CODEC_NID(cmd))); 1671 return VINF_SUCCESS; 1672 } 1673 uint32_t *pu32Reg = NULL; 1674 *pResp = 0; 1675 if (CODEC_NID(cmd) == 1 /* AFG */) 1676 pu32Reg = &pState->pNodes[1].afg.u32F17_param; 1677 Assert((pu32Reg)); 1678 if (pu32Reg) 1679 codecSetRegisterU8(pu32Reg, cmd, 0); 1680 return VINF_SUCCESS; 1681 } 1682 1550 1683 /* F1C */ 1551 1684 static int codecGetConfig (struct CODECState *pState, uint32_t cmd, uint64_t *pResp) … … 1565 1698 else if (codecIsDigInPinNode(pState, CODEC_NID(cmd))) 1566 1699 *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F1c_param; 1700 else if (codecIsPcbeepNode(pState, CODEC_NID(cmd))) 1701 *pResp = pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param; 1567 1702 else if (codecIsCdNode(pState, CODEC_NID(cmd))) 1568 1703 *pResp = pState->pNodes[CODEC_NID(cmd)].cdnode.u32F1c_param; 1704 else if (codecIsReservedNode(pState, CODEC_NID(cmd))) 1705 *pResp = pState->pNodes[CODEC_NID(cmd)].reserved.u32F1c_param; 1569 1706 return VINF_SUCCESS; 1570 1707 } … … 1587 1724 else if (codecIsCdNode(pState, CODEC_NID(cmd))) 1588 1725 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].cdnode.u32F1c_param; 1589 else if ( CODEC_NID(cmd) == 0x1B 1590 && pState->enmCodec == STAC9220_CODEC) 1726 else if (codecIsPcbeepNode(pState, CODEC_NID(cmd))) 1727 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].pcbeep.u32F1c_param; 1728 else if (codecIsReservedNode(pState, CODEC_NID(cmd))) 1591 1729 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].reserved.u32F1c_param; 1592 1730 Assert((pu32Reg)); … … 1666 1804 {0x00070E00, CODEC_VERB_8BIT_CMD , codecSetDigitalConverter2 }, 1667 1805 {0x000F2000, CODEC_VERB_8BIT_CMD , codecGetSubId }, 1806 {0x00072000, CODEC_VERB_8BIT_CMD , codecSetSubId0 }, 1807 {0x00072100, CODEC_VERB_8BIT_CMD , codecSetSubId1 }, 1808 {0x00072200, CODEC_VERB_8BIT_CMD , codecSetSubId2 }, 1809 {0x00072300, CODEC_VERB_8BIT_CMD , codecSetSubId3 }, 1668 1810 {0x0007FF00, CODEC_VERB_8BIT_CMD , codecReset }, 1669 1811 {0x000F0500, CODEC_VERB_8BIT_CMD , codecGetPowerState }, … … 1673 1815 {0x000F0F00, CODEC_VERB_8BIT_CMD , codecGetVolumeKnobCtrl }, 1674 1816 {0x00070F00, CODEC_VERB_8BIT_CMD , codecSetVolumeKnobCtrl }, 1817 {0x000F1700, CODEC_VERB_8BIT_CMD , codecGetGPIOUnsolisted }, 1818 {0x00071700, CODEC_VERB_8BIT_CMD , codecSetGPIOUnsolisted }, 1675 1819 {0x000F1C00, CODEC_VERB_8BIT_CMD , codecGetConfig }, 1676 1820 {0x00071C00, CODEC_VERB_8BIT_CMD , codecSetConfig0 }, … … 1800 1944 { 1801 1945 SSMR3GetMem (pSSMHandle, pCodecState->pNodes, sizeof(CODECNODE) * pCodecState->cTotalNodes); 1802 codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME); 1946 if (codecIsDacNode(pCodecState, pCodecState->u8DacLineOut)) 1947 codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME); 1948 else if (codecIsSpdifOutNode(pCodecState, pCodecState->u8DacLineOut)) 1949 codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].spdifout.B_params, AUD_MIXER_VOLUME); 1803 1950 codecToAudVolume(&pCodecState->pNodes[pCodecState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN); 1804 1951 return VINF_SUCCESS; -
trunk/src/VBox/Devices/Audio/DevCodec.h
r32933 r33327 88 88 { 89 89 CODECCOMMONNODE node; 90 uint32_t u32F05_param; 90 91 uint32_t u32F06_param; 91 92 uint32_t u32F09_param; … … 99 100 { 100 101 CODECCOMMONNODE node; 102 uint32_t u32F05_param; 101 103 uint32_t u32F06_param; 102 104 uint32_t u32F09_param; … … 113 115 uint32_t u32F08_param; 114 116 uint32_t u32F20_param; 117 uint32_t u32F17_param; 115 118 } AFGCODECNODE, *PAFGCODECNODE; 116 119 … … 130 133 CODECCOMMONNODE node; 131 134 uint32_t u32F01_param; 135 uint32_t u32F08_param; 132 136 uint32_t u32F07_param; 133 137 uint32_t u32F09_param; … … 159 163 { 160 164 CODECCOMMONNODE node; 165 uint32_t u32F07_param; 161 166 uint32_t u32F0a_param; 162 167 163 168 uint32_t u32A_param; 164 169 AMPLIFIER B_params; 170 uint32_t u32F1c_param; 165 171 } PCBEEPNODE, *PPCBEEPNODE; 166 172 … … 183 189 CODECCOMMONNODE node; 184 190 uint32_t u32F0c_param; 191 uint32_t u32F01_param; 185 192 uint32_t u32A_params; 186 193 AMPLIFIER B_params; … … 190 197 { 191 198 CODECCOMMONNODE node; 199 uint32_t u32F05_param; 200 uint32_t u32F06_param; 192 201 uint32_t u32F07_param; 193 uint32_t u32F06_param;194 202 uint32_t u32F1c_param; 195 203 } RESNODE, *PRESNODE; … … 231 239 { 232 240 uint16_t id; 241 uint16_t u16VendorId; 242 uint16_t u16DeviceId; 233 243 CODECVERB *pVerbs; 234 244 int cVerbs; -
trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
r33236 r33327 40 40 #define USE_MIXER 41 41 #endif 42 #define VBOX_WITH_INTEL_HDA 42 43 43 44 #define HDA_SSM_VERSION 1 … … 653 654 if (RT_FAILURE(rc)) 654 655 AssertRCReturn(rc, rc); 656 #ifdef DEBUG_CMD_BUFFER 655 657 uint8_t i = 0; 656 658 do … … 673 675 i += 8; 674 676 } while(i != 0); 677 #endif 675 678 } 676 679 else … … 680 683 if (RT_FAILURE(rc)) 681 684 AssertRCReturn(rc, rc); 685 #ifdef DEBUG_CMD_BUFFER 682 686 uint8_t i = 0; 683 687 do { … … 695 699 i += 8; 696 700 } while (i != 0); 701 #endif 697 702 } 698 703 return rc; 699 704 } 700 701 #if 0702 static int hdaUnsolictedResponse(INTELHDLinkState *pState, uint64_t pu64UnsolictedResponse)703 {704 uint8_t rirbWp;705 if (!HDA_REG_FLAG_VALUE(pState, GCTL, UR))706 {707 Log(("hda: unsolicited response %016lx is ignored\n"));708 return VINF_SUCCESS;709 }710 }711 #endif712 705 713 706 static int hdaCORBCmdProcess(INTELHDLinkState *pState) … … 1346 1339 pBdle->u32BdleCvi++; 1347 1340 if (pBdle->u32BdleCvi == pBdle->u32BdleMaxCvi + 1) 1341 { 1348 1342 pBdle->u32BdleCvi = 0; 1343 } 1349 1344 fStop = true; /* Give the guest a chance to refill (or empty) buffers. */ 1350 1351 /* Read the next BDE unless we're exiting. */1352 if (!fStop)1353 fetch_bd(pState, pBdle, u64BaseDMA);1354 1345 } 1355 1346 } … … 1663 1654 1664 1655 /* PCI Device (the assertions will be removed later) */ 1665 #if 1 1656 #if defined(VBOX_WITH_HP_HDA) 1657 /* Linux kernel has whitelist for MSI-enabled HDA, this card seems to be there. */ 1658 PCIDevSetVendorId (&pThis->dev, 0x103c); /* HP. */ 1659 PCIDevSetDeviceId (&pThis->dev, 0x30f7); /* HP Pavilion dv4t-1300 */ 1660 #elif defined(VBOX_WITH_INTEL_HDA) 1666 1661 PCIDevSetVendorId (&pThis->dev, 0x8086); /* 00 ro - intel. */ 1667 1662 PCIDevSetDeviceId (&pThis->dev, 0x2668); /* 02 ro - 82801 / 82801aa(?). */ 1663 #elif defined(VBOX_WITH_NVIDIA_HDA) 1664 PCIDevSetVendorId (&pThis->dev, 0x10de); /* nVidia */ 1665 PCIDevSetDeviceId (&pThis->dev, 0x0ac0); /* HDA */ 1668 1666 #else 1669 PCIDevSetVendorId (&pThis->dev, 0x10de); /* nVidia */ 1670 PCIDevSetDeviceId (&pThis->dev, 0x0028); /* HDA */ 1667 # error "Please specify your HDA device vendor/device IDs" 1671 1668 #endif 1672 1669 PCIDevSetCommand (&pThis->dev, 0x0000); /* 04 rw,ro - pcicmd. */ … … 1679 1676 PCIDevSetBaseAddress (&pThis->dev, 0, /* 10 rw - MMIO */ 1680 1677 false /* fIoSpace */, false /* fPrefetchable */, true /* f64Bit */, 0x00000000); 1681 /* ICH6 datasheet defines 0 values for SVID and SID (18.1.14-15), which together with values returned for1682 verb F20 should provide device/codec recognition. */1683 PCIDevSetSubSystemVendorId (&pThis->dev, 0x0000); /* 2c ro - intel.) */1684 PCIDevSetSubSystemId (&pThis->dev, 0x0000); /* 2e ro. */1685 1678 PCIDevSetInterruptLine (&pThis->dev, 0x00); /* 3c rw. */ 1686 1679 PCIDevSetInterruptPin (&pThis->dev, 0x01); /* 3d ro - INTA#. */ … … 1796 1789 1797 1790 pThis->hda.Codec.pHDAState = (void *)&pThis->hda; 1798 rc = codecConstruct(&pThis->hda.Codec, STAC9220_CODEC);1791 rc = codecConstruct(&pThis->hda.Codec, /* ALC885_CODEC */ STAC9220_CODEC); 1799 1792 if (RT_FAILURE(rc)) 1800 1793 AssertRCReturn(rc, rc); 1794 1795 /* ICH6 datasheet defines 0 values for SVID and SID (18.1.14-15), which together with values returned for 1796 verb F20 should provide device/codec recognition. */ 1797 Assert(pThis->hda.Codec.u16VendorId); 1798 Assert(pThis->hda.Codec.u16DeviceId); 1799 PCIDevSetSubSystemVendorId (&pThis->dev, pThis->hda.Codec.u16VendorId); /* 2c ro - intel.) */ 1800 PCIDevSetSubSystemId (&pThis->dev, pThis->hda.Codec.u16DeviceId); /* 2e ro. */ 1801 1801 1802 hdaReset (pDevIns); 1802 1803 pThis->hda.Codec.id = 0;
Note:
See TracChangeset
for help on using the changeset viewer.