* [PATCH 1/4] ASoC: apple: mca: Use dmaengine_get_dma_device() instead of chan->device->dev
2026-11-06 20:13 [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Frank.Li
@ 2026-11-06 20:13 ` Frank.Li
2026-11-06 20:13 ` [PATCH 2/4] ASoC: fsl: asrc: Use dmaengine API " Frank.Li
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Frank.Li @ 2026-11-06 20:13 UTC (permalink / raw)
To: Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Kuninori Morimoto, Geert Uytterhoeven, Magnus Damm,
Sen Wang
Cc: asahi, linux-sound, linux-kernel, linuxppc-dev,
linux-renesas-soc, imx, vkoul, Frank Li
From: Frank Li <Frank.Li@nxp.com>
Replace open-coded chan->device->dev with the accessor
dmaengine_get_dma_device() to avoid direct access to DMA engine
internals.
Prepare to make struct dma_device private.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
sound/soc/apple/mca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c
index 26022a42a95ec..b4ca8ec78488f 100644
--- a/sound/soc/apple/mca.c
+++ b/sound/soc/apple/mca.c
@@ -940,7 +940,7 @@ static int mca_set_runtime_hwparams(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct dma_chan *chan)
{
- struct device *dma_dev = chan->device->dev;
+ struct device *dma_dev = dmaengine_get_dma_device(chan);
struct snd_dmaengine_dai_dma_data dma_data = {};
int ret;
@@ -1123,7 +1123,7 @@ static int mca_pcm_new(struct snd_soc_component *component,
cl->dma_chans[i] = chan;
snd_pcm_set_managed_buffer(substream, SNDRV_DMA_TYPE_DEV_IRAM,
- chan->device->dev, 512 * 1024 * 6,
+ dmaengine_get_dma_device(chan), 512 * 1024 * 6,
SIZE_MAX);
}
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/4] ASoC: fsl: asrc: Use dmaengine API instead of chan->device->dev
2026-11-06 20:13 [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Frank.Li
2026-11-06 20:13 ` [PATCH 1/4] ASoC: apple: mca: Use dmaengine_get_dma_device() " Frank.Li
@ 2026-11-06 20:13 ` Frank.Li
2026-11-06 20:13 ` [PATCH 3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() " Frank.Li
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Frank.Li @ 2026-11-06 20:13 UTC (permalink / raw)
To: Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Kuninori Morimoto, Geert Uytterhoeven, Magnus Damm,
Sen Wang
Cc: asahi, linux-sound, linux-kernel, linuxppc-dev,
linux-renesas-soc, imx, vkoul, Frank Li
From: Frank Li <Frank.Li@nxp.com>
Replace open-coded chan->device->dev with dmaengine_get_dma_device()
and chan->device->dev->of_node with
dmaengine_get_provider_device()->of_node to avoid direct access to
DMA engine internals.
dmaengine_get_dma_device(): for dma map device, may return pre chan device
if dmaengine support per chan iommu mapping.
dmaengine_get_provider_device(): for dmaengine device filter, which have
of_node.
Prepare to make struct dma_device private.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
sound/soc/fsl/fsl_asrc_dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index cd3bf6340b650..71f84359df3af 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -261,7 +261,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
pair->dma_data.priority = tmp_data->priority;
dma_release_channel(tmp_chan);
- of_dma_node = pair->dma_chan[!dir]->device->dev->of_node;
+ of_dma_node = dmaengine_get_provider_device(pair->dma_chan[!dir])->of_node;
pair->dma_chan[dir] =
__dma_request_channel(&mask, filter, &pair->dma_data,
of_dma_node);
@@ -526,7 +526,7 @@ static int fsl_asrc_dma_pcm_new(struct snd_soc_component *component,
ret = snd_pcm_set_fixed_buffer_all(pcm,
SNDRV_DMA_TYPE_DEV,
- chan->device->dev,
+ dmaengine_get_dma_device(chan),
FSL_ASRC_DMABUF_SIZE);
dma_release_channel(chan);
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() instead of chan->device->dev
2026-11-06 20:13 [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Frank.Li
2026-11-06 20:13 ` [PATCH 1/4] ASoC: apple: mca: Use dmaengine_get_dma_device() " Frank.Li
2026-11-06 20:13 ` [PATCH 2/4] ASoC: fsl: asrc: Use dmaengine API " Frank.Li
@ 2026-11-06 20:13 ` Frank.Li
2026-11-09 1:39 ` Kuninori Morimoto
2026-11-06 20:13 ` [PATCH 4/4] ASoC: ti: davinci-mcasp: Use dmaengine_get_provider_device() API Frank.Li
2026-11-09 12:45 ` [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Mark Brown
4 siblings, 1 reply; 7+ messages in thread
From: Frank.Li @ 2026-11-06 20:13 UTC (permalink / raw)
To: Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Kuninori Morimoto, Geert Uytterhoeven, Magnus Damm,
Sen Wang
Cc: asahi, linux-sound, linux-kernel, linuxppc-dev,
linux-renesas-soc, imx, vkoul, Frank Li
From: Frank Li <Frank.Li@nxp.com>
Replace open-coded chan->device->dev with the accessor
dmaengine_get_dma_device() to avoid direct access to DMA engine
internals.
Prepare to make struct dma_device private.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
sound/soc/renesas/rcar/dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/renesas/rcar/dma.c b/sound/soc/renesas/rcar/dma.c
index 793dd4adbe5c6..d70cc71676df6 100644
--- a/sound/soc/renesas/rcar/dma.c
+++ b/sound/soc/renesas/rcar/dma.c
@@ -246,7 +246,7 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
* see
* rsnd_preallocate_pages()
*/
- io->dmac_dev = chan->device->dev;
+ io->dmac_dev = dmaengine_get_dma_device(chan);
dma_release_channel(chan);
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() instead of chan->device->dev
2026-11-06 20:13 ` [PATCH 3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() " Frank.Li
@ 2026-11-09 1:39 ` Kuninori Morimoto
0 siblings, 0 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2026-11-09 1:39 UTC (permalink / raw)
To: Frank.Li
Cc: Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Geert Uytterhoeven, Magnus Damm, Sen Wang, asahi,
linux-sound, linux-kernel, linuxppc-dev, linux-renesas-soc, imx,
vkoul, Frank Li
Hi
> Replace open-coded chan->device->dev with the accessor
> dmaengine_get_dma_device() to avoid direct access to DMA engine
> internals.
>
> Prepare to make struct dma_device private.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] ASoC: ti: davinci-mcasp: Use dmaengine_get_provider_device() API
2026-11-06 20:13 [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Frank.Li
` (2 preceding siblings ...)
2026-11-06 20:13 ` [PATCH 3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() " Frank.Li
@ 2026-11-06 20:13 ` Frank.Li
2026-11-09 12:45 ` [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Mark Brown
4 siblings, 0 replies; 7+ messages in thread
From: Frank.Li @ 2026-11-06 20:13 UTC (permalink / raw)
To: Martin Povišer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Kuninori Morimoto, Geert Uytterhoeven, Magnus Damm,
Sen Wang
Cc: asahi, linux-sound, linux-kernel, linuxppc-dev,
linux-renesas-soc, imx, vkoul, Frank Li
From: Frank Li <Frank.Li@nxp.com>
Replace open-coded chan->device->dev with dmaengine_get_provider_device()
to avoid direct access to DMA engine internals. The WARN_ON check for
chan->device is no longer needed since already checked return value of
dma_request_chan(). It is impossible dma_chan is not NULL and DMA engine
device is NULL.
Prepare to make struct dma_device private.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
sound/soc/ti/davinci-mcasp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 481d1042ddb6d..e871925517dca 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2477,6 +2477,7 @@ static const char *sdma_prefix = "ti,omap";
static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
{
struct dma_chan *chan;
+ struct device *dma_dev;
const char *tmp;
int ret = PCM_EDMA;
@@ -2488,13 +2489,10 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
if (IS_ERR(chan))
return dev_err_probe(mcasp->dev, PTR_ERR(chan),
"Can't verify DMA configuration\n");
- if (WARN_ON(!chan->device || !chan->device->dev)) {
- dma_release_channel(chan);
- return -EINVAL;
- }
- if (chan->device->dev->of_node)
- ret = of_property_read_string(chan->device->dev->of_node,
+ dma_dev = dmaengine_get_provider_device(chan);
+ if (dma_dev->of_node)
+ ret = of_property_read_string(dma_dev->of_node,
"compatible", &tmp);
else
dev_dbg(mcasp->dev, "DMA controller has no of-node\n");
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev
2026-11-06 20:13 [PATCH 0/4] ASoC: Use dmaengine API instead of chan->device->dev Frank.Li
` (3 preceding siblings ...)
2026-11-06 20:13 ` [PATCH 4/4] ASoC: ti: davinci-mcasp: Use dmaengine_get_provider_device() API Frank.Li
@ 2026-11-09 12:45 ` Mark Brown
4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-11-09 12:45 UTC (permalink / raw)
To: Martin Povišer, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Kuninori Morimoto, Geert Uytterhoeven, Magnus Damm,
Sen Wang, Frank.Li
Cc: asahi, linux-sound, linux-kernel, linuxppc-dev,
linux-renesas-soc, imx, vkoul, Frank Li
On Fri, 06 Nov 2026 15:13:44 -0500, Frank.Li@oss.nxp.com wrote:
> ASoC: Use dmaengine API instead of chan->device->dev
>
> Replace open-coded chan->device->dev accesses in ASoC drivers with
> the proper dmaengine accessor APIs:
>
> - dmaengine_get_dma_device(): returns the device used for DMA
> mappings; may return a per-channel device if the dmaengine
> supports per-channel IOMMU mapping.
> - dmaengine_get_provider_device(): returns the dmaengine provider
> device that carries the of_node, used for device-tree based
> channel filtering.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/4] ASoC: apple: mca: Use dmaengine_get_dma_device() instead of chan->device->dev
https://git.kernel.org/broonie/sound/c/69d9cfe10445
[2/4] ASoC: fsl: asrc: Use dmaengine API instead of chan->device->dev
https://git.kernel.org/broonie/sound/c/5aacfc0388c4
[3/4] ASoC: renesas: rcar: Use dmaengine_get_dma_device() instead of chan->device->dev
https://git.kernel.org/broonie/sound/c/77c4d4f760d3
[4/4] ASoC: ti: davinci-mcasp: Use dmaengine_get_provider_device() API
https://git.kernel.org/broonie/sound/c/2a2c53477627
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread