[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260128-dma_ll_comlib-v1-2-1b1fa2c671f9@nxp.com>
Date: Wed, 28 Jan 2026 13:05:21 -0500
From: Frank Li <Frank.Li@....com>
To: Vinod Koul <vkoul@...nel.org>
Cc: linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org,
imx@...ts.linux.dev, joy.zou@....com, Frank Li <Frank.Li@....com>
Subject: [PATCH RFC 02/12] dmaengine: Add common dma_ll_desc and
dma_linklist_item for link-list controllers
Introduce common dma_ll_desc and dma_linklist_item structures for
link-list–based DMA controllers. This lays the groundwork for adding more
shared APIs to a common DMA link-list library and reduces duplication
across drivers.
Signed-off-by: Frank Li <Frank.Li@....com>
---
drivers/dma/virt-dma.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h
index 081eb910d0b0cd2b60232736587c698fff787cb9..82f3f8244f6eca036a027c9a4c9339fcb87e8d2c 100644
--- a/drivers/dma/virt-dma.h
+++ b/drivers/dma/virt-dma.h
@@ -19,11 +19,32 @@ struct virt_dma_desc {
struct list_head node;
};
+struct dma_linklist_item {
+ dma_addr_t paddr;
+ void *vaddr;
+};
+
+/*
+ * Must put to last one if need extend it
+ * struct vendor_dma_ll_desc {
+ * ...
+ * struct dma_ll_desc ldesc;
+ * }
+ */
+struct dma_ll_desc {
+ struct virt_dma_desc vdesc;
+ bool iscyclic;
+ enum dma_transfer_direction dir;
+ u32 n_its;
+ struct dma_linklist_item its[];
+};
+
struct dma_linklist_ops {
int (*stop)(struct dma_chan *chan);
};
struct dma_linklist {
+ struct dma_pool *pool;
const struct dma_linklist_ops *ops;
};
@@ -247,6 +268,11 @@ static inline void vchan_synchronize(struct virt_dma_chan *vc)
}
#if IS_ENABLED(CONFIG_DMA_LINKLIST)
+static inline struct dma_ll_desc *to_dma_ll_desc(struct virt_dma_desc *vdesc)
+{
+ return container_of(vdesc, struct dma_ll_desc, vdesc);
+}
+
int vchan_dma_ll_init(struct virt_dma_chan *vc,
const struct dma_linklist_ops *ops, size_t size,
size_t align, size_t boundary);
--
2.34.1
Powered by blists - more mailing lists