Commit 04c2bc2b authored by Radhey Shyam Pandey's avatar Radhey Shyam Pandey Committed by Vinod Koul

dmaengine: xilinx_dma: Extend dma_config structure to store max channel count

Extend dma_config structure to store the max channel count. This input is
used to populate dma device channel nodes at the fixed offset. It serves
as a preparatory patch for removing dma channel DT node order dependency,
added in the subsequent commit.
Signed-off-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/1580388865-9960-2-git-send-email-radhey.shyam.pandey@xilinx.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d80cbef3
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
#define XILINX_VDMA_ENABLE_VERTICAL_FLIP BIT(0) #define XILINX_VDMA_ENABLE_VERTICAL_FLIP BIT(0)
/* HW specific definitions */ /* HW specific definitions */
#define XILINX_DMA_MAX_CHANS_PER_DEVICE 0x20 #define XILINX_MCDMA_MAX_CHANS_PER_DEVICE 0x20
#define XILINX_DMA_MAX_CHANS_PER_DEVICE 0x2
#define XILINX_CDMA_MAX_CHANS_PER_DEVICE 0x1
#define XILINX_DMA_DMAXR_ALL_IRQ_MASK \ #define XILINX_DMA_DMAXR_ALL_IRQ_MASK \
(XILINX_DMA_DMASR_FRM_CNT_IRQ | \ (XILINX_DMA_DMASR_FRM_CNT_IRQ | \
...@@ -468,6 +470,7 @@ struct xilinx_dma_config { ...@@ -468,6 +470,7 @@ struct xilinx_dma_config {
struct clk **tx_clk, struct clk **txs_clk, struct clk **tx_clk, struct clk **txs_clk,
struct clk **rx_clk, struct clk **rxs_clk); struct clk **rx_clk, struct clk **rxs_clk);
irqreturn_t (*irq_handler)(int irq, void *data); irqreturn_t (*irq_handler)(int irq, void *data);
const int max_channels;
}; };
/** /**
...@@ -2939,23 +2942,27 @@ static const struct xilinx_dma_config axidma_config = { ...@@ -2939,23 +2942,27 @@ static const struct xilinx_dma_config axidma_config = {
.dmatype = XDMA_TYPE_AXIDMA, .dmatype = XDMA_TYPE_AXIDMA,
.clk_init = axidma_clk_init, .clk_init = axidma_clk_init,
.irq_handler = xilinx_dma_irq_handler, .irq_handler = xilinx_dma_irq_handler,
.max_channels = XILINX_DMA_MAX_CHANS_PER_DEVICE,
}; };
static const struct xilinx_dma_config aximcdma_config = { static const struct xilinx_dma_config aximcdma_config = {
.dmatype = XDMA_TYPE_AXIMCDMA, .dmatype = XDMA_TYPE_AXIMCDMA,
.clk_init = axidma_clk_init, .clk_init = axidma_clk_init,
.irq_handler = xilinx_mcdma_irq_handler, .irq_handler = xilinx_mcdma_irq_handler,
.max_channels = XILINX_MCDMA_MAX_CHANS_PER_DEVICE,
}; };
static const struct xilinx_dma_config axicdma_config = { static const struct xilinx_dma_config axicdma_config = {
.dmatype = XDMA_TYPE_CDMA, .dmatype = XDMA_TYPE_CDMA,
.clk_init = axicdma_clk_init, .clk_init = axicdma_clk_init,
.irq_handler = xilinx_dma_irq_handler, .irq_handler = xilinx_dma_irq_handler,
.max_channels = XILINX_CDMA_MAX_CHANS_PER_DEVICE,
}; };
static const struct xilinx_dma_config axivdma_config = { static const struct xilinx_dma_config axivdma_config = {
.dmatype = XDMA_TYPE_VDMA, .dmatype = XDMA_TYPE_VDMA,
.clk_init = axivdma_clk_init, .clk_init = axivdma_clk_init,
.irq_handler = xilinx_dma_irq_handler, .irq_handler = xilinx_dma_irq_handler,
.max_channels = XILINX_DMA_MAX_CHANS_PER_DEVICE,
}; };
static const struct of_device_id xilinx_dma_of_ids[] = { static const struct of_device_id xilinx_dma_of_ids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment