当前位置: 首页>>代码示例>>C++>>正文


C++ PRINTK_AUDDRV函数代码示例

本文整理汇总了C++中PRINTK_AUDDRV函数的典型用法代码示例。如果您正苦于以下问题:C++ PRINTK_AUDDRV函数的具体用法?C++ PRINTK_AUDDRV怎么用?C++ PRINTK_AUDDRV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PRINTK_AUDDRV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AudDrv_APLL24M_Clk_Off

void AudDrv_APLL24M_Clk_Off(void)
{
    pr_debug("+%s %d \n", __func__, Aud_APLL24M_Clk_cntr);
    mutex_lock(&auddrv_pmic_mutex);
    Aud_APLL24M_Clk_cntr--;
    if (Aud_APLL24M_Clk_cntr == 0)
    {
        PRINTK_AUDDRV("+%s disable_clock ADC clk(%x)\n", __func__, Aud_APLL24M_Clk_cntr);
#ifdef PM_MANAGER_API
#if defined(CONFIG_MTK_LEGACY)

        if (disable_clock(MT_CG_AUDIO_24M, "AUDIO"))
        {
            PRINTK_AUD_CLK("%s fail", __func__);
        }
        if (disable_clock(MT_CG_AUDIO_APLL2_TUNER, "AUDIO"))
        {
            PRINTK_AUD_CLK("%s fail", __func__);
        }
#else
        if (paudclk->aud_apll24m_clk_status)
        {
            clk_disable_unprepare(paudclk->aud_apll24m_clk);
        }
        if (paudclk->aud_apll2_tuner_clk_status)
        {
            clk_disable_unprepare(paudclk->aud_apll2_tuner_clk);
        }        
#endif
        clkmux_sel(MT_MUX_AUD1, 0, "AUDIO"); //select 26M
        disable_mux(MT_MUX_AUD1, "AUDIO");
#endif
    }
    if (Aud_APLL24M_Clk_cntr < 0)
    {
        PRINTK_AUDDRV("%s  <0 (%d) \n", __func__, Aud_APLL24M_Clk_cntr);
        Aud_APLL24M_Clk_cntr = 0;
    }
    mutex_unlock(&auddrv_pmic_mutex);
}
开发者ID:dadimesin,项目名称:mt6577-kernel-3.10.65,代码行数:40,代码来源:AudDrv_Clk.c

示例2: mtk_pcm_i2s0_pointer

static snd_pcm_uframes_t mtk_pcm_i2s0_pointer(struct snd_pcm_substream *substream)
{
    kal_int32 HW_memory_index = 0;
    kal_int32 HW_Cur_ReadIdx = 0;
    kal_uint32 Frameidx = 0;
    kal_int32 Afe_consumed_bytes = 0;
    AFE_BLOCK_T *Afe_Block = &pI2s0MemControl->rBlock;
    //struct snd_pcm_runtime *runtime = substream->runtime;
    PRINTK_AUD_DL1(" %s Afe_Block->u4DMAReadIdx = 0x%x\n", __func__, Afe_Block->u4DMAReadIdx);

    Auddrv_Dl1_Spinlock_lock();

    // get total bytes to copy
    //Frameidx = audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx);
    //return Frameidx;

    if (GetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_DL1) == true)
    {
        HW_Cur_ReadIdx = Afe_Get_Reg(AFE_DL1_CUR);
        if (HW_Cur_ReadIdx == 0)
        {
            PRINTK_AUDDRV("[Auddrv] HW_Cur_ReadIdx ==0 \n");
            HW_Cur_ReadIdx = Afe_Block->pucPhysBufAddr;
        }

        HW_memory_index = (HW_Cur_ReadIdx - Afe_Block->pucPhysBufAddr);
        if (HW_memory_index >=  Afe_Block->u4DMAReadIdx)
        {
            Afe_consumed_bytes = HW_memory_index - Afe_Block->u4DMAReadIdx;
        }
        else
        {
            Afe_consumed_bytes = Afe_Block->u4BufferSize + HW_memory_index - Afe_Block->u4DMAReadIdx ;
        }

        Afe_consumed_bytes = Align64ByteSize(Afe_consumed_bytes);

        Afe_Block->u4DataRemained -= Afe_consumed_bytes;
        Afe_Block->u4DMAReadIdx += Afe_consumed_bytes;
        Afe_Block->u4DMAReadIdx %= Afe_Block->u4BufferSize;
        PRINTK_AUD_DL1("[Auddrv] HW_Cur_ReadIdx =0x%x HW_memory_index = 0x%x Afe_consumed_bytes  = 0x%x\n", HW_Cur_ReadIdx, HW_memory_index, Afe_consumed_bytes);
        Auddrv_Dl1_Spinlock_unlock();

        return audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx);
    }
    else
    {
        Frameidx = audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx);
        Auddrv_Dl1_Spinlock_unlock();
        return Frameidx;
    }
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:52,代码来源:mt_soc_pcm_dl1_i2s0.c

