From: Frank Li <Frank.li@oss.nxp.com>
To: nuno.sa@analog.com
Cc: dmaengine@vger.kernel.org, linux-iio@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH 7/9] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers
Date: Thu, 30 Jul 2026 14:30:17 -0500 [thread overview]
Message-ID: <amumSQ6dUoWnkg_Z@SMW015318> (raw)
In-Reply-To: <20260730-dmaengine-support-wider-dma-masks-v1-7-3732f1f9d9ca@analog.com>
On Thu, Jul 30, 2026 at 03:23:14PM +0100, Nuno Sá via B4 Relay wrote:
> [You don't often get email from devnull+nuno.sa.analog.com@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Nuno Sá <nuno.sa@analog.com>
>
> Use the dma_slave_caps bus width helpers instead of reading the legacy
> src_addr_widths and dst_addr_widths masks directly.
>
> Keep the existing default assumption of 1, 2 and 4 byte widths when the
> DMA channel does not report slave capabilities.
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> sound/core/pcm_dmaengine.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
> index 1306b04be171..37468f4643bc 100644
> --- a/sound/core/pcm_dmaengine.c
> +++ b/sound/core/pcm_dmaengine.c
> @@ -409,15 +409,17 @@ int snd_dmaengine_pcm_refine_runtime_hwparams(
> struct dma_chan *chan)
> {
> struct dma_slave_caps dma_caps;
> - u32 addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
> - BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
> - BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
> + DECLARE_DMA_BUS_WIDTHS(bus_widths) = {};
> snd_pcm_format_t i;
> int ret = 0;
>
> if (!hw || !chan || !dma_data)
> return -EINVAL;
>
> + __set_bit(DMA_SLAVE_BUSWIDTH_1_BYTE, bus_widths);
> + __set_bit(DMA_SLAVE_BUSWIDTH_2_BYTES, bus_widths);
> + __set_bit(DMA_SLAVE_BUSWIDTH_4_BYTES, bus_widths);
> +
> ret = dma_get_slave_caps(chan, &dma_caps);
> if (ret == 0) {
> if (dma_caps.cmd_pause && dma_caps.cmd_resume)
> @@ -426,9 +428,9 @@ int snd_dmaengine_pcm_refine_runtime_hwparams(
> hw->info |= SNDRV_PCM_INFO_BATCH;
>
> if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
> - addr_widths = dma_caps.dst_addr_widths;
> + dma_slave_caps_copy_dst_widths(&dma_caps, bus_widths);
> else
> - addr_widths = dma_caps.src_addr_widths;
> + dma_slave_caps_copy_src_widths(&dma_caps, bus_widths);
> }
>
> /*
> @@ -460,7 +462,7 @@ int snd_dmaengine_pcm_refine_runtime_hwparams(
> case 24:
> case 32:
> case 64:
> - if (addr_widths & (1 << (bits / 8)))
> + if (test_bit(bits / 8, bus_widths))
> hw->formats |= pcm_format_to_bits(i);
> break;
> default:
>
> --
> 2.55.0
>
>
next prev parent reply other threads:[~2026-07-30 19:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 14:23 [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above Nuno Sá via B4 Relay
2026-07-30 14:23 ` [PATCH 1/9] " Nuno Sá via B4 Relay
2026-07-30 14:38 ` sashiko-bot
2026-07-30 19:16 ` Frank Li
2026-07-30 14:23 ` [PATCH 2/9] dmaengine: dma-axi-dmac: Use bus width capability helpers Nuno Sá via B4 Relay
2026-07-30 14:39 ` sashiko-bot
2026-07-30 19:23 ` Frank Li
2026-07-30 14:23 ` [PATCH 3/9] dmaengine: dw-axi-dmac: " Nuno Sá via B4 Relay
2026-07-30 14:36 ` sashiko-bot
2026-07-30 19:24 ` Frank Li
2026-07-30 14:23 ` [PATCH 4/9] dmaengine: qcom: gpi: " Nuno Sá via B4 Relay
2026-07-30 14:43 ` sashiko-bot
2026-07-30 19:25 ` Frank Li
2026-07-30 14:23 ` [PATCH 5/9] dmaengine: stm32-dma3: " Nuno Sá via B4 Relay
2026-07-30 14:35 ` sashiko-bot
2026-07-30 19:26 ` Frank Li
2026-07-30 14:23 ` [PATCH 6/9] iio: buffer-dmaengine: Use dma_slave_caps bus width accessors Nuno Sá via B4 Relay
2026-07-30 19:27 ` Frank Li
2026-07-30 14:23 ` [PATCH 7/9] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers Nuno Sá via B4 Relay
2026-07-30 19:30 ` Frank Li [this message]
2026-07-30 14:23 ` [PATCH 8/9] spi: dw: " Nuno Sá via B4 Relay
2026-07-30 14:43 ` sashiko-bot
2026-07-30 19:31 ` Frank Li
2026-07-30 14:23 ` [PATCH 9/9] dmaengine: Drop legacy bus width fields from dma_slave_caps Nuno Sá via B4 Relay
2026-07-30 19:34 ` Frank Li
2026-07-30 19:05 ` [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above Frank Li
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=amumSQ6dUoWnkg_Z@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=dmaengine@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=vkoul@kernel.org \
/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