mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank.Li@oss.nxp.com
To: Lars-Peter Clausen <lars@metafoo.de>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Xiubo Li <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Kexin Sun <kexinsun@smail.nju.edu.cn>,
	Frank Li <Frank.Li@nxp.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Tianchu Chen <flynnnchen@tencent.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	bui duc phuc <phucduc.bui@gmail.com>,
	Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>,
	linux-sound@vger.kernel.org (open list:SOUND),
	linux-kernel@vger.kernel.org (open list),
	linuxppc-dev@lists.ozlabs.org (open list:FREESCALE SOC SOUND
	DRIVERS),
	linux-renesas-soc@vger.kernel.org (open list:RENESAS R-CAR & FSI
	AUDIO (ASoC) DRIVERS),
	linux-stm32@st-md-mailman.stormreply.com (moderated
	list:ARM/STM32 ARCHITECTURE),
	linux-arm-kernel@lists.infradead.org (moderated list:ARM/STM32
	ARCHITECTURE)
Cc: imx@lists.linux.dev, vkoul@kernel.org
Subject: [PATCH 1/1] ASoC/sound: use dmaengine_desc_set_callback()
Date: Mon,  2 Nov 2026 13:09:08 -0500	[thread overview]
Message-ID: <20261102180915.3981805-1-Frank.Li@oss.nxp.com> (raw)

From: Frank Li <Frank.Li@nxp.com>

Replace open-coded assignments to callback and callback_param fields
of struct dma_async_tx_descriptor with calls to the
dmaengine_desc_set_callback() helper across sound drivers.

No functional change intended. Prepare to make struct
dma_async_tx_descriptor private to the DMA engine.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 sound/core/pcm_dmaengine.c         | 3 +--
 sound/soc/fsl/fsl_asrc_dma.c       | 3 +--
 sound/soc/fsl/fsl_asrc_m2m.c       | 3 +--
 sound/soc/renesas/fsi.c            | 3 +--
 sound/soc/renesas/siu_pcm.c        | 6 ++----
 sound/soc/sprd/sprd-pcm-compress.c | 5 +++--
 sound/soc/sprd/sprd-pcm-dma.c      | 5 +++--
 sound/soc/stm/stm32_spdifrx.c      | 3 +--
 8 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index 1306b04be171a..41feb5312ffec 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -169,8 +169,7 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
 	if (!desc)
 		return -ENOMEM;
 
-	desc->callback = dmaengine_pcm_dma_complete;
-	desc->callback_param = substream;
+	dmaengine_desc_set_callback(desc, dmaengine_pcm_dma_complete, NULL, substream);
 	prtd->cookie = dmaengine_submit(desc);
 
 	return 0;
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index b417de6abebe4..cd3bf6340b650 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -76,8 +76,7 @@ static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream,
 		return -ENOMEM;
 	}
 
-	pair->desc[!dir]->callback = fsl_asrc_dma_complete;
-	pair->desc[!dir]->callback_param = substream;
+	dmaengine_desc_set_callback(pair->desc[!dir], fsl_asrc_dma_complete, NULL, substream);
 
 	dmaengine_submit(pair->desc[!dir]);
 
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index 58101ce07c9f9..c6970a7e88f3f 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -176,8 +176,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair,
 		return -EINVAL;
 	}
 
-	pair->desc[dir]->callback = ASRC_xPUT_DMA_CALLBACK(dir);
-	pair->desc[dir]->callback_param = pair;
+	dmaengine_desc_set_callback(pair->desc[dir], ASRC_xPUT_DMA_CALLBACK(dir), NULL, pair);
 
 	return 0;
 }
diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
index 74e2ea002fbb1..fa21cf47befff 100644
--- a/sound/soc/renesas/fsi.c
+++ b/sound/soc/renesas/fsi.c
@@ -1375,8 +1375,7 @@ static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
 		goto fsi_dma_transfer_err;
 	}
 
