1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates.
4 * Synopsys DesignWare eDMA core driver
6 * Author: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
9 #ifndef _DW_EDMA_CORE_H
10 #define _DW_EDMA_CORE_H
12 #include <linux/msi.h>
13 #include <linux/dma/edma.h>
15 #include "../virt-dma.h"
24 enum dw_edma_request {
36 enum dw_edma_xfer_type {
37 EDMA_XFER_SCATTER_GATHER = 0,
45 struct dw_edma_burst {
46 struct list_head list;
52 struct dw_edma_chunk {
53 struct list_head list;
54 struct dw_edma_chan *chan;
55 struct dw_edma_burst *burst;
60 struct dw_edma_region ll_region; /* Linked list */
64 struct virt_dma_desc vd;
65 struct dw_edma_chan *chan;
66 struct dw_edma_chunk *chunk;
75 struct virt_dma_chan vc;
84 enum dw_edma_request request;
85 enum dw_edma_status status;
88 struct dma_slave_config config;
101 struct dma_device dma;
106 struct dw_edma_irq *irq;
109 struct dw_edma_chan *chan;
111 raw_spinlock_t lock; /* Only for legacy */
113 struct dw_edma_chip *chip;
117 struct scatterlist *sgl;
121 struct dw_edma_cyclic {
127 struct dw_edma_transfer {
128 struct dma_chan *dchan;
130 struct dw_edma_sg sg;
131 struct dw_edma_cyclic cyclic;
132 struct dma_interleaved_template *il;
134 enum dma_transfer_direction direction;
136 enum dw_edma_xfer_type type;
140 struct dw_edma_chan *vc2dw_edma_chan(struct virt_dma_chan *vc)
142 return container_of(vc, struct dw_edma_chan, vc);
146 struct dw_edma_chan *dchan2dw_edma_chan(struct dma_chan *dchan)
148 return vc2dw_edma_chan(to_virt_chan(dchan));
151 #endif /* _DW_EDMA_CORE_H */