本文整理汇总了C++中Afe_Set_Reg函数的典型用法代码示例。如果您正苦于以下问题:C++ Afe_Set_Reg函数的具体用法?C++ Afe_Set_Reg怎么用?C++ Afe_Set_Reg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Afe_Set_Reg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AudDrv_Suspend_Clk_Off
void AudDrv_Suspend_Clk_Off(void)
{
unsigned long flags;
spin_lock_irqsave(&auddrv_Clk_lock, flags);
if (Aud_AFE_Clk_cntr > 0)
{
PRINTK_AUD_CLK("AudDrv_Suspend_Clk_Off Aud_AFE_Clk_cntr:%d ANA_Clk(%d)\n", Aud_AFE_Clk_cntr, Aud_ANA_Clk_cntr);
#ifdef PM_MANAGER_API
//Disable AFE clock and I2S clock
Afe_Set_Reg(AUDIO_TOP_CON0, 0x00004044, 0x00004044); // bit2: afe power off, bit6: I2S power off
if (disable_clock(MT_CG_AUDIO_AFE, "AUDIO"))
{
xlog_printk(ANDROID_LOG_ERROR, "Sound", "AudDrv_Suspend_Clk_Off() disable_clock MT_CG_AUDIO_AFE fail");
}
if (Aud_I2S_Clk_cntr > 0)
{
if (disable_clock(MT_CG_AUDIO_I2S, "AUDIO"))
{
xlog_printk(ANDROID_LOG_ERROR, "Sound", "AudDrv_Suspend_Clk_Off() disable_clock MT_CG_AUDIO_I2S fail");
}
}
#else
Afe_Set_Reg(AUDIO_TOP_CON0, 0x00004044, 0x00004044); // bit2: afe power off, bit6: I2S power off
#endif
}
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
if (Aud_ANA_Clk_cntr > 0)
{
PRINTK_AUD_CLK("AudDrv_Suspend_Clk_On Aud_AFE_Clk_cntr:%d ANA_Clk(%d) \n", Aud_AFE_Clk_cntr, Aud_ANA_Clk_cntr);
}
}
示例2: mtk_pcm_hdmi_stop
static int mtk_pcm_hdmi_stop(struct snd_pcm_substream *substream)
{
AFE_BLOCK_T *Afe_Block = &(pMemControl->rBlock);
printk("mtk_pcm_hdmi_stop \n");
SetIrqEnable(Soc_Aud_IRQ_MCU_MODE_IRQ5_MCU_MODE, false);
SetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_HDMI, false);
#ifdef _DEBUG_TDM_KERNEL_
#if 0
Afe_Set_Reg(AFE_TDM_CON2, 0, 0x00010000); // disable TDM to I2S path
#endif
Afe_Set_Reg(AFE_I2S_CON, 0, 0x00000001); // I2S disable
msleep(1);
#endif
SetTDMEnable(false); //disable TDM
SetHDMIEnable(false);
Afe_Set_Reg(AUDIO_TOP_CON0, 0 << 20, 1 << 20); // disable HDMI CK
EnableAfe(false);
RemoveMemifSubStream(Soc_Aud_Digital_Block_MEM_HDMI, substream);
Afe_Block->u4DMAReadIdx = 0;
Afe_Block->u4WriteIdx = 0;
Afe_Block->u4DataRemained = 0;
return 0;
}
示例3: mtk_pcm_i2s0_stop
static int mtk_pcm_i2s0_stop(struct snd_pcm_substream *substream)
{
AFE_BLOCK_T *Afe_Block = &(pI2s0MemControl->rBlock);
printk("mtk_pcm_i2s0_stop \n");
SetIrqEnable(Soc_Aud_IRQ_MCU_MODE_IRQ1_MCU_MODE, false);
// here start digital part
SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I05, Soc_Aud_InterConnectionOutput_O00);
SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I06, Soc_Aud_InterConnectionOutput_O01);
SetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_DL1, false);
// stop I2S
Afe_Set_Reg(AFE_I2S_CON3, 0x0, 0x1);
Afe_Set_Reg(AFE_I2S_CON, 0x0, 0x1);
EnableAfe(false);
// clean audio hardware buffer
memset(Afe_Block->pucVirtBufAddr, 0, Afe_Block->u4BufferSize);
RemoveMemifSubStream(Soc_Aud_Digital_Block_MEM_DL1,substream);
AudDrv_Clk_Off();
return 0;
}
示例4: SetHDMIAddress
static void SetHDMIAddress(void)
{
pr_debug("%s buffer length = %d\n", __func__, (int)HDMI_dma_buf->bytes);
Afe_Set_Reg(AFE_HDMI_BASE, HDMI_dma_buf->addr, 0xffffffff);
Afe_Set_Reg(AFE_HDMI_END, HDMI_dma_buf->addr + (HDMI_dma_buf->bytes - 1),
0xffffffff);
}
示例5: SetHDMIBuffer
static void SetHDMIBuffer(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params)
{
kal_uint32 volatile u4tmpMrg1;
struct snd_pcm_runtime *runtime = substream->runtime;
AFE_BLOCK_T *pblock = &(pMemControl->rBlock);
pblock->pucPhysBufAddr = runtime->dma_addr;
pblock->pucVirtBufAddr = runtime->dma_area;
pblock->u4BufferSize = runtime->dma_bytes;
pblock->u4SampleNumMask = 0x001f; /* 32 byte align */
pblock->u4WriteIdx = 0;
pblock->u4DMAReadIdx = 0;
pblock->u4DataRemained = 0;
pblock->u4fsyncflag = false;
pblock->uResetFlag = true;
PRINTK_AUD_HDMI("%s, dma_bytes = %d, dma_area = %p, dma_addr = 0x%x\n",
__func__, pblock->u4BufferSize, pblock->pucVirtBufAddr,
pblock->pucPhysBufAddr);
Afe_Set_Reg(AFE_HDMI_BASE, pblock->pucPhysBufAddr, 0xffffffff);
Afe_Set_Reg(AFE_HDMI_END, pblock->pucPhysBufAddr + (pblock->u4BufferSize - 1),
0xffffffff);
u4tmpMrg1 = Afe_Get_Reg(AFE_HDMI_BASE);
u4tmpMrg1 &= 0x00ffffff;
PRINTK_AUD_HDMI("SetHDMIBuffer AFE_HDMI_BASE = 0x%x\n", u4tmpMrg1);
}
示例6: SetConnectionState
bool SetConnectionState(uint32 ConnectionState, uint32 Input, uint32 Output)
{
/* printk("SetinputConnection ConnectionState = %d
Input = %d Output = %d\n", ConnectionState, Input, Output); */
int connectReg = 0;
switch (ConnectionState) {
case Soc_Aud_InterCon_DisConnect:
{
/* printk("nConnectionState = %d\n", ConnectionState); */
if ((mConnectionState[Input][Output] & Soc_Aud_InterCon_Connection)
== Soc_Aud_InterCon_Connection) {
/* here to disconnect connect bits */
connectReg = mConnectionReg[Output];
if (CheckBitsandReg(connectReg, Input)) {
Afe_Set_Reg(connectReg, 0, 1 << Input);
mConnectionState[Input][Output] &= ~(Soc_Aud_InterCon_Connection);
}
}
if ((mConnectionState[Input][Output] & Soc_Aud_InterCon_ConnectionShift)
== Soc_Aud_InterCon_ConnectionShift) {
/* here to disconnect connect shift bits */
if (CheckBitsandReg(AFE_CONN_RS, Input)) {
Afe_Set_Reg(AFE_CONN_RS, 0, 1 << Input);
mConnectionState[Input][Output] &= ~(Soc_Aud_InterCon_ConnectionShift);
}
}
break;
}
case Soc_Aud_InterCon_Connection:
{
/* printk("nConnectionState = %d\n", ConnectionState); */
connectReg = mConnectionReg[Output];
if (CheckBitsandReg(connectReg, Input)) {
Afe_Set_Reg(connectReg, 1 << Input, 1 << Input);
mConnectionState[Input][Output] |= Soc_Aud_InterCon_Connection;
}
break;
}
case Soc_Aud_InterCon_ConnectionShift:
{
/* printk("nConnectionState = %d\n", ConnectionState); */
if (CheckBitsandReg(AFE_CONN_RS, Input)) {
Afe_Set_Reg(AFE_CONN_RS, 1 << Input, 1 << Input);
mConnectionState[Input][Output] |= Soc_Aud_InterCon_ConnectionShift;
}
break;
}
default:
pr_err("no this state ConnectionState = %d\n", ConnectionState);
break;
}
return true;
}
示例7: SetHDMIAddress
static void SetHDMIAddress(void)
{
#if 0
printk("%s buffer length = %d\n", __func__, HDMI_dma_buf->bytes);
Afe_Set_Reg(AFE_HDMI_BASE , HDMI_dma_buf->addr , 0xffffffff);
Afe_Set_Reg(AFE_HDMI_END , HDMI_dma_buf->addr + (HDMI_dma_buf->bytes - 1), 0xffffffff);
#else
printk("%s mt6572 not support!!!\n", __func__);
#endif
}
示例8: AudDrv_APLL2Tuner_Clk_On
void AudDrv_APLL2Tuner_Clk_On(void)
{
unsigned long flags;
spin_lock_irqsave(&auddrv_Clk_lock, flags);
if (Aud_APLL2_Tuner_cntr == 0)
{
PRINTK_AUD_CLK("+Aud_APLL2_Tuner_cntr, Aud_APLL2_Tuner_cntr:%d \n", Aud_APLL2_Tuner_cntr);
Afe_Set_Reg(AUDIO_TOP_CON0, 0x0 << 18, 0x1 << 18);
Afe_Set_Reg(AFE_APLL2_TUNER_CFG, 0x00000033, 0x1 << 19);
}
Aud_APLL2_Tuner_cntr++;
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
}
示例9: AudDrv_ADC2_Clk_Off
void AudDrv_ADC2_Clk_Off(void)
{
//PRINTK_AUDDRV("+%s %d \n", __func__,Aud_ADC2_Clk_cntr);
mutex_lock(&auddrv_pmic_mutex);
Aud_ADC2_Clk_cntr--;
if (Aud_ADC2_Clk_cntr == 0)
{
PRINTK_AUDDRV("+%s disable_clock ADC clk(%x)\n", __func__, Aud_ADC2_Clk_cntr);
#if 0 //K2 removed
#ifdef PM_MANAGER_API
if (disable_clock(MT_CG_AUDIO_ADDA2, "AUDIO"))
{
PRINTK_AUD_CLK("%s fail", __func__);
}
#else
Afe_Set_Reg(AUDIO_TOP_CON0, 1 << 23 , 1 << 23); //temp hard code setting, after confirm with enable clock usage, this could be removed.
#endif
#endif
}
if (Aud_ADC2_Clk_cntr < 0)
{
PRINTK_AUDDRV("%s <0 (%d) \n", __func__, Aud_ADC2_Clk_cntr);
Aud_ADC2_Clk_cntr = 0;
}
mutex_unlock(&auddrv_pmic_mutex);
//PRINTK_AUDDRV("-AudDrv_ADC_Clk_Off, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
}
示例10: AudDrv_Clk_Off
void AudDrv_Clk_Off(void)
{
unsigned long flags;
PRINTK_AUD_CLK("+!! AudDrv_Clk_Off, Aud_AFE_Clk_cntr:%d \n",Aud_AFE_Clk_cntr);
spin_lock_irqsave(&auddrv_Clk_lock, flags);
Aud_AFE_Clk_cntr--;
if (Aud_AFE_Clk_cntr == 0)
{
printk("------------AudDrv_Clk_Off, Aud_AFE_Clk_cntr:%d \n", Aud_AFE_Clk_cntr);
{
// Disable AFE clock
#ifdef PM_MANAGER_API
if (disable_clock(MT_CG_AUDIO_AFE, "AUDIO"))
{
xlog_printk(ANDROID_LOG_ERROR, "Sound", "disable_clock MT_CG_AUDIO_AFE fail");
}
#else
Afe_Set_Reg(AUDIO_TOP_CON0, 0x06000044, 0x06000044);
#endif
}
}
else if (Aud_AFE_Clk_cntr < 0)
{
PRINTK_AUD_ERROR("!! AudDrv_Clk_Off, Aud_AFE_Clk_cntr<0 (%d) \n", Aud_AFE_Clk_cntr);
AUDIO_ASSERT(true);
Aud_AFE_Clk_cntr = 0;
}
PRINTK_AUD_CLK("-!! AudDrv_Clk_Off, Aud_AFE_Clk_cntr:%d \n",Aud_AFE_Clk_cntr);
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
}
示例11: AudDrv_ADC_Clk_Off
void AudDrv_ADC_Clk_Off(void)
{
//PRINTK_AUDDRV("+AudDrv_ADC_Clk_Off, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
mutex_lock(&auddrv_pmic_mutex);
Aud_ADC_Clk_cntr--;
if (Aud_ADC_Clk_cntr == 0)
{
PRINTK_AUDDRV("+AudDrv_ADC_Clk_On disable_clock ADC clk(%x)\n", Aud_ADC_Clk_cntr);
//Afe_Set_Reg(AUDIO_TOP_CON0, 1 << 24 , 1 << 24);
#ifdef PM_MANAGER_API
#if defined(CONFIG_MTK_LEGACY)
if (disable_clock(MT_CG_AUDIO_ADC, "AUDIO"))
{
PRINTK_AUD_CLK("%s fail", __func__);
}
#else
if (paudclk->aud_adc_clk_status)
{
clk_disable_unprepare(paudclk->aud_adc_clk);
}
#endif
#else
Afe_Set_Reg(AUDIO_TOP_CON0, 1 << 24 , 1 << 24);
#endif
}
if (Aud_ADC_Clk_cntr < 0)
{
PRINTK_AUDDRV("!! AudDrv_ADC_Clk_Off, Aud_ADC_Clk_cntr<0 (%d) \n", Aud_ADC_Clk_cntr);
Aud_ADC_Clk_cntr = 0;
}
mutex_unlock(&auddrv_pmic_mutex);
//PRINTK_AUDDRV("-AudDrv_ADC_Clk_Off, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
}
示例12: AudDrv_I2S_Clk_Off
void AudDrv_I2S_Clk_Off(void)
{
unsigned long flags;
//PRINTK_AUD_CLK("+AudDrv_I2S_Clk_Off, Aud_I2S_Clk_cntr:%d \n", Aud_I2S_Clk_cntr);
spin_lock_irqsave(&auddrv_Clk_lock, flags);
Aud_I2S_Clk_cntr--;
if (Aud_I2S_Clk_cntr == 0)
{
#ifdef PM_MANAGER_API
if (disable_clock(MT_CG_AUDIO_I2S, "AUDIO"))
{
PRINTK_AUD_ERROR("disable_clock MT_CG_AUDIO_I2S fail");
}
#else
Afe_Set_Reg(AUDIO_TOP_CON0, 0x00000000, 0x00000040); //power off I2S clock
#endif
}
else if (Aud_I2S_Clk_cntr < 0)
{
PRINTK_AUD_ERROR("!! AudDrv_I2S_Clk_Off, Aud_I2S_Clk_cntr<0 (%d) \n", Aud_I2S_Clk_cntr);
AUDIO_ASSERT(true);
Aud_I2S_Clk_cntr = 0;
}
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
//PRINTK_AUD_CLK("-AudDrv_I2S_Clk_Off, Aud_I2S_Clk_cntr:%d \n",Aud_I2S_Clk_cntr);
}
示例13: AudDrv_Clk_AllOn
void AudDrv_Clk_AllOn(void)
{
unsigned long flags;
printk("AudDrv_Clk_AllOn \n");
spin_lock_irqsave(&auddrv_Clk_lock, flags);
Afe_Set_Reg(AUDIO_TOP_CON0, 0x00004000, 0xffffffff);
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
}
示例14: Auddrv_Bus_Init
void Auddrv_Bus_Init(void)
{
unsigned long flags;
printk("%s \n", __func__);
spin_lock_irqsave(&auddrv_Clk_lock, flags);
Afe_Set_Reg(AUDIO_TOP_CON0, 0x00004000, 0x00004000); //must set, system will default set bit14 to 0
spin_unlock_irqrestore(&auddrv_Clk_lock, flags);
}
示例15: Audio_Irqcnt2_Set
static int Audio_Irqcnt2_Set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
uint32 irq1_cnt = ucontrol->value.integer.value[0];
printk("%s()\n", __func__);
AudDrv_Clk_On();
Afe_Set_Reg(AFE_IRQ_MCU_CNT2, irq1_cnt, 0xffffffff);
AudDrv_Clk_Off();
return 0;
}