• Home
  • Raw
  • Download

Lines Matching full:rtd

331 			   struct audio_substream_data *rtd,  in config_acp_dma()  argument
336 acp_pte_config(acp_mmio, rtd->dma_addr, rtd->num_of_pages, in config_acp_dma()
337 rtd->pte_offset); in config_acp_dma()
339 if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { in config_acp_dma()
340 ch_acp_sysmem = rtd->ch1; in config_acp_dma()
341 ch_acp_i2s = rtd->ch2; in config_acp_dma()
343 ch_acp_i2s = rtd->ch1; in config_acp_dma()
344 ch_acp_sysmem = rtd->ch2; in config_acp_dma()
347 set_acp_sysmem_dma_descriptors(acp_mmio, rtd->size, in config_acp_dma()
348 rtd->direction, rtd->pte_offset, in config_acp_dma()
349 ch_acp_sysmem, rtd->sram_bank, in config_acp_dma()
350 rtd->dma_dscr_idx_1, asic_type); in config_acp_dma()
352 set_acp_to_i2s_dma_descriptors(acp_mmio, rtd->size, in config_acp_dma()
353 rtd->direction, rtd->sram_bank, in config_acp_dma()
354 rtd->destination, ch_acp_i2s, in config_acp_dma()
355 rtd->dma_dscr_idx_2, asic_type); in config_acp_dma()
842 struct audio_substream_data *rtd; in acp_dma_hw_params() local
849 rtd = runtime->private_data; in acp_dma_hw_params()
851 if (WARN_ON(!rtd)) in acp_dma_hw_params()
856 rtd->i2s_instance = pinfo->play_i2s_instance; in acp_dma_hw_params()
858 rtd->i2s_instance = pinfo->cap_i2s_instance; in acp_dma_hw_params()
859 rtd->capture_channel = pinfo->capture_channel; in acp_dma_hw_params()
866 switch (rtd->i2s_instance) { in acp_dma_hw_params()
875 switch (rtd->i2s_instance) { in acp_dma_hw_params()
889 switch (rtd->i2s_instance) { in acp_dma_hw_params()
891 rtd->pte_offset = ACP_ST_BT_PLAYBACK_PTE_OFFSET; in acp_dma_hw_params()
892 rtd->ch1 = SYSRAM_TO_ACP_BT_INSTANCE_CH_NUM; in acp_dma_hw_params()
893 rtd->ch2 = ACP_TO_I2S_DMA_BT_INSTANCE_CH_NUM; in acp_dma_hw_params()
894 rtd->sram_bank = ACP_SRAM_BANK_3_ADDRESS; in acp_dma_hw_params()
895 rtd->destination = TO_BLUETOOTH; in acp_dma_hw_params()
896 rtd->dma_dscr_idx_1 = PLAYBACK_START_DMA_DESCR_CH8; in acp_dma_hw_params()
897 rtd->dma_dscr_idx_2 = PLAYBACK_START_DMA_DESCR_CH9; in acp_dma_hw_params()
898 rtd->byte_cnt_high_reg_offset = in acp_dma_hw_params()
900 rtd->byte_cnt_low_reg_offset = in acp_dma_hw_params()
908 rtd->pte_offset = ACP_ST_PLAYBACK_PTE_OFFSET; in acp_dma_hw_params()
911 rtd->pte_offset = ACP_PLAYBACK_PTE_OFFSET; in acp_dma_hw_params()
913 rtd->ch1 = SYSRAM_TO_ACP_CH_NUM; in acp_dma_hw_params()
914 rtd->ch2 = ACP_TO_I2S_DMA_CH_NUM; in acp_dma_hw_params()
915 rtd->sram_bank = ACP_SRAM_BANK_1_ADDRESS; in acp_dma_hw_params()
916 rtd->destination = TO_ACP_I2S_1; in acp_dma_hw_params()
917 rtd->dma_dscr_idx_1 = PLAYBACK_START_DMA_DESCR_CH12; in acp_dma_hw_params()
918 rtd->dma_dscr_idx_2 = PLAYBACK_START_DMA_DESCR_CH13; in acp_dma_hw_params()
919 rtd->byte_cnt_high_reg_offset = in acp_dma_hw_params()
921 rtd->byte_cnt_low_reg_offset = in acp_dma_hw_params()
926 switch (rtd->i2s_instance) { in acp_dma_hw_params()
928 rtd->pte_offset = ACP_ST_BT_CAPTURE_PTE_OFFSET; in acp_dma_hw_params()
929 rtd->ch1 = I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM; in acp_dma_hw_params()
930 rtd->ch2 = ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM; in acp_dma_hw_params()
931 rtd->sram_bank = ACP_SRAM_BANK_4_ADDRESS; in acp_dma_hw_params()
932 rtd->destination = FROM_BLUETOOTH; in acp_dma_hw_params()
933 rtd->dma_dscr_idx_1 = CAPTURE_START_DMA_DESCR_CH10; in acp_dma_hw_params()
934 rtd->dma_dscr_idx_2 = CAPTURE_START_DMA_DESCR_CH11; in acp_dma_hw_params()
935 rtd->byte_cnt_high_reg_offset = in acp_dma_hw_params()
937 rtd->byte_cnt_low_reg_offset = in acp_dma_hw_params()
939 rtd->dma_curr_dscr = mmACP_DMA_CUR_DSCR_11; in acp_dma_hw_params()
944 rtd->pte_offset = ACP_CAPTURE_PTE_OFFSET; in acp_dma_hw_params()
945 rtd->ch1 = I2S_TO_ACP_DMA_CH_NUM; in acp_dma_hw_params()
946 rtd->ch2 = ACP_TO_SYSRAM_CH_NUM; in acp_dma_hw_params()
949 rtd->pte_offset = ACP_ST_CAPTURE_PTE_OFFSET; in acp_dma_hw_params()
950 rtd->sram_bank = ACP_SRAM_BANK_2_ADDRESS; in acp_dma_hw_params()
953 rtd->pte_offset = ACP_CAPTURE_PTE_OFFSET; in acp_dma_hw_params()
954 rtd->sram_bank = ACP_SRAM_BANK_5_ADDRESS; in acp_dma_hw_params()
956 rtd->destination = FROM_ACP_I2S_1; in acp_dma_hw_params()
957 rtd->dma_dscr_idx_1 = CAPTURE_START_DMA_DESCR_CH14; in acp_dma_hw_params()
958 rtd->dma_dscr_idx_2 = CAPTURE_START_DMA_DESCR_CH15; in acp_dma_hw_params()
959 rtd->byte_cnt_high_reg_offset = in acp_dma_hw_params()
961 rtd->byte_cnt_low_reg_offset = in acp_dma_hw_params()
963 rtd->dma_curr_dscr = mmACP_DMA_CUR_DSCR_15; in acp_dma_hw_params()
970 acp_set_sram_bank_state(rtd->acp_mmio, 0, true); in acp_dma_hw_params()
972 rtd->dma_addr = runtime->dma_addr; in acp_dma_hw_params()
973 rtd->order = get_order(size); in acp_dma_hw_params()
976 rtd->size = size; in acp_dma_hw_params()
977 rtd->num_of_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; in acp_dma_hw_params()
978 rtd->direction = substream->stream; in acp_dma_hw_params()
980 config_acp_dma(rtd->acp_mmio, rtd, adata->asic_type); in acp_dma_hw_params()
984 static u64 acp_get_byte_count(struct audio_substream_data *rtd) in acp_get_byte_count() argument
988 byte_count.bcount.high = acp_reg_read(rtd->acp_mmio, in acp_get_byte_count()
989 rtd->byte_cnt_high_reg_offset); in acp_get_byte_count()
990 byte_count.bcount.low = acp_reg_read(rtd->acp_mmio, in acp_get_byte_count()
991 rtd->byte_cnt_low_reg_offset); in acp_get_byte_count()
1005 struct audio_substream_data *rtd = runtime->private_data; in acp_dma_pointer() local
1007 if (!rtd) in acp_dma_pointer()
1012 bytescount = acp_get_byte_count(rtd); in acp_dma_pointer()
1013 if (bytescount >= rtd->bytescount) in acp_dma_pointer()
1014 bytescount -= rtd->bytescount; in acp_dma_pointer()
1018 dscr = acp_reg_read(rtd->acp_mmio, rtd->dma_curr_dscr); in acp_dma_pointer()
1019 if (dscr == rtd->dma_dscr_idx_1) in acp_dma_pointer()
1030 bytescount = acp_get_byte_count(rtd); in acp_dma_pointer()
1031 if (bytescount > rtd->bytescount) in acp_dma_pointer()
1032 bytescount -= rtd->bytescount; in acp_dma_pointer()
1049 struct audio_substream_data *rtd = runtime->private_data; in acp_dma_prepare() local
1052 if (!rtd) in acp_dma_prepare()
1055 if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { in acp_dma_prepare()
1056 ch_acp_sysmem = rtd->ch1; in acp_dma_prepare()
1057 ch_acp_i2s = rtd->ch2; in acp_dma_prepare()
1059 ch_acp_i2s = rtd->ch1; in acp_dma_prepare()
1060 ch_acp_sysmem = rtd->ch2; in acp_dma_prepare()
1062 config_acp_dma_channel(rtd->acp_mmio, in acp_dma_prepare()
1064 rtd->dma_dscr_idx_1, in acp_dma_prepare()
1066 config_acp_dma_channel(rtd->acp_mmio, in acp_dma_prepare()
1068 rtd->dma_dscr_idx_2, in acp_dma_prepare()
1079 struct audio_substream_data *rtd = runtime->private_data; in acp_dma_trigger() local
1081 if (!rtd) in acp_dma_trigger()
1087 rtd->bytescount = acp_get_byte_count(rtd); in acp_dma_trigger()
1089 if (rtd->capture_channel == CAP_CHANNEL0) { in acp_dma_trigger()
1090 acp_dma_cap_channel_disable(rtd->acp_mmio, in acp_dma_trigger()
1092 acp_dma_cap_channel_enable(rtd->acp_mmio, in acp_dma_trigger()
1095 if (rtd->capture_channel == CAP_CHANNEL1) { in acp_dma_trigger()
1096 acp_dma_cap_channel_disable(rtd->acp_mmio, in acp_dma_trigger()
1098 acp_dma_cap_channel_enable(rtd->acp_mmio, in acp_dma_trigger()
1101 acp_dma_start(rtd->acp_mmio, rtd->ch1, true); in acp_dma_trigger()
1103 acp_dma_start(rtd->acp_mmio, rtd->ch1, true); in acp_dma_trigger()
1104 acp_dma_start(rtd->acp_mmio, rtd->ch2, true); in acp_dma_trigger()
1111 acp_dma_stop(rtd->acp_mmio, rtd->ch2); in acp_dma_trigger()
1112 ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1); in acp_dma_trigger()
1121 struct snd_soc_pcm_runtime *rtd) in acp_dma_new() argument
1128 snd_pcm_set_managed_buffer_all(rtd->pcm, in acp_dma_new()
1135 snd_pcm_set_managed_buffer_all(rtd->pcm, in acp_dma_new()
1150 struct audio_substream_data *rtd = runtime->private_data; in acp_dma_close() local
1154 switch (rtd->i2s_instance) { in acp_dma_close()
1175 switch (rtd->i2s_instance) { in acp_dma_close()
1197 kfree(rtd); in acp_dma_close()
1300 struct audio_substream_data *rtd; in acp_pcm_resume() local
1320 rtd = adata->play_i2ssp_stream->runtime->private_data; in acp_pcm_resume()
1321 config_acp_dma(adata->acp_mmio, rtd, adata->asic_type); in acp_pcm_resume()
1330 rtd = adata->capture_i2ssp_stream->runtime->private_data; in acp_pcm_resume()
1331 config_acp_dma(adata->acp_mmio, rtd, adata->asic_type); in acp_pcm_resume()
1336 rtd = adata->play_i2sbt_stream->runtime->private_data; in acp_pcm_resume()
1337 config_acp_dma(adata->acp_mmio, rtd, adata->asic_type); in acp_pcm_resume()
1341 rtd = adata->capture_i2sbt_stream->runtime->private_data; in acp_pcm_resume()
1342 config_acp_dma(adata->acp_mmio, rtd, adata->asic_type); in acp_pcm_resume()