Re: [PATCH v4 01/10] dmaengine: Move enum dma_slave_buswidth to a new header

From: Frank Li

Date: Mon Sep 14 2026 - 10:19:11 EST


On Fri, Sep 11, 2026 at 06:25:36PM +0100, Nuno Sá wrote:
> In preparation for the bitmap based bus width capabilities, move
> enum dma_slave_buswidth out of linux/dmaengine.h into a new
> include/linux/dma/engine/types.h.
>
> linux/dmaengine.h is included nearly everywhere, so growing it with the
> new interface would make every one of its users pay for it. Keeping the
> basic types in a separate header lets the new interface live next to it
> without that cost. linux/dmaengine.h includes the new header, so its
> users are unaffected.
>
> While at it, add the missing kernel-doc for the enum members. The block
> already opened with /**, so kernel-doc expected every member to be
> described and warned about each one of them. Describe the UNDEFINED case
> in particular, as its meaning depends on where the value is used.
>
> No functional change intended.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> ---
> include/linux/dma/engine/types.h | 41 ++++++++++++++++++++++++++++++++++++++++
> include/linux/dmaengine.h | 20 +++-----------------

I think it is good to split dmengine consumer and provider header files to
hidden dmaengine's detail.

suggest name
dma/engine.h

so we can start move more API to this files.

after all user include this consumer header file, old
include/linux/dmaengine.h rename to include/linux/dmaengine-provider.h,
which only include by dmaengine drivers.

Frank

> 2 files changed, 44 insertions(+), 17 deletions(-)
>
> diff --git a/include/linux/dma/engine/types.h b/include/linux/dma/engine/types.h
> new file mode 100644
> index 000000000000..2e8a266e42ef
> --- /dev/null
> +++ b/include/linux/dma/engine/types.h
> @@ -0,0 +1,41 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Basic types shared by the DMA engine interfaces.
> + */
> +#ifndef LINUX_DMA_ENGINE_TYPES_H
> +#define LINUX_DMA_ENGINE_TYPES_H
> +
> +#include <linux/types.h>
> +
> +/**
> + * enum dma_slave_buswidth - defines bus width of the DMA slave
> + * device, source or target buses
> + * @DMA_SLAVE_BUSWIDTH_UNDEFINED: no bus width specified. In a
> + * &struct dma_slave_config it lets the controller pick a width, typically
> + * derived from the transfer itself. In a bus width mask it is a width a
> + * controller genuinely accepts, meaning it imposes no constraint of its
> + * own.
> + * @DMA_SLAVE_BUSWIDTH_1_BYTE: 1 byte wide bus
> + * @DMA_SLAVE_BUSWIDTH_2_BYTES: 2 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_3_BYTES: 3 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_4_BYTES: 4 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_8_BYTES: 8 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_16_BYTES: 16 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_32_BYTES: 32 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_64_BYTES: 64 bytes wide bus
> + * @DMA_SLAVE_BUSWIDTH_128_BYTES: 128 bytes wide bus
> + */
> +enum dma_slave_buswidth {
> + DMA_SLAVE_BUSWIDTH_UNDEFINED = 0,
> + DMA_SLAVE_BUSWIDTH_1_BYTE = 1,
> + DMA_SLAVE_BUSWIDTH_2_BYTES = 2,
> + DMA_SLAVE_BUSWIDTH_3_BYTES = 3,
> + DMA_SLAVE_BUSWIDTH_4_BYTES = 4,
> + DMA_SLAVE_BUSWIDTH_8_BYTES = 8,
> + DMA_SLAVE_BUSWIDTH_16_BYTES = 16,
> + DMA_SLAVE_BUSWIDTH_32_BYTES = 32,
> + DMA_SLAVE_BUSWIDTH_64_BYTES = 64,
> + DMA_SLAVE_BUSWIDTH_128_BYTES = 128,
> +};
> +
> +#endif /* LINUX_DMA_ENGINE_TYPES_H */
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index fe33a20abc61..573e5ea34707 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -12,6 +12,9 @@
> #include <linux/scatterlist.h>
> #include <linux/bitmap.h>
> #include <linux/types.h>
> +
> +#include <linux/dma/engine/types.h>
> +
> #include <asm/page.h>
>
> /**
> @@ -384,23 +387,6 @@ struct dma_chan_dev {
> bool chan_dma_dev;
> };
>
> -/**
> - * enum dma_slave_buswidth - defines bus width of the DMA slave
> - * device, source or target buses
> - */
> -enum dma_slave_buswidth {
> - DMA_SLAVE_BUSWIDTH_UNDEFINED = 0,
> - DMA_SLAVE_BUSWIDTH_1_BYTE = 1,
> - DMA_SLAVE_BUSWIDTH_2_BYTES = 2,
> - DMA_SLAVE_BUSWIDTH_3_BYTES = 3,
> - DMA_SLAVE_BUSWIDTH_4_BYTES = 4,
> - DMA_SLAVE_BUSWIDTH_8_BYTES = 8,
> - DMA_SLAVE_BUSWIDTH_16_BYTES = 16,
> - DMA_SLAVE_BUSWIDTH_32_BYTES = 32,
> - DMA_SLAVE_BUSWIDTH_64_BYTES = 64,
> - DMA_SLAVE_BUSWIDTH_128_BYTES = 128,
> -};
> -
> /**
> * struct dma_slave_config - dma slave channel runtime config
> * @direction: whether the data shall go in or out on this slave
>
> --
> 2.55.0
>