-	desc->callback		= fsi_dma_complete;
-	desc->callback_param	= io;
+	dmaengine_desc_set_callback(desc, fsi_dma_complete, NULL, io);
 
 	if (dmaengine_submit(desc) < 0) {
 		dev_err(dai->dev, "tx_submit() fail\n");
diff --git a/sound/soc/renesas/siu_pcm.c b/sound/soc/renesas/siu_pcm.c
index fd5b20b469a4a..7208514e16a43 100644
--- a/sound/soc/renesas/siu_pcm.c
+++ b/sound/soc/renesas/siu_pcm.c
@@ -125,8 +125,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info,
 		return -ENOMEM;
 	}
 
-	desc->callback = siu_dma_tx_complete;
-	desc->callback_param = siu_stream;
+	dmaengine_desc_set_callback(desc, siu_dma_tx_complete, NULL, siu_stream);
 	cookie = dmaengine_submit(desc);
 	if (cookie < 0) {
 		dev_err(dev, "Failed to submit a dma transfer\n");
@@ -175,8 +174,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info,
 		return -ENOMEM;
 	}
 
-	desc->callback = siu_dma_tx_complete;
-	desc->callback_param = siu_stream;
+	dmaengine_desc_set_callback(desc, siu_dma_tx_complete, NULL, siu_stream);
 	cookie = dmaengine_submit(desc);
 	if (cookie < 0) {
 		dev_err(dev, "Failed to submit dma descriptor\n");
diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
index f790b959cd4e4..a810c9c8a0b5b 100644
--- a/sound/soc/sprd/sprd-pcm-compress.c
+++ b/sound/soc/sprd/sprd-pcm-compress.c
@@ -247,8 +247,9 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
 
 	/* Only channel 1 transfer can wake up the AP system. */
 	if (!params->no_wake_mode && channel == 1) {
-		dma->desc->callback = sprd_platform_compr_dma_complete;
-		dma->desc->callback_param = cstream;
+		dmaengine_desc_set_callback(dma->desc,
+					    sprd_platform_compr_dma_complete,
+					    NULL, cstream);
 	}
 
 	kfree(sg);
diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
index bbd7516f81954..968901ae4c335 100644
--- a/sound/soc/sprd/sprd-pcm-dma.c
+++ b/sound/soc/sprd/sprd-pcm-dma.c
@@ -287,8 +287,9 @@ static int sprd_pcm_hw_params(struct snd_soc_component *component,
 		}
 
 		if (!runtime->no_period_wakeup) {
-			data->desc->callback = sprd_pcm_dma_complete;
-			data->desc->callback_param = dma_private;
+			dmaengine_desc_set_callback(data->desc,
+						    sprd_pcm_dma_complete,
+						    NULL, dma_private);
 		}
 	}
 
diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 88863dbd05d9b..44467a25fb69a 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -302,8 +302,7 @@ static int stm32_spdifrx_dma_ctrl_start(struct stm32_spdifrx_data *spdifrx)
 	if (!spdifrx->desc)
 		return -EINVAL;
 
-	spdifrx->desc->callback = stm32_spdifrx_dma_complete;
-	spdifrx->desc->callback_param = spdifrx;
+	dmaengine_desc_set_callback(spdifrx->desc, stm32_spdifrx_dma_complete, NULL, spdifrx);
 	cookie = dmaengine_submit(spdifrx->desc);
 	err = dma_submit_error(cookie);
 	if (err)
-- 
2.43.0


             reply	other threads:[~2026-11-02 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 18:09 Frank.Li [this message]
2026-11-03 23:53 ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261102180915.3981805-1-Frank.Li@oss.nxp.com \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=flynnnchen@tencent.com \
    --cc=imx@lists.linux.dev \
    --cc=kexinsun@smail.nju.edu.cn \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=liviu.dudau@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=orsonzhai@gmail.com \
    --cc=perex@perex.cz \
    --cc=phucduc.bui@gmail.com \
    --cc=shengjiu.wang@gmail.com \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®