Linux IIO development
 help / color / mirror / Atom feed
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 3/9] dmaengine: dw-axi-dmac: Use bus width capability helpers
Date: Thu, 30 Jul 2026 14:24:22 -0500	[thread overview]
Message-ID: <amuk5ic1FdzX49Of@SMW015318> (raw)
In-Reply-To: <20260730-dmaengine-support-wider-dma-masks-v1-3-3732f1f9d9ca@analog.com>

On Thu, Jul 30, 2026 at 03:23:10PM +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>
>
> Advertise the supported bus widths through dma_set_src_bus_widths()
> and dma_set_dst_bus_widths() instead of assigning the legacy u32 masks
> directly. This keeps the driver using the new bitmap representation
> while preserving legacy fields during the transition.
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 39 +++++++++++++++-----------
>  1 file changed, 23 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> index bcefaff03b5c..69cac7e3625f 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -33,20 +33,6 @@
>  #include "../dmaengine.h"
>  #include "../virt-dma.h"
>
> -/*
> - * The set of bus widths supported by the DMA controller. DW AXI DMAC supports
> - * master data bus width up to 512 bits (for both AXI master interfaces), but
> - * it depends on IP block configuration.
> - */
> -#define AXI_DMA_BUSWIDTHS                \
> -       (DMA_SLAVE_BUSWIDTH_1_BYTE      | \
> -       DMA_SLAVE_BUSWIDTH_2_BYTES      | \
> -       DMA_SLAVE_BUSWIDTH_4_BYTES      | \
> -       DMA_SLAVE_BUSWIDTH_8_BYTES      | \
> -       DMA_SLAVE_BUSWIDTH_16_BYTES     | \
> -       DMA_SLAVE_BUSWIDTH_32_BYTES     | \
> -       DMA_SLAVE_BUSWIDTH_64_BYTES)
> -
>  #define AXI_DMA_FLAG_HAS_APB_REGS      BIT(0)
>  #define AXI_DMA_FLAG_HAS_RESETS                BIT(1)
>  #define AXI_DMA_FLAG_USE_CFG2          BIT(2)
> @@ -1482,6 +1468,20 @@ static int dw_probe(struct platform_device *pdev)
>         unsigned int flags;
>         u32 i;
>         int ret;
> +       /*
> +        * The set of bus widths supported by the DMA controller. DW AXI DMAC
> +        * supports master data bus width up to 512 bits (for both AXI master
> +        * interfaces), but it depends on IP block configuration.
> +        */
> +       enum dma_slave_buswidth axi_dma_buswidths[] = {
> +               DMA_SLAVE_BUSWIDTH_1_BYTE,
> +               DMA_SLAVE_BUSWIDTH_2_BYTES,
> +               DMA_SLAVE_BUSWIDTH_4_BYTES,
> +               DMA_SLAVE_BUSWIDTH_8_BYTES,
> +               DMA_SLAVE_BUSWIDTH_16_BYTES,
> +               DMA_SLAVE_BUSWIDTH_32_BYTES,
> +               DMA_SLAVE_BUSWIDTH_64_BYTES,
> +       };
>
>         chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
>         if (!chip)
> @@ -1565,8 +1565,15 @@ static int dw_probe(struct platform_device *pdev)
>
>         /* DMA capabilities */
>         dw->dma.max_burst = hdata->axi_rw_burst_len;
> -       dw->dma.src_addr_widths = AXI_DMA_BUSWIDTHS;
> -       dw->dma.dst_addr_widths = AXI_DMA_BUSWIDTHS;
> +       ret = dma_set_src_bus_widths(&dw->dma, axi_dma_buswidths,
> +                                    ARRAY_SIZE(axi_dma_buswidths));
> +       if (ret)
> +               return ret;
> +
> +       ret = dma_set_dst_bus_widths(&dw->dma, axi_dma_buswidths,
> +                                    ARRAY_SIZE(axi_dma_buswidths));
> +       if (ret)
> +               return ret;
>         dw->dma.directions = BIT(DMA_MEM_TO_MEM);
>         dw->dma.directions |= BIT(DMA_MEM_TO_DEV) | BIT(DMA_DEV_TO_MEM);
>         dw->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
>
> --
> 2.55.0
>
>

  reply	other threads:[~2026-07-30 19:24 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 19:16   ` Frank Li
2026-08-01  2:42     ` Jonathan Cameron
2026-08-01  2:46       ` Jonathan Cameron
2026-08-03 12:35         ` Nuno Sá
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 19:23   ` Frank Li
2026-07-30 14:23 ` [PATCH 3/9] dmaengine: dw-axi-dmac: " Nuno Sá via B4 Relay
2026-07-30 19:24   ` Frank Li [this message]
2026-07-30 14:23 ` [PATCH 4/9] dmaengine: qcom: gpi: " Nuno Sá via B4 Relay
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 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
2026-07-30 14:23 ` [PATCH 8/9] spi: dw: " Nuno Sá via B4 Relay
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-08-03 12:38     ` Nuno Sá
2026-07-30 19:05 ` [PATCH 0/9] dmaengine: Support bus widths of 32 bytes and above Frank Li
2026-07-31 15:34   ` Nuno Sá
2026-07-31 15:51     ` 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=amuk5ic1FdzX49Of@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