示例3: mtk_dl1bt_pcm_pointer

static snd_pcm_uframes_t mtk_dl1bt_pcm_pointer(struct snd_pcm_substream
					       *substream)
{
	kal_int32 HW_memory_index = 0;
	kal_int32 HW_Cur_ReadIdx = 0;
	kal_uint32 Frameidx = 0;
	kal_int32 Afe_consumed_bytes = 0;
	unsigned long flags;

	AFE_BLOCK_T *Afe_Block = &pdl1btMemControl->rBlock;
	/* struct snd_pcm_runtime *runtime = substream->runtime; */
	PRINTK_AUD_DL1(" %s Afe_Block->u4DMAReadIdx = 0x%x\n", __func__, Afe_Block->u4DMAReadIdx);

	spin_lock_irqsave(&pdl1btMemControl->substream_lock, flags);

	/* get total bytes to copy */
	/* Frameidx = audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx); */
	/* return Frameidx; */

	if (GetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_DL1) == true) {
		HW_Cur_ReadIdx = Afe_Get_Reg(AFE_DL1_CUR);
		if (HW_Cur_ReadIdx == 0) {
			PRINTK_AUDDRV("[Auddrv] HW_Cur_ReadIdx ==0\n");
			HW_Cur_ReadIdx = Afe_Block->pucPhysBufAddr;
		}

		HW_memory_index = (HW_Cur_ReadIdx - Afe_Block->pucPhysBufAddr);
		if (HW_memory_index >= Afe_Block->u4DMAReadIdx)
			Afe_consumed_bytes = HW_memory_index - Afe_Block->u4DMAReadIdx;
		else
			Afe_consumed_bytes = Afe_Block->u4BufferSize + HW_memory_index -
			    Afe_Block->u4DMAReadIdx;

#ifdef AUDIO_64BYTE_ALIGN
		Afe_consumed_bytes = Align64ByteSize(Afe_consumed_bytes);
#endif

		Afe_Block->u4DataRemained -= Afe_consumed_bytes;
		Afe_Block->u4DMAReadIdx += Afe_consumed_bytes;
		Afe_Block->u4DMAReadIdx %= Afe_Block->u4BufferSize;
		PRINTK_AUD_DL1
		    ("[Auddrv] HW_Cur_ReadIdx =0x%x HW_memory_index = 0x%x Afe_consumed_bytes  = 0x%x\n",
		     HW_Cur_ReadIdx, HW_memory_index, Afe_consumed_bytes);
		spin_unlock_irqrestore(&pdl1btMemControl->substream_lock, flags);

		return audio_bytes_to_frame(substream, Afe_Block->u4DMAReadIdx);
	} else {
		Frameidx = audio_bytes_to_frame(substream, Afe_Block->u4DMAReadIdx);
		spin_unlock_irqrestore(&pdl1btMemControl->substream_lock, flags);
		return Frameidx;
	}
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:52,代码来源:mt_soc_pcm_dl1_bt.c

示例4: mtk_pcm_trigger

static int mtk_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
	PRINTK_AUDDRV("mtk_pcm_trigger cmd = %d\n", cmd);
	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
	case SNDRV_PCM_TRIGGER_RESUME:
		return mtk_pcm_dl1bt_start(substream);
	case SNDRV_PCM_TRIGGER_STOP:
	case SNDRV_PCM_TRIGGER_SUSPEND:
		return mtk_pcm_dl1Bt_stop(substream);
	}
	return -EINVAL;
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:13,代码来源:mt_soc_pcm_dl1_bt.c

