Changeset 31083 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jul 25, 2010 3:47:45 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r31077 r31083 98 98 CODEC_NID((cmd)) == 0x10 \ 99 99 || CODEC_NID((cmd)) == 0x11) 100 101 #define STAC9220_IS_CD_CMD(cmd) (CODEC_NID((cmd)) == 0x15) 100 102 101 103 /* STAC9220 6.2 & 6.12 */ … … 180 182 } 181 183 182 static int codecGet F00(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)184 static int codecGetParameter(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 183 185 { 184 186 Assert((CODEC_CAD(cmd) == pState->id)); … … 186 188 return VINF_SUCCESS; 187 189 } 188 static int stac9220GetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)190 static int codecGetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 189 191 { 190 192 if (STAC9220_IS_PORT_CMD(cmd)) 191 {192 193 *pResp = pState->pNodes[CODEC_NID(cmd)].port.u32F07_param; 193 } 194 else if (STAC9220_IS_DIGPIN_CMD(cmd)) 195 *pResp = pState->pNodes[CODEC_NID(cmd)].digin.u32F07_param; 196 else if (STAC9220_IS_CD_CMD(cmd)) 197 *pResp = pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param; 194 198 else 195 199 AssertMsgFailed(("Unsupported")); … … 197 201 } 198 202 199 static int stac9220SetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 200 { 203 static int codecSetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 204 { 205 uint32_t *pu32Reg = NULL; 206 *pResp = 0; 201 207 if (STAC9220_IS_PORT_CMD(cmd)) 202 { 203 pState->pNodes[CODEC_NID(cmd)].port.u32F07_param &= ~CODEC_VERB_8BIT_DATA; 204 pState->pNodes[CODEC_NID(cmd)].port.u32F07_param |= cmd & CODEC_VERB_8BIT_DATA; 205 } 206 else 207 AssertMsgFailed(("Unsupported")); 208 *pResp = 0; 209 return VINF_SUCCESS; 210 } 211 static int codecGetF02(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 208 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].port.u32F07_param; 209 else if (STAC9220_IS_DIGPIN_CMD(cmd)) 210 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].digin.u32F07_param; 211 else if (STAC9220_IS_CD_CMD(cmd)) 212 pu32Reg = &pState->pNodes[CODEC_NID(cmd)].cdnode.u32F07_param; 213 Assert((pu32Reg)); 214 if (!pu32Reg) 215 return VINF_SUCCESS; 216 *pu32Reg = (*pu32Reg) & ~CODEC_VERB_8BIT_DATA; 217 *pu32Reg = (*pu32Reg) | (cmd & CODEC_VERB_8BIT_DATA); 218 return VINF_SUCCESS; 219 } 220 static int codecGetConnectionListEntry(struct CODECState *pState, uint32_t cmd, uint64_t *pResp) 212 221 { 213 222 Assert((CODEC_CAD(cmd) == pState->id)); … … 588 597 /* verb | verb mask | callback */ 589 598 /* ----------- -------------------- ----------------------- */ 590 {0x000F0000, CODEC_VERB_8BIT_CMD , codecGet F00},591 {0x000A0000, CODEC_VERB_16BIT_CMD, codecGetConverterFormat },592 {0x00020000, CODEC_VERB_16BIT_CMD, codecSetConverterFormat },593 {0x000B0000, CODEC_VERB_16BIT_CMD, codecGetAmplifier },594 {0x00030000, CODEC_VERB_16BIT_CMD, codecSetAmplifier },595 {0x00070600, CODEC_VERB_8BIT_CMD , codecSetStreamId },596 {0x000F0600, CODEC_VERB_8BIT_CMD , codecGetStreamId },597 {0x000F0700, CODEC_VERB_8BIT_CMD , stac9220GetPinCtrl},598 {0x00070700, CODEC_VERB_8BIT_CMD , stac9220SetPinCtrl},599 {0x000F0200, CODEC_VERB_8BIT_CMD , codecGet F02},600 {0x000F0300, CODEC_VERB_8BIT_CMD , codecGetProcessingState },601 {0x00070300, CODEC_VERB_8BIT_CMD , codecSetProcessingState },602 {0x000F0D00, CODEC_VERB_8BIT_CMD , codecGetDigitalConverter },603 {0x00070D00, CODEC_VERB_8BIT_CMD , codecSetDigitalConverter1 },604 {0x00070E00, CODEC_VERB_8BIT_CMD , codecSetDigitalConverter2 },605 {0x000F2000, CODEC_VERB_8BIT_CMD , codecGetSubId },606 {0x0007FF00, CODEC_VERB_8BIT_CMD , codecReset },599 {0x000F0000, CODEC_VERB_8BIT_CMD , codecGetParameter }, 600 {0x000A0000, CODEC_VERB_16BIT_CMD, codecGetConverterFormat }, 601 {0x00020000, CODEC_VERB_16BIT_CMD, codecSetConverterFormat }, 602 {0x000B0000, CODEC_VERB_16BIT_CMD, codecGetAmplifier }, 603 {0x00030000, CODEC_VERB_16BIT_CMD, codecSetAmplifier }, 604 {0x00070600, CODEC_VERB_8BIT_CMD , codecSetStreamId }, 605 {0x000F0600, CODEC_VERB_8BIT_CMD , codecGetStreamId }, 606 {0x000F0700, CODEC_VERB_8BIT_CMD , codecGetPinCtrl }, 607 {0x00070700, CODEC_VERB_8BIT_CMD , codecSetPinCtrl }, 608 {0x000F0200, CODEC_VERB_8BIT_CMD , codecGetConnectionListEntry }, 609 {0x000F0300, CODEC_VERB_8BIT_CMD , codecGetProcessingState }, 610 {0x00070300, CODEC_VERB_8BIT_CMD , codecSetProcessingState }, 611 {0x000F0D00, CODEC_VERB_8BIT_CMD , codecGetDigitalConverter }, 612 {0x00070D00, CODEC_VERB_8BIT_CMD , codecSetDigitalConverter1 }, 613 {0x00070E00, CODEC_VERB_8BIT_CMD , codecSetDigitalConverter2 }, 614 {0x000F2000, CODEC_VERB_8BIT_CMD , codecGetSubId }, 615 {0x0007FF00, CODEC_VERB_8BIT_CMD , codecReset }, 607 616 #if 0 608 617 {0x000F0500, CODEC_VERB_8BIT_CMD , codecGetPowerState},
Note:
See TracChangeset
for help on using the changeset viewer.