]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
dma: xilinx: Fix dma_get_slave_caps gaps
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Mon, 3 Jul 2017 05:26:07 +0000 (10:56 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 3 Jul 2017 11:10:31 +0000 (13:10 +0200)
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>
drivers/dma/xilinx/xilinx_dma.c

index dce57f03b7e24dc69ede029cda07635284935085..b92d40dfbe2d6bb011f798c064ca2395da1abc57 100644 (file)
@@ -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) {
@@ -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) {
@@ -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 =