⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aticonfg.cpp

📁 winddk src目录下的WDM源码压缩!
💻 CPP
📖 第 1 页 / 共 5 页
字号:
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_4;
                                                break;

                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        case OEM_ID_FUJITSU:
                            m_uchDecoderAddress = 0x88;
                            switch( nOEMRevision)
                            {
                                case REVISION1:
                                    if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;

                                            default:
                                                bResult = FALSE;
                                                break;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        case OEM_ID_COMPAQ:
                            switch( nOEMRevision)
                            {
                                case REVISION1:
                                    if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_3;
                                                break;

                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;

                                            default:
                                                bResult = FALSE;
                                                break;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        case OEM_ID_BCM:
                        case OEM_ID_SAMSUNG:
                            switch( nOEMRevision)
                            {
                                case REVISION0:
                                    if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;

                                            default:
                                                bResult = FALSE;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        case OEM_ID_SAMREX:
                            switch( nOEMRevision)
                            {
                                case REVISION0:
                                    if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;

                                            default:
                                                bResult = FALSE;
                                                break;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        case OEM_ID_NEC:
                            switch( nOEMRevision)
                            {
                                case REVISION0:
                                case REVISION1:
                                    if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                    {
                                        switch( m_usDecoderId)
                                        {
                                            case VIDEODECODER_TYPE_BT829A:
                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;
                                                break;

                                            default:
                                                bResult = FALSE;
                                                break;
                                        }
                                    }
                                    else
                                        bResult = FALSE;
                                    break;

                                default:
                                    bResult = FALSE;
                                    break;
                            }
                            break;

                        default:
                                                        if( CMultimediaInfo.GetVideoDecoderId( &m_usDecoderId))
                                                        {
                                                            if( m_usDecoderId == VIDEODECODER_TYPE_RTHEATER)
                                                            {
                                                                // default the configuration to Toronto board
                                                                m_uiAudioConfiguration   = ATI_AUDIO_CONFIG_8;
                                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_UNDEFINED;

                                m_uchAudioAddress = 0x80;
                                                            }
                                                            else
                                                            {
                                                                // default the configuration to Kitchener board
                                                                m_uiAudioConfiguration   = ATI_AUDIO_CONFIG_7;
                                                                m_usDecoderConfiguration = ATI_VIDEODECODER_CONFIG_2;

                                m_uchAudioAddress = 0xB4;
                                                            }

                                                            bResult = TRUE;
                                                            
                                                        }
                                                        else
                                                            bResult = FALSE;

                            break;
                    }
                }

                m_VideoInStandardsSupported = SetVidStdBasedOnMMTable( &CMultimediaInfo );  //Paul

            } END_ENSURE;

            break;
    }
    
    OutputDebugInfo(( "CATIHwConfig:FindHardwareConfiguration() found:\n"));
    OutputDebugInfo(( "Tuner:   Id = %d, I2CAddress = 0x%x\n",
        m_usTunerId, m_uchTunerAddress));
    OutputDebugInfo(( "Decoder: Id = %d, I2CAddress = 0x%x, Configuration = %d\n",
        m_usDecoderId, m_uchDecoderAddress, m_usDecoderConfiguration));
    OutputDebugInfo(( "Audio:           I2CAddress = 0x%x, Configuration = %d\n",
        m_uchAudioAddress, m_uiAudioConfiguration));

    return( bResult);
}


/*^^*
 *      GetTunerConfiguration()
 * Purpose  : Gets tuner Id and i2C address
 * Inputs   :   PUINT  puiTunerId       : pointer to return tuner Id
 *              PUCHAR puchTunerAddress : pointer to return tuner I2C address
 *
 * Outputs  : BOOL : returns TRUE
 *              also sets the requested values into the input pointers
 * Author   : IKLEBANOV
 *^^*/
BOOL CATIHwConfiguration::GetTunerConfiguration( PUINT puiTunerId, PUCHAR puchTunerAddress)
{

    if(( puiTunerId != NULL) && ( puchTunerAddress != NULL))
    {
        * puiTunerId = ( UINT)m_usTunerId;
        * puchTunerAddress = m_uchTunerAddress;

        return( TRUE);
    }
    else
        return( FALSE);
}



/*^^*
 *      GetDecoderConfiguration()
 * Purpose  : Gets decoder Id and i2C address
 *
 * Inputs   :   puiDecoderId        : pointer to return Decoder Id
 *
 * Outputs  : BOOL : returns TRUE
 *              also sets the requested values into the input pointer
 * Author   : IKLEBANOV
 *^^*/
BOOL CATIHwConfiguration::GetDecoderConfiguration( PUINT puiDecoderId, PUCHAR puchDecoderAddress)
{

    if(( puiDecoderId != NULL) && ( puchDecoderAddress != NULL))
    {
        * puiDecoderId = ( UINT)m_usDecoderId;
        * puchDecoderAddress = m_uchDecoderAddress;

        return( TRUE);
    }
    else
        return( FALSE);
}



/*^^*
 *      GetAudioConfiguration()
 * Purpose  : Gets Audio solution Id and i2C address
 *
 * Inputs   : PUINT puiAudioConfiguration   : pointer to return Audio configuration Id
 *            PUCHAR puchAudioAddress       : pointer to return audio hardware
 *                                              I2C address
 *
 * Outputs  : BOOL : returns TRUE
 *              also sets the requested values into the input pointer
 * Author   : IKLEBANOV
 *^^*/
BOOL CATIHwConfiguration::GetAudioConfiguration( PUINT puiAudioConfiguration, PUCHAR puchAudioAddress)
{

    if(( puiAudioConfiguration != NULL) && ( puchAudioAddress != NULL))
    {
        * puiAudioConfiguration = ( UINT)m_uiAudioConfiguration;
        * puchAudioAddress = m_uchAudioAddress;

        return( TRUE);
    }
    else
        return( FALSE);
}



/*^^*
 *      InitializeAudioConfiguration()
 * Purpose  : Initializes Audio Chip with default / power up values. This function will
 *              be called at Low priority with i2CProvider locked
 *
 * Inputs   :   CI2CScript * pCScript       : pointer to the I2CScript object
 *              UINT uiAudioConfigurationId : detected Audio configuration
 *              UCHAR uchAudioChipAddress   : detected Audio chip I2C address
 * Outputs  : none
 * Author   : IKLEBANOV
 *^^*/
BOOL CATIHwConfiguration::InitializeAudioConfiguration( CI2CScript * pCScript, UINT uiAudioConfigurationId, UCHAR uchAudioChipAddress)
{
    I2CPacket i2cPacket;
    UCHAR uchWrite16Value[5];
#ifdef  I2S_CAPTURE
    UCHAR uchRead16Value[5];
#endif // I2S_CAPTURE
    BOOL        bResult;


    switch( uiAudioConfigurationId)
    {
        case ATI_AUDIO_CONFIG_2:
        case ATI_AUDIO_CONFIG_7:
            // TDA9850 has to be initialized with the values from I2C EEPROM, if
            // those answers the CheckSum. If not, take hardcoded default values
            {
                UINT    nIndex, nNumberOfRegs;
                PUCHAR  puchInitializationBuffer = NULL;
                UCHAR   uchWriteBuffer[2];
                
                bResult = FALSE;

                nNumberOfRegs = AUDIO_TDA9850_Reg_Align3 - AUDIO_TDA9850_Reg_Control1 + 1;

                puchInitializationBuffer = ( PUCHAR) \
                    ::ExAllocatePool( NonPagedPool, nNumberOfRegs * sizeof( PUCHAR));

                if( puchInitializationBuffer == NULL)
                    return( bResult);

                // fill in the Initialization buffer with the defaults values
                puchInitializationBuffer[0] = AUDIO_TDA9850_Control1_DefaultValue;
                puchInitializationBuffer[1] = AUDIO_TDA9850_Control2_DefaultValue;
                puchInitializationBuffer[2] = AUDIO_TDA9850_Control3_DefaultValue;
                puchInitializationBuffer[3] = AUDIO_TDA9850_Control4_DefaultValue;
                puchInitializationBuffer[4] = AUDIO_TDA9850_Align1_DefaultValue;
                puchInitializationBuffer[5] = AUDIO_TDA9850_Align2_DefaultValue;
                puchInitializationBuffer[6] = AUDIO_TDA9850_Align3_DefaultValue;

                // we have to see if anything in I2C EEPROM is waiting for us to
                // overwrite the default values
                if( ValidateConfigurationE2PROM( pCScript))
                {
                    // The configuration E2PROM kept its integrity. Let's read the
                    // initialization values from the device
                    ReadConfigurationE2PROM( pCScript, 3, &puchInitializationBuffer[4]);
                    ReadConfigurationE2PROM( pCScript, 4, &puchInitializationBuffer[5]);
                }

                // write the power-up defaults values into the chip
                i2cPacket.uchChipAddress = uchAudioChipAddress;
                i2cPacket.cbReadCount = 0;
                i2cPacket.cbWriteCount = 2;
                i2cPacket.puchReadBuffer = NULL;
                i2cPacket.puchWriteBuffer = uchWriteBuffer;
                i2cPacket.usFlags = I2COPERATION_WRITE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -