Skip to content

Commit

Permalink
dma: xilinx: Fix dma_get_slave_caps gaps
Browse files Browse the repository at this point in the history
When client driver uses dma_get_slave_caps
It checks for certain fileds of dma_device struct
currently driver is not settings few fields resulting
dma_get_slave_caps() returns NULL.

This patch fixes this issue by populating proper values
to the struct dma_device fields.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
kedareswararao authored and Michal Simek committed Jul 3, 2017
1 parent 8bc5037 commit 54c8b75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/dma/xilinx/xilinx_dma.c
Expand Up @@ -2413,6 +2413,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
chan->direction = DMA_MEM_TO_DEV;
chan->id = chan_id;
chan->tdest = chan_id;
xdev->common.directions = BIT(DMA_MEM_TO_DEV);

chan->ctrl_offset = XILINX_DMA_MM2S_CTRL_OFFSET;
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
Expand All @@ -2429,6 +2430,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
chan->direction = DMA_DEV_TO_MEM;
chan->id = chan_id;
chan->tdest = chan_id - xdev->nr_channels;
xdev->common.directions |= BIT(DMA_DEV_TO_MEM);

chan->ctrl_offset = XILINX_DMA_S2MM_CTRL_OFFSET;
if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
Expand Down Expand Up @@ -2637,6 +2639,8 @@ static int xilinx_dma_probe(struct platform_device *pdev)
dma_cap_set(DMA_PRIVATE, xdev->common.cap_mask);
}

xdev->common.dst_addr_widths = BIT(addr_width / 8);
xdev->common.src_addr_widths = BIT(addr_width / 8);
xdev->common.device_alloc_chan_resources =
xilinx_dma_alloc_chan_resources;
xdev->common.device_free_chan_resources =
Expand Down

0 comments on commit 54c8b75

Please sign in to comment.