示例5: AudDrv_ADC_Clk_On

void AudDrv_ADC_Clk_On(void)
{
    //PRINTK_AUDDRV("+AudDrv_ADC_Clk_On, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
    mutex_lock(&auddrv_pmic_mutex);

    if (Aud_ADC_Clk_cntr == 0)
    {
        PRINTK_AUDDRV("+AudDrv_ADC_Clk_On enable_clock ADC clk(%x)\n", Aud_ADC_Clk_cntr);
        Afe_Set_Reg(AUDIO_TOP_CON0, 0 << 24 , 1 << 24);
    }
    Aud_ADC_Clk_cntr++;
    mutex_unlock(&auddrv_pmic_mutex);
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:13,代码来源:AudDrv_Clk.c

示例6: mtk_pcm_i2s0_hw_params

static int mtk_pcm_i2s0_hw_params(struct snd_pcm_substream *substream,
                                  struct snd_pcm_hw_params *hw_params)
{
    int ret = 0;

    PRINTK_AUDDRV("mtk_pcm_hw_params \n");

    /* runtime->dma_bytes has to be set manually to allow mmap */
    substream->runtime->dma_bytes = params_buffer_bytes(hw_params);

    // here to allcoate sram to hardware ---------------------------
    AudDrv_Allocate_mem_Buffer(mDev, Soc_Aud_Digital_Block_MEM_DL1, substream->runtime->dma_bytes);
    //substream->runtime->dma_bytes = AFE_INTERNAL_SRAM_SIZE;
    substream->runtime->dma_area = (unsigned char *)Get_Afe_SramBase_Pointer();
    substream->runtime->dma_addr = AFE_INTERNAL_SRAM_PHY_BASE;

    // -------------------------------------------------------
    PRINTK_AUDDRV("1 dma_bytes = %d dma_area = %p dma_addr = 0x%x\n",
                  substream->runtime->dma_bytes, substream->runtime->dma_area, (unsigned int)substream->runtime->dma_addr);

    return ret;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:22,代码来源:mt_soc_pcm_dl1_i2s0.c

示例7: mtk_pcm_dl2_pointer

static snd_pcm_uframes_t mtk_pcm_dl2_pointer(struct snd_pcm_substream *substream)
{
	kal_int32 HW_memory_index = 0;
	kal_int32 HW_Cur_ReadIdx = 0;
	kal_uint32 Frameidx = 0;
	kal_int32 Afe_consumed_bytes = 0;
	AFE_BLOCK_T *Afe_Block = &pMemControl->rBlock;
	/* struct snd_pcm_runtime *runtime = substream->runtime; */
	PRINTK_AUD_DL2(" %s Afe_Block->u4DMAReadIdx = 0x%x\n", __func__, Afe_Block->u4DMAReadIdx);

	Auddrv_Dl2_Spinlock_lock();

	/* get total bytes to copy */
	/* Frameidx = audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx); */
	/* return Frameidx; */

	if (GetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_DL2) == true) {
		HW_Cur_ReadIdx = Afe_Get_Reg(AFE_DL2_CUR);
		if (HW_Cur_ReadIdx == 0) {
			PRINTK_AUDDRV("[Auddrv] HW_Cur_ReadIdx ==0\n");
			HW_Cur_ReadIdx = Afe_Block->pucPhysBufAddr;
		}

		HW_memory_index = (HW_Cur_ReadIdx - Afe_Block->pucPhysBufAddr);
		if (HW_memory_index >= Afe_Block->u4DMAReadIdx) {
			Afe_consumed_bytes = HW_memory_index - Afe_Block->u4DMAReadIdx;
		} else {
			Afe_consumed_bytes = Afe_Block->u4BufferSize + HW_memory_index -
			    Afe_Block->u4DMAReadIdx;
		}

#ifdef AUDIO_64BYTE_ALIGN	/* no need to do 64byte align */
		Afe_consumed_bytes = Align64ByteSize(Afe_consumed_bytes);
#endif

		Afe_Block->u4DataRemained -= Afe_consumed_bytes;
		Afe_Block->u4DMAReadIdx += Afe_consumed_bytes;
		Afe_Block->u4DMAReadIdx %= Afe_Block->u4BufferSize;
		PRINTK_AUD_DL2
		    ("[Auddrv] HW_Cur_ReadIdx =0x%x HW_memory_index = 0x%x Afe_consumed_bytes  = 0x%x\n",
		     HW_Cur_ReadIdx, HW_memory_index, Afe_consumed_bytes);
		Auddrv_Dl2_Spinlock_unlock();

		Frameidx = audio_bytes_to_frame(substream, Afe_Block->u4DMAReadIdx);
	} else {
		Frameidx = audio_bytes_to_frame(substream, Afe_Block->u4DMAReadIdx);
		Auddrv_Dl2_Spinlock_unlock();
	}
	return Frameidx;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:50,代码来源:mt_soc_pcm_dl2.c

示例8: AudDrv_ADC_Clk_On

void AudDrv_ADC_Clk_On(void)
{
    //PRINTK_AUDDRV("+AudDrv_ADC_Clk_On, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
    mutex_lock(&auddrv_pmic_mutex);

    if (Aud_ADC_Clk_cntr == 0)
    {
        PRINTK_AUDDRV("+AudDrv_ADC_Clk_On enable_clock ADC clk(%x)\n", Aud_ADC_Clk_cntr);
#ifdef PM_MANAGER_API
        //hwPowerOn(MT65XX_POWER_LDO_VA28,VOL_2800 , "AUDIO");
#endif
    }
    Aud_ADC_Clk_cntr++;
    mutex_unlock(&auddrv_pmic_mutex);
}
开发者ID:4Fwolf,项目名称:motorola-hawk-kernel-3.4.67,代码行数:15,代码来源:AudDrv_Clk.c

示例9: AudDrv_ADC_Clk_On

void AudDrv_ADC_Clk_On(void)
{
    //PRINTK_AUDDRV("+AudDrv_ADC_Clk_On, Aud_ADC_Clk_cntr:%d \n", Aud_ADC_Clk_cntr);
#if !defined(CONFIG_MTK_LEGACY)  
    int ret = 0;
#endif
    mutex_lock(&auddrv_pmic_mutex);

    if (Aud_ADC_Clk_cntr == 0)
    {
        PRINTK_AUDDRV("+AudDrv_ADC_Clk_On enable_clock ADC clk(%x)\n", Aud_ADC_Clk_cntr);
//        Afe_Set_Reg(AUDIO_TOP_CON0, 0 << 24 , 1 << 24);
#ifdef PM_MANAGER_API
#if defined(CONFIG_MTK_LEGACY)
        if (enable_clock(MT_CG_AUDIO_ADC, "AUDIO"))
        {
            PRINTK_AUD_CLK("%s fail", __func__);
        }
#else
        if (paudclk->aud_adc_clk_status)
        {
            ret = clk_prepare_enable(paudclk->aud_adc_clk);
            if (!ret)
            {
                pr_err("%s Aud enable_clock enable_clock ADC fail", __func__);
                BUG();
                return;
            }
        }
        else
        {
            pr_err("%s clk_status error Aud enable_clock ADC fail", __func__);
            BUG();
            return;                                    
        }        

#endif
#else
        Afe_Set_Reg(AUDIO_TOP_CON0, 0 << 24 , 1 << 24);
#endif
    }
    Aud_ADC_Clk_cntr++;
    mutex_unlock(&auddrv_pmic_mutex);
}
开发者ID:dadimesin,项目名称:mt6577-kernel-3.10.65,代码行数:44,代码来源:AudDrv_Clk.c

示例10: mtk_soc_dl1bt_platform_init

static int __init mtk_soc_dl1bt_platform_init(void)
{
	int ret;
	PRINTK_AUDDRV("%s\n", __func__);
#ifndef CONFIG_OF
	soc_mtk_dl1bt_dev = platform_device_alloc(MT_SOC_VOIP_BT_OUT, -1);
	if (!soc_mtk_dl1bt_dev)
		return -ENOMEM;

	ret = platform_device_add(soc_mtk_dl1bt_dev);
	if (ret != 0) {
		platform_device_put(soc_mtk_dl1bt_dev);
		return ret;
	}
#endif
	ret = platform_driver_register(&mtk_dl1bt_driver);
	return ret;

}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:19,代码来源:mt_soc_pcm_dl1_bt.c

示例11: mtk_dl1bt_pcm_open

static int mtk_dl1bt_pcm_open(struct snd_pcm_substream *substream)
{
	int ret = 0;
	struct snd_pcm_runtime *runtime = substream->runtime;
	AfeControlSramLock();
	if (GetSramState() == SRAM_STATE_FREE) {
		mtk_dl1bt_pcm_hardware.buffer_bytes_max = GetPLaybackSramFullSize();
		mPlaybackSramState = SRAM_STATE_PLAYBACKFULL;
		SetSramState(mPlaybackSramState);
	} else {
		mtk_dl1bt_pcm_hardware.buffer_bytes_max = GetPLaybackSramPartial();
		mPlaybackSramState = SRAM_STATE_PLAYBACKPARTIAL;
		SetSramState(mPlaybackSramState);
	}
	AfeControlSramUnLock();

	PRINTK_AUDDRV("mtk_dl1bt_pcm_open\n");
	AudDrv_Clk_On();

	/* get dl1 memconptrol and record substream */
	pdl1btMemControl = Get_Mem_ControlT(Soc_Aud_Digital_Block_MEM_DL1);
	runtime->hw = mtk_dl1bt_pcm_hardware;
	memcpy((void *)(&(runtime->hw)), (void *)&mtk_dl1bt_pcm_hardware,
	       sizeof(struct snd_pcm_hardware));

	ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
					 &constraints_dl1_sample_rates);
	if (ret < 0)
		PRINTK_AUDDRV("snd_pcm_hw_constraint_list failed\n");

	ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);

	if (ret < 0)
		PRINTK_AUDDRV("snd_pcm_hw_constraint_integer failed\n");

	/* print for hw pcm information */
	PRINTK_AUDDRV
	    ("mtk_dl1bt_pcm_open runtime rate = %d channels = %d substream->pcm->device = %d\n",
	     runtime->rate, runtime->channels, substream->pcm->device);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		PRINTK_AUDDRV("SNDRV_PCM_STREAM_PLAYBACK mtkalsa_playback_constraints\n");

	if (ret < 0) {
		PRINTK_AUDDRV("mtk_Dl1Bt_close\n");
		mtk_Dl1Bt_close(substream);
		return ret;
	}
	return 0;
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:50,代码来源:mt_soc_pcm_dl1_bt.c

示例12: mtk_soc_dl2_probe

static int mtk_soc_dl2_probe(struct platform_device *pdev)
{
	PRINTK_AUDDRV("%s\n", __func__);

	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
	if (!pdev->dev.dma_mask)
		pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;

	if (pdev->dev.of_node) {
		dev_set_name(&pdev->dev, "%s", MT_SOC_DL2_PCM);
	} else {
		pr_err("%s invalid of_node\n", __func__);
		return -ENODEV;
	}

	pr_warn("%s: dev name %s\n", __func__, dev_name(&pdev->dev));


	return snd_soc_register_platform(&pdev->dev, &mtk_soc_platform);
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:20,代码来源:mt_soc_pcm_dl2.c

示例13: AudDrv_ADC3_Clk_On

void AudDrv_ADC3_Clk_On(void)
{
    PRINTK_AUD_CLK("+%s %d \n", __func__, Aud_ADC3_Clk_cntr);
    mutex_lock(&auddrv_pmic_mutex);

    if (Aud_ADC3_Clk_cntr == 0)
    {
        PRINTK_AUDDRV("+%s  enable_clock ADC clk(%x)\n", __func__, Aud_ADC3_Clk_cntr);
#if 0 //K2 removed		
#ifdef PM_MANAGER_API
        if (enable_clock(MT_CG_AUDIO_ADDA3, "AUDIO"))
        {
            PRINTK_AUD_CLK("%s fail", __func__);
        }
#endif
#endif
    }
    Aud_ADC2_Clk_cntr++;
    mutex_unlock(&auddrv_pmic_mutex);
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:20,代码来源:AudDrv_Clk.c

示例14: mtk_pcm_dl2_open

static int mtk_pcm_dl2_open(struct snd_pcm_substream *substream)
{
	int ret = 0;
	struct snd_pcm_runtime *runtime = substream->runtime;

	PRINTK_AUDDRV("mtk_pcm_dl2_open\n");

		mtk_pcm_dl2_hardware.buffer_bytes_max = GetPLaybackDramLowLatencySize();
		mPlaybackSramState = SRAM_STATE_PLAYBACKDRAM;
		mPlaybackUseSram = false;
	if (mPlaybackSramState == SRAM_STATE_PLAYBACKDRAM)
		AudDrv_Emi_Clk_On();

	pr_warn("mtk_pcm_dl2_hardware.buffer_bytes_max = %zu mPlaybackSramState = %d\n",
	       mtk_pcm_dl2_hardware.buffer_bytes_max, mPlaybackSramState);
	runtime->hw = mtk_pcm_dl2_hardware;

	AudDrv_Clk_On();
	memcpy((void *)(&(runtime->hw)), (void *)&mtk_pcm_dl2_hardware,
	       sizeof(struct snd_pcm_hardware));
	pMemControl = Get_Mem_ControlT(Soc_Aud_Digital_Block_MEM_DL2);

	ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
					 &constraints_sample_rates);

	if (ret < 0)
		pr_err("snd_pcm_hw_constraint_integer failed\n");

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		pr_warn("SNDRV_PCM_STREAM_PLAYBACK mtkalsa_dl2playback_constraints\n");
	else
		pr_warn("SNDRV_PCM_STREAM_CAPTURE mtkalsa_dl2playback_constraints\n");

	if (ret < 0) {
		pr_err("ret < 0 mtk_soc_pcm_dl2_close\n");
		mtk_soc_pcm_dl2_close(substream);
		return ret;
	}
	/* PRINTK_AUDDRV("mtk_pcm_dl2_open return\n"); */
	return 0;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:41,代码来源:mt_soc_pcm_dl2.c

示例15: mtk_pcm_pointer

static snd_pcm_uframes_t mtk_pcm_pointer(struct snd_pcm_substream *substream)
{
    kal_int32 HW_memory_index = 0;
    kal_int32 HW_Cur_ReadIdx = 0;
    kal_uint32 Frameidx = 0;
    kal_int32 Afe_consumed_bytes = 0;
    AFE_BLOCK_T *Afe_Block = &pMemControl->rBlock;
    unsigned int flags;
    struct snd_pcm_runtime *runtime = substream->runtime;
    PRINTK_AUD_DL1(" %s Afe_Block->u4DMAReadIdx = 0x%x\n", __func__, Afe_Block->u4DMAReadIdx);

    // get total bytes to copy
    //Frameidx = audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx);
    //return Frameidx;
    spin_lock_irqsave(&auddrv_DLCtl_lock, flags);
    if (GetMemoryPathEnable(Soc_Aud_Digital_Block_MEM_DL1) == true)
    {
        HW_Cur_ReadIdx = Afe_Get_Reg(AFE_DL1_CUR);
        if (HW_Cur_ReadIdx == 0)
        {
            PRINTK_AUDDRV("[Auddrv] HW_Cur_ReadIdx ==0 \n");
            HW_Cur_ReadIdx = Afe_Block->pucPhysBufAddr;
        }
        HW_memory_index = (HW_Cur_ReadIdx - Afe_Block->pucPhysBufAddr);
        if (HW_memory_index > Afe_Block->u4DMAReadIdx)
        {
            Afe_consumed_bytes = HW_memory_index - Afe_Block->u4DMAReadIdx;
        }
        else
        {
            Afe_consumed_bytes = Afe_Block->u4BufferSize + HW_memory_index - Afe_Block->u4DMAReadIdx ;
        }
        Afe_Block->u4DataRemained -= Afe_consumed_bytes;
        Afe_Block->u4DMAReadIdx += Afe_consumed_bytes;
        Afe_Block->u4DMAReadIdx %= Afe_Block->u4BufferSize;
        PRINTK_AUD_DL1("[Auddrv] HW_Cur_ReadIdx =0x%x HW_memory_index = 0x%x pointer return = 0x%x \n", HW_Cur_ReadIdx, HW_memory_index, (HW_memory_index >> 2));
        spin_unlock_irqrestore(&auddrv_DLCtl_lock, flags);
        return audio_bytes_to_frame(substream , Afe_Block->u4DMAReadIdx);
    }
开发者ID:Scorpio92,项目名称:mediatek,代码行数:39,代码来源:mt_soc_pcm_dl1.c


注:本文中的PRINTK_AUDDRV函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。