From e524b2bcb4b874176762a61520b9e8662b163651 Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Fri, 28 Jun 2019 12:36:03 +0800 Subject: MLK-11259-2: ASoC: fsl: enable ASRC p2p for ssi->wm8962 (part 2) Enable ASRC p2p for ssi->wm8962, base on the new p2p script, which support to select dualfifo for source/destination device. Signed-off-by: Shengjiu Wang [ Aisheng: split imx-wm8962.c changes ] Signed-off-by: Dong Aisheng --- sound/soc/fsl/fsl_asrc_dma.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sound/soc/fsl/fsl_asrc_dma.c') diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index 01052a0808b0..5c8e5adf80c1 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -148,6 +148,7 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, struct device *dev_be; u8 dir = tx ? OUT : IN; dma_cap_mask_t mask; + enum sdma_peripheral_type be_peripheral_type; int ret; /* Fetch the Back-End dma_data from DPCM */ @@ -203,6 +204,7 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, tmp_chan = dma_request_slave_channel(dev_be, tx ? "tx" : "rx"); tmp_data = tmp_chan->private; pair->dma_data.dma_request = tmp_data->dma_request; + be_peripheral_type = tmp_data->peripheral_type; dma_release_channel(tmp_chan); /* Get DMA request of Front-End */ @@ -213,6 +215,11 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, pair->dma_data.priority = tmp_data->priority; dma_release_channel(tmp_chan); + if (tx && be_peripheral_type == IMX_DMATYPE_SSI_DUAL) + pair->dma_data.dst_dualfifo = true; + if (!tx && be_peripheral_type == IMX_DMATYPE_SSI_DUAL) + pair->dma_data.src_dualfifo = true; + pair->dma_chan[dir] = dma_request_channel(mask, filter, &pair->dma_data); if (!pair->dma_chan[dir]) { dev_err(dev, "failed to request DMA channel for Back-End\n"); @@ -224,6 +231,8 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, else buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES; + memset(&config_be, 0, sizeof(config_be)); + config_be.direction = DMA_DEV_TO_DEV; config_be.src_addr_width = buswidth; config_be.src_maxburst = dma_params_be->maxburst; -- cgit v1.2.3