/////////////////////////////////////////////////////////////////////////////
//!
//! Function Name:	AUDIO_GetParmMMAccessPtr
//!
//! Description:	audio parm multimedia acces for FUSE AP only
//!
/////////////////////////////////////////////////////////////////////////////
static SysIndMultimediaAudioParm_t* AUDIO_GetParmMMAccessPtr(void)
{
#ifdef BSP_ONLY_BUILD
	return NULL;
#else
	return APSYSPARM_GetMultimediaAudioParmAccessPtr();
#endif
}
Example #2
0
//******************************************************************************
//
// Function Name: sysparm_init
//
// Description:   Start system parameter driver initialise
//
//
// Notes:
//
//******************************************************************************
static int sysparm_init(void)
{
    int rc;
    int sysparm_ready_count = 0;
    
    pr_info("[sysparm]: System parameter driver start..\n");

    if(fuse_sysparm_initialised)
    {
	    pr_info("[sysparm]: init already done\n");
	    return 0;
    }
    
    sys_data_dep = ioremap_nocache(PARM_DEP_BASE, PARM_DEP_SIZE);
    if (!sys_data_dep) 
    {
        rc = -ENOMEM;
        pr_err("[sysparm]: PARM_DEP_BASE ioremap failed\n");
        goto out;
    }
    
    sysparm_ready_ind_ptr = (UInt32*)(sys_data_dep + 0x4000);
    
    while(SYSPARM_INDEX_READY_INDICATOR != *sysparm_ready_ind_ptr)
    {
        if(sysparm_ready_count >= 5)
            goto out_unmap;
            
        mdelay(25);
        sysparm_ready_count++;
    }

    
    total_index_ptr = (UInt32*)((UInt32)sysparm_ready_ind_ptr + sizeof(sysparm_ready_ind_ptr));
    sysparm_index = (SysparmIndex_t*)((UInt32)total_index_ptr + sizeof(total_index_ptr));
    
    pr_info("[sysparm]: sysparm_init ok\n");
    fuse_sysparm_initialised = 1;
    
#ifdef SYSPARM_DEBUG
    {
        int i;
        UInt16 tmp;

        SysIndMultimediaAudioParm_t* pMMAudioTmp; 
        SysAudioParm_t* pAudioTmp;
        pr_info("[sysparm] audio parm table size: 0x%x bytes\n",sizeof(audio_parm_table) );
        pr_info("[sysparm] mmaudio parm table size: 0x%x bytes\n",sizeof(mm_audio_parm_table) );
        pAudioTmp = APSYSPARM_GetAudioParmAccessPtr();
        if ( !pAudioTmp )
        {
            pr_err("[sysparm]: APSYSPARM_GetAudioParmAccessPtr failed\n");
        }
        
        pMMAudioTmp = APSYSPARM_GetMultimediaAudioParmAccessPtr( );
        if ( !pMMAudioTmp )
        {
            pr_err("[sysparm]: SYSPARM_GetMultimediaAudioParmAccessPtr failed\n");
        }
        
        pr_info("audvoc_pslopgain 0x%x\n",pMMAudioTmp->audvoc_pslopgain);
        pr_info("audvoc_aslopgain 0x%x\n",pMMAudioTmp->audvoc_aslopgain);
        for (i=0;i<25;i++)
            pr_info("0 PR_DAC_IIR[%d] 0x%x\n",i,pMMAudioTmp->PR_DAC_IIR[i]);
        
        tmp = SYSPARM_GetBattEmptyThresh();
        pr_info("SYSPARM_GetBattEmptyThresh: %d\n",tmp);
        tmp = SYSPARM_GetActual4p2VoltReading();
        pr_info("SYSPARM_GetActual4p2VoltReading: %d\n",tmp);
        tmp = SYSPARM_GetDefault4p2VoltReading();
        pr_info("SYSPARM_GetDefault4p2VoltReading: %d\n",tmp);
        tmp = SYSPARM_GetActualLowVoltReading();
        pr_info("SYSPARM_GetActualLowVoltReading: %d\n",tmp);
    }
#endif

    return 0;

out_unmap:
    iounmap(sys_data_dep);  
  
out:
    pr_err("[sysparm]: Failed to initialise!\n");
    return rc;
}