VirtualBox

Changeset 31062 in vbox


Ignore:
Timestamp:
Jul 23, 2010 1:34:08 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63993
Message:

Audio/HDA: codecReset implementation.

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevCodec.cpp

    r31050 r31062  
    8989       CODEC_NID(cmd) == 0x12           \
    9090    || CODEC_NID(cmd) == 0x13)
     91
     92
     93static int stac9220ResetNode(struct CODECState *pState, uint8_t nodenum, PCODECNODE pNode);
     94
     95
    9196static int codecUnimplemented(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    9297{
     
    182187        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F20_param;
    183188    }
     189    return VINF_SUCCESS;
     190}
     191
     192static int codecReset(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     193{
     194    Assert((CODEC_CAD(cmd) == 0));
     195    Assert(STAC9220_IS_AFG_CMD(cmd));
     196    if(STAC9220_IS_AFG_CMD(cmd))
     197    {
     198        uint8_t i;
     199        Log(("HDAcodec: enters reset\n"));
     200        for (i = 0; i < STAC9220_NODE_COUNT; ++i)
     201        {
     202            stac9220ResetNode(pState, i, &pState->pNodes[i]);
     203        }
     204        pState->pfnReset(pState);
     205        Log(("HDAcodec: exits reset\n"));
     206    }
     207    *pResp = 0;
    184208    return VINF_SUCCESS;
    185209}
     
    263287            pNode->node.au32F00_param[0x12] = RT_BIT(31)|(0x2 << 16)|(0x7f << 8)|0x7f;
    264288            pNode->afg.u32F05_param = (0x2) << 4 | 0x2; /* PS-Act: 0x2, D2 */
    265             pNode->afg.u32F20_param = 0x106b0800; /* Old Intel Mac */
     289            pNode->afg.u32F20_param = 0x83847626; /*STAC9271X */
    266290            pNode->afg.u32F08_param = 0;
    267291            break;
     
    459483    {0x000F0200, CODEC_VERB_8BIT_CMD , codecGetF02       },
    460484    {0x000F2000, CODEC_VERB_8BIT_CMD , codecGetSubId     },
     485    {0x0007FF00, CODEC_VERB_8BIT_CMD , codecReset        },
    461486#if 0
    462487    {0x000F0500, CODEC_VERB_8BIT_CMD , codecGetPowerState},
  • trunk/src/VBox/Devices/Audio/DevCodec.h

    r31028 r31062  
    197197typedef struct CODECState
    198198{
     199    uint16_t                id;
    199200    CODECVERB               *pVerbs;
    200201    int                     cVerbs;
  • trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp

    r31042 r31062  
    11591159}
    11601160
     1161DECLCALLBACK(int) hdaCodecReset(CODECState *pCodecState)
     1162{
     1163    INTELHDLinkState *pState = (INTELHDLinkState *)pCodecState->pHDAState;
     1164    STATESTS(pState) |= 1 << (pCodecState->id);
     1165    INTSTS(pState) |= HDA_REG_FIELD_FLAG_MASK(INTSTS, CIS);
     1166    return VINF_SUCCESS;
     1167}
    11611168DECLCALLBACK(void) hdaTransfer(CODECState *pCodecState, ENMSOUNDSOURCE src, int avail)
    11621169{
     
    15311538        AssertRCReturn(rc, rc);
    15321539    hdaReset (pDevIns);
     1540    pThis->hda.Codec.id = 0;
    15331541    pThis->hda.Codec.pfnTransfer = hdaTransfer;
     1542    pThis->hda.Codec.pfnReset = hdaCodecReset;
    15341543    /*
    15351544     * 18.2.6,7 defines that values of this registers might be cleared on power on/reset
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette