VirtualBox

Changeset 31050 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Jul 23, 2010 11:46:58 AM (14 years ago)
Author:
vboxsync
Message:

Audio/HDA: F20 verb returns mac-intel subId value.

File:
1 edited

Legend:

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

    r31048 r31050  
    6464#define STAC9220_NODE_COUNT 0x1C
    6565
     66#define STAC9220_IS_AFG_CMD(cmd) (  \
     67        CODEC_NID(cmd) == 0x1        \
     68    )
    6669#define STAC9220_IS_PORT_CMD(cmd) (  \
    6770           CODEC_NID(cmd) == 0xA    \
     
    171174    return VINF_SUCCESS;
    172175}
     176
     177static int codecGetSubId(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     178{
     179    Assert((CODEC_CAD(cmd) == 0));
     180    if (STAC9220_IS_AFG_CMD(cmd))
     181    {
     182        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F20_param;
     183    }
     184    return VINF_SUCCESS;
     185}
     186
     187#if 0
     188static int codecGetPowerState(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     189{
     190    Assert((CODEC_CAD(cmd) == 0));
     191    if (STAC9220_IS_AFG_CMD(cmd))
     192    {
     193        *pResp = pState->pNodes[CODEC_NID(cmd)].afg.u32F05_param;
     194    }
     195    return VINF_SUCCESS;
     196}
     197#endif
    173198static int stac9220Set706(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    174199{
     
    237262            pNode->node.au32F00_param[0xd] = RT_BIT(31)|(0x5 << 16)|(0xE)<<8;
    238263            pNode->node.au32F00_param[0x12] = RT_BIT(31)|(0x2 << 16)|(0x7f << 8)|0x7f;
    239             pNode->afg.u32F05_param = RT_MAKE_U32_FROM_U8(0x02, 0x02, 0x00, 0x0); /* Power State */
     264            pNode->afg.u32F05_param = (0x2) << 4 | 0x2; /* PS-Act: 0x2, D2 */
     265            pNode->afg.u32F20_param = 0x106b0800; /* Old Intel Mac */
    240266            pNode->afg.u32F08_param = 0;
    241267            break;
     
    425451/*    verb     | verb mask              | callback               */
    426452/*  -----------  --------------------   -----------------------  */
    427     {0x000F0000, CODEC_VERB_8BIT_CMD, codecGetF00},
     453    {0x000F0000, CODEC_VERB_8BIT_CMD , codecGetF00},
    428454    {0x00020000, CODEC_VERB_16BIT_CMD, codecSetConverterFormat},
    429455    {0x000B0000, CODEC_VERB_16BIT_CMD, codecGetAmplifier },
    430     {0x00070600, CODEC_VERB_8BIT_CMD,  stac9220Set706    },
    431     {0x000F0700, CODEC_VERB_8BIT_CMD,  stac9220SetPinCtrl},
    432     {0x00070700, CODEC_VERB_8BIT_CMD,  stac9220GetPinCtrl},
    433     {0x000F0200, CODEC_VERB_8BIT_CMD,  codecGetF02       },
     456    {0x00070600, CODEC_VERB_8BIT_CMD , stac9220Set706    },
     457    {0x000F0700, CODEC_VERB_8BIT_CMD , stac9220SetPinCtrl},
     458    {0x00070700, CODEC_VERB_8BIT_CMD , stac9220GetPinCtrl},
     459    {0x000F0200, CODEC_VERB_8BIT_CMD , codecGetF02       },
     460    {0x000F2000, CODEC_VERB_8BIT_CMD , codecGetSubId     },
     461#if 0
     462    {0x000F0500, CODEC_VERB_8BIT_CMD , codecGetPowerState},
     463#endif
    434464};
    435465
     
    441471    {
    442472        *pfn = CODEC_CAD(cmd) != 0 ? codecUnimplemented : codecBreak;
    443         //** @todo r=michaln: Why "intelHD" and not e.g. "HDAcodec"?
    444473        //** @todo r=michaln: There needs to be a counter to avoid log flooding (see e.g. DevRTC.cpp)
    445         LogRel(("intelHD: cmd %x was ignored\n", cmd));
     474        LogRel(("HDAcodec: cmd %x was ignored\n", cmd));
    446475        return VINF_SUCCESS;
    447476    }
     
    455484    }
    456485    *pfn = codecUnimplemented;
    457     LogRel(("intelHD: callback for %x wasn't found\n", CODEC_VERBDATA(cmd)));
     486    LogRel(("HDAcodec: callback for %x wasn't found\n", CODEC_VERBDATA(cmd)));
    458487    return rc;
    459488}
     
    554583    pState->voice_mc = AUD_open_in(&pState->card, pState->voice_mc, "hda.mc", pState, mc_callback, &as);
    555584    if (!pState->voice_pi)
    556         LogRel (("intelHD: WARNING: Unable to open PCM IN!\n"));
     585        LogRel (("HDAcodec: WARNING: Unable to open PCM IN!\n"));
    557586    if (!pState->voice_mc)
    558         LogRel (("intelHD: WARNING: Unable to open PCM MC!\n"));
     587        LogRel (("HDAcodec: WARNING: Unable to open PCM MC!\n"));
    559588    if (!pState->voice_po)
    560         LogRel (("intelHD: WARNING: Unable to open PCM OUT!\n"));
     589        LogRel (("HDAcodec: WARNING: Unable to open PCM OUT!\n"));
    561590    int mute = 0;
    562591    uint8_t lvol = 0x7f;
Note: See TracChangeset for help on using the changeset viewer.

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