VirtualBox

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


Ignore:
Timestamp:
Jul 25, 2010 3:47:45 AM (14 years ago)
Author:
vboxsync
Message:

Audio/HDA: naming and formating.

File:
1 edited

Legend:

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

    r31077 r31083  
    9898       CODEC_NID((cmd)) == 0x10         \
    9999    || CODEC_NID((cmd)) == 0x11)
     100
     101#define STAC9220_IS_CD_CMD(cmd) (CODEC_NID((cmd)) == 0x15)
    100102
    101103/* STAC9220 6.2 & 6.12 */
     
    180182}
    181183
    182 static int codecGetF00(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     184static int codecGetParameter(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    183185{
    184186    Assert((CODEC_CAD(cmd) == pState->id));
     
    186188    return VINF_SUCCESS;
    187189}
    188 static int stac9220GetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     190static int codecGetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    189191{
    190192    if (STAC9220_IS_PORT_CMD(cmd))
    191     {
    192193        *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;
    194198    else
    195199        AssertMsgFailed(("Unsupported"));
     
    197201}
    198202
    199 static int stac9220SetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    200 {
     203static int codecSetPinCtrl(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
     204{
     205    uint32_t *pu32Reg = NULL;
     206    *pResp = 0;
    201207    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}
     220static int codecGetConnectionListEntry(struct CODECState *pState, uint32_t cmd, uint64_t *pResp)
    212221{
    213222    Assert((CODEC_CAD(cmd) == pState->id));
     
    588597/*    verb     | verb mask              | callback               */
    589598/*  -----------  --------------------   -----------------------  */
    590     {0x000F0000, CODEC_VERB_8BIT_CMD , codecGetF00},
    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 , codecGetF02      },
    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                  },
    607616#if 0
    608617    {0x000F0500, CODEC_VERB_8BIT_CMD , codecGetPowerState},
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