Changeset 31984 in vbox for trunk/src/VBox
- Timestamp:
- Aug 26, 2010 12:15:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r31855 r31984 118 118 /* STAC9220 6.2 & 6.12 */ 119 119 #define STAC9220_IS_RESERVED_CMD(cmd) ( \ 120 CODEC_NID((cmd)) == 0x19 \ 120 CODEC_NID((cmd)) == 0x9 \ 121 || CODEC_NID((cmd)) == 0x19 \ 121 122 || CODEC_NID((cmd)) == 0x1A \ 122 123 || CODEC_NID((cmd)) == 0x1B) 124 125 #define CODEC_POWER_MASK 0x3 126 #define CODEC_POWER_ACT_SHIFT (4) 127 #define CODEC_POWER_SET_SHIFT (0) 128 #define CODEC_POWER_D0 (0) 129 #define CODEC_POWER_D1 (1) 130 #define CODEC_POWER_D2 (2) 131 #define CODEC_POWER_D3 (3) 132 #define CODEC_POWER_PROPOGATE_STATE(node) \ 133 do { \ 134 node.u32F05_param &= (CODEC_POWER_MASK); \ 135 node.u32F05_param |= (node.u32F05_param & CODEC_POWER_MASK) << CODEC_POWER_ACT_SHIFT; \ 136 }while(0) 123 137 124 138 static int stac9220ResetNode(struct CODECState *pState, uint8_t nodenum, PCODECNODE pNode); … … 637 651 if (!pu32Reg) 638 652 return VINF_SUCCESS; 639 *pu32Reg &= ~CODEC_VERB_8BIT_DATA; 653 654 if (!STAC9220_IS_AFG_CMD(cmd)) 655 { 656 *pu32Reg &= ~CODEC_VERB_8BIT_DATA; 657 *pu32Reg |= (pState->pNodes[1].afg.u32F05_param & (CODEC_VERB_4BIT_DATA << 4)); 658 } 659 else 660 *pu32Reg &= ~CODEC_VERB_4BIT_DATA; 661 640 662 *pu32Reg |= cmd & CODEC_VERB_4BIT_DATA; 641 *pu32Reg |= (cmd & CODEC_VERB_4BIT_DATA) << 4; 663 /* Propogate next power state only if AFG is on or verb modifies AFG power state */ 664 if ( STAC9220_IS_AFG_CMD(cmd) 665 || !pState->pNodes[1].afg.u32F05_param) 666 { 667 *pu32Reg &= ~(CODEC_POWER_MASK << CODEC_POWER_ACT_SHIFT); 668 *pu32Reg |= (cmd & CODEC_VERB_4BIT_DATA) << 4; 669 if ( STAC9220_IS_AFG_CMD(cmd) 670 && (cmd & CODEC_POWER_MASK) == CODEC_POWER_D0) 671 { 672 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[2].dac); 673 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[3].dac); 674 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[4].dac); 675 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[5].dac); 676 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[6].dac); 677 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[7].dac); 678 CODEC_POWER_PROPOGATE_STATE(pState->pNodes[0x11].dac); 679 } 680 } 642 681 return VINF_SUCCESS; 643 682 } … … 883 922 { 884 923 pNode->node.id = nodenum; 885 pNode->node.au32F00_param[0xF] = RT_BIT(3)|RT_BIT(0); /* Power statest Supported: D0-yes, D1, D2, D3-no*/924 pNode->node.au32F00_param[0xF] = 0; /* Power statest Supported: are the same as AFG reports */ 886 925 switch (nodenum) 887 926 { … … 897 936 case 1: 898 937 pNode->afg.node.name = "AFG"; 899 pNode->node.au32F00_param[4] = 2 << 16 | 0x1 7; /* starting node - 2; total numbers of nodes 0x17*/938 pNode->node.au32F00_param[4] = 2 << 16 | 0x1A; /* starting node - 2; total numbers of nodes 0x1A */ 900 939 pNode->node.au32F00_param[5] = RT_BIT(8)|RT_BIT(0); 901 940 pNode->node.au32F00_param[8] = RT_MAKE_U32_FROM_U8(0x0d, 0x0d, 0x01, 0x0); /* Capabilities */ 902 941 //pNode->node.au32F00_param[0xa] = RT_BIT(19)|RT_BIT(18)|RT_BIT(17)|RT_BIT(10)|RT_BIT(9)|RT_BIT(8)|RT_BIT(7)|RT_BIT(6)|RT_BIT(5); 903 pNode->node.au32F00_param[0x a] = RT_BIT(17)|RT_BIT(5);904 pNode->node.au32F00_param[0x c] = (17 << 8)|RT_BIT(6)|RT_BIT(5)|RT_BIT(2)|RT_BIT(1)|RT_BIT(0);905 pNode->node.au32F00_param[0x b] = RT_BIT(0);906 pNode->node.au32F00_param[0x d] = RT_BIT(31)|(0x5 << 16)|(0xE)<<8;942 pNode->node.au32F00_param[0xA] = RT_BIT(17)|RT_BIT(5); 943 pNode->node.au32F00_param[0xC] = (17 << 8)|RT_BIT(6)|RT_BIT(5)|RT_BIT(2)|RT_BIT(1)|RT_BIT(0); 944 pNode->node.au32F00_param[0xB] = RT_BIT(0); 945 pNode->node.au32F00_param[0xD] = RT_BIT(31)|(0x5 << 16)|(0xE)<<8; 907 946 pNode->node.au32F00_param[0x12] = RT_BIT(31)|(0x2 << 16)|(0x7f << 8)|0x7f; 908 947 pNode->node.au32F00_param[0x11] = 0; 909 pNode->node.au32F00_param[0xF] = RT_BIT(30)|RT_BIT(3)|RT_BIT(0); /* Power statest Supported: D0-yes, D1, D2, D3-no*/910 pNode->afg.u32F05_param = 0x 3 << 4| 0x3; /* PS-Act: D3, PS->Set D3 */948 pNode->node.au32F00_param[0xF] = 0xF; 949 pNode->afg.u32F05_param = 0x2 << 4| 0x2; /* PS-Act: D3, PS->Set D3 */ 911 950 pNode->afg.u32F20_param = 0x83847882; 912 951 pNode->afg.u32F08_param = 0; … … 930 969 AMPLIFIER_REGISTER(pNode->dac.B_params, AMPLIFIER_OUT, AMPLIFIER_RIGHT, 0) = 0x7F | RT_BIT(7); 931 970 932 pNode->dac.node.au32F00_param[9] = (0x f<< 16) | RT_BIT(11) | RT_BIT(10) | RT_BIT(2) | RT_BIT(0);971 pNode->dac.node.au32F00_param[9] = (0xD << 16) | RT_BIT(11) | RT_BIT(10) | RT_BIT(2) | RT_BIT(0); 933 972 pNode->dac.u32F0c_param = 0; 934 973 pNode->dac.u32F05_param = 0x3 << 4 | 0x3; /* PS-Act: D3, Set: D3 */ … … 962 1001 pNode->node.name = "Reserved_0"; 963 1002 pNode->spdifin.u32A_param = (0x1<<4) | 0x1; 964 pNode->spdifin.node.au32F00_param[9] = (0x1 << 20)|(4 << 16) | RT_BIT(9)|RT_BIT(4)|0x1; 965 pNode->node.au32F00_param[0xa] = RT_BIT(17)|RT_BIT(5); 1003 pNode->spdifin.node.au32F00_param[9] = (0x1 << 20)|(4 << 16) | RT_BIT(9)| RT_BIT(8)|RT_BIT(4)|0x1; 1004 pNode->node.au32F00_param[0xA] = RT_BIT(17)|RT_BIT(5); 1005 pNode->node.au32F00_param[0xE] = RT_BIT(0); 1006 pNode->node.au8F02_param[0] = 0x11; 966 1007 pNode->spdifin.node.au32F00_param[0xB] = RT_BIT(2)|RT_BIT(0); 967 1008 pNode->spdifin.u32F06_param = 0; … … 1033 1074 pNode->node.au32F00_param[9] = (4<<20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 1034 1075 pNode->node.au32F00_param[0xC] = RT_BIT(4); 1035 pNode->node.au32F00_param[0xE] = 0x 2;1076 pNode->node.au32F00_param[0xE] = 0x3; 1036 1077 pNode->digout.u32F01_param = 0; 1037 1078 /* STAC9220 spec defines default connection list containing reserved nodes, that confuses some drivers. */ 1038 *(uint32_t *)pNode->node.au8F02_param = RT_MAKE_U32_FROM_U8(0x08, 0x17, 0x 0, 0);1079 *(uint32_t *)pNode->node.au8F02_param = RT_MAKE_U32_FROM_U8(0x08, 0x17, 0x19, 0); 1039 1080 pNode->digout.u32F07_param = 0; 1040 1081 if (!pState->fInReset) … … 1108 1149 AMPLIFIER_REGISTER(pNode->adcvol.B_params, AMPLIFIER_IN, AMPLIFIER_RIGHT, 0) = RT_BIT(7); 1109 1150 pNode->adcvol.u32F0c_param = 0; 1151 break; 1152 case 0x19: 1153 pNode->node.name = "Reserved_1"; 1154 pNode->node.au32F00_param[0x9] = (0xF << 20)|(0x3 << 16)|RT_BIT(9)|RT_BIT(0); 1155 break; 1156 case 0x1A: 1157 pNode->node.name = "Reserved_2"; 1158 pNode->node.au32F00_param[0x9] = (0x3 << 16)|RT_BIT(9)|RT_BIT(0); 1159 break; 1160 case 0x1B: 1161 pNode->node.name = "Reserved_3"; 1162 pNode->node.au32F00_param[0x9] = (0x4 << 20)|RT_BIT(9)|RT_BIT(8)|RT_BIT(0); 1163 pNode->node.au32F00_param[0xE] = 0x1; 1164 pNode->node.au8F02_param[0] = 0x1a; 1165 break; 1110 1166 default: 1111 1167 break; … … 1181 1237 int rc = VINF_SUCCESS; 1182 1238 Assert(CODEC_CAD(cmd) == pState->id); 1239 if (STAC9220_IS_RESERVED_CMD(cmd)) 1240 { 1241 LogRel(("HDAcodec: cmd %x was addressed to reseved node\n", cmd)); 1242 } 1183 1243 if ( CODEC_VERBDATA(cmd) == 0 1184 || CODEC_NID(cmd) >= STAC9220_NODE_COUNT 1185 || STAC9220_IS_RESERVED_CMD(cmd)) 1244 || CODEC_NID(cmd) >= STAC9220_NODE_COUNT) 1186 1245 { 1187 1246 *pfn = codecUnimplemented;
Note:
See TracChangeset
for help on using the changeset viewer.