summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc_dma.c
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2019-06-28 12:36:03 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:48:22 +0800
commite524b2bcb4b874176762a61520b9e8662b163651 (patch)
treee2a3e894f174dbf30713f18b5a5ba0040db87cdf /sound/soc/fsl/fsl_asrc_dma.c
parentf54a93b477539524740ca786de646b9b0b571822 (diff)
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 <shengjiu.wang@freescale.com> [ Aisheng: split imx-wm8962.c changes ] Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc_dma.c')
-rw-r--r--sound/soc/fsl/fsl_asrc_dma.c9
1 files changed, 9 insertions, 0 deletions
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;