From nobody Thu May 7 19:48:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A926EC433EF for ; Fri, 20 May 2022 03:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345132AbiETDSq (ORCPT ); Thu, 19 May 2022 23:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345126AbiETDSn (ORCPT ); Thu, 19 May 2022 23:18:43 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9285DA3E for ; Thu, 19 May 2022 20:18:41 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 169FF201365; Fri, 20 May 2022 05:18:40 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D0E79201362; Fri, 20 May 2022 05:18:39 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id AB7CE180031F; Fri, 20 May 2022 11:18:38 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_asrc_dma: enable dual fifo for ASRC P2P Date: Fri, 20 May 2022 11:06:00 +0800 Message-Id: <1653015960-15474-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The SSI and SPDIF has dual fifos, enhance P2P for these case with using the sdma_peripheral_config struct Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc_dma.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index 5038faf035cb..aaf7993935b7 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -129,6 +129,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_compon= ent *component, struct snd_pcm_hw_params *params) { enum dma_slave_buswidth buswidth =3D DMA_SLAVE_BUSWIDTH_2_BYTES; + enum sdma_peripheral_type be_peripheral_type =3D IMX_DMATYPE_SSI; struct snd_soc_pcm_runtime *rtd =3D asoc_substream_to_rtd(substream); bool tx =3D substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK; struct snd_dmaengine_dai_dma_data *dma_params_fe =3D NULL; @@ -139,6 +140,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_compon= ent *component, struct snd_soc_component *component_be =3D NULL; struct fsl_asrc *asrc =3D pair->asrc; struct dma_slave_config config_fe, config_be; + struct sdma_peripheral_config audio_config; enum asrc_pair_index index =3D pair->index; struct device *dev =3D component->dev; struct device_node *of_dma_node; @@ -221,6 +223,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_compon= ent *component, /* Get DMA request of Back-End */ tmp_data =3D tmp_chan->private; pair->dma_data.dma_request =3D tmp_data->dma_request; + be_peripheral_type =3D tmp_data->peripheral_type; if (!be_chan) dma_release_channel(tmp_chan); =20 @@ -268,6 +271,17 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_compo= nent *component, config_be.dst_addr_width =3D buswidth; config_be.dst_maxburst =3D dma_params_be->maxburst; =20 + memset(&audio_config, 0, sizeof(audio_config)); + config_be.peripheral_config =3D &audio_config; + config_be.peripheral_size =3D sizeof(audio_config); + + if (tx && (be_peripheral_type =3D=3D IMX_DMATYPE_SSI_DUAL || + be_peripheral_type =3D=3D IMX_DMATYPE_SPDIF)) + audio_config.n_fifos_dst =3D 2; + if (!tx && (be_peripheral_type =3D=3D IMX_DMATYPE_SSI_DUAL || + be_peripheral_type =3D=3D IMX_DMATYPE_SPDIF)) + audio_config.n_fifos_src =3D 2; + if (tx) { config_be.src_addr =3D asrc->paddr + asrc->get_fifo_addr(OUT, index); config_be.dst_addr =3D dma_params_be->addr; --=20 2.17.1