Commit fa9d2f17 authored by Agrawal, Akshu's avatar Agrawal, Akshu Committed by Mark Brown

ASoC: AMD: Send correct channel for configuring DMA descriptors

Earlier, ch1 was used to define ACP-SYSMEM transfer and ch2 for
ACP-I2S transfer. With recent patches ch1 is used to define channel
order number 1 and ch2 as channel order number 2. Thus,
Playback:
ch1:SYSMEM->ACP
ch2:ACP->I2S
Capture:
ch1:I2S->ACP
ch1:ACP->SYSMEM
Signed-off-by: default avatarAkshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8452112b
...@@ -322,17 +322,27 @@ static void config_acp_dma(void __iomem *acp_mmio, ...@@ -322,17 +322,27 @@ static void config_acp_dma(void __iomem *acp_mmio,
struct audio_substream_data *rtd, struct audio_substream_data *rtd,
u32 asic_type) u32 asic_type)
{ {
u16 ch_acp_sysmem, ch_acp_i2s;
acp_pte_config(acp_mmio, rtd->pg, rtd->num_of_pages, acp_pte_config(acp_mmio, rtd->pg, rtd->num_of_pages,
rtd->pte_offset); rtd->pte_offset);
if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) {
ch_acp_sysmem = rtd->ch1;
ch_acp_i2s = rtd->ch2;
} else {
ch_acp_i2s = rtd->ch1;
ch_acp_sysmem = rtd->ch2;
}
/* Configure System memory <-> ACP SRAM DMA descriptors */ /* Configure System memory <-> ACP SRAM DMA descriptors */
set_acp_sysmem_dma_descriptors(acp_mmio, rtd->size, set_acp_sysmem_dma_descriptors(acp_mmio, rtd->size,
rtd->direction, rtd->pte_offset, rtd->direction, rtd->pte_offset,
rtd->ch1, rtd->sram_bank, ch_acp_sysmem, rtd->sram_bank,
rtd->dma_dscr_idx_1, asic_type); rtd->dma_dscr_idx_1, asic_type);
/* Configure ACP SRAM <-> I2S DMA descriptors */ /* Configure ACP SRAM <-> I2S DMA descriptors */
set_acp_to_i2s_dma_descriptors(acp_mmio, rtd->size, set_acp_to_i2s_dma_descriptors(acp_mmio, rtd->size,
rtd->direction, rtd->sram_bank, rtd->direction, rtd->sram_bank,
rtd->destination, rtd->ch2, rtd->destination, ch_acp_i2s,
rtd->dma_dscr_idx_2, asic_type); rtd->dma_dscr_idx_2, asic_type);
} }
...@@ -995,16 +1005,24 @@ static int acp_dma_prepare(struct snd_pcm_substream *substream) ...@@ -995,16 +1005,24 @@ static int acp_dma_prepare(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct audio_substream_data *rtd = runtime->private_data; struct audio_substream_data *rtd = runtime->private_data;
u16 ch_acp_sysmem, ch_acp_i2s;
if (!rtd) if (!rtd)
return -EINVAL; return -EINVAL;
if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) {
ch_acp_sysmem = rtd->ch1;
ch_acp_i2s = rtd->ch2;
} else {
ch_acp_i2s = rtd->ch1;
ch_acp_sysmem = rtd->ch2;
}
config_acp_dma_channel(rtd->acp_mmio, config_acp_dma_channel(rtd->acp_mmio,
rtd->ch1, ch_acp_sysmem,
rtd->dma_dscr_idx_1, rtd->dma_dscr_idx_1,
NUM_DSCRS_PER_CHANNEL, 0); NUM_DSCRS_PER_CHANNEL, 0);
config_acp_dma_channel(rtd->acp_mmio, config_acp_dma_channel(rtd->acp_mmio,
rtd->ch2, ch_acp_i2s,
rtd->dma_dscr_idx_2, rtd->dma_dscr_idx_2,
NUM_DSCRS_PER_CHANNEL, 0); NUM_DSCRS_PER_CHANNEL, 0);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment