dmaengine: at_xdmac: Declare slave capabilities for the generic code
authorLudovic Desroches <ludovic.desroches@atmel.com>
Mon, 17 Nov 2014 13:42:44 +0000 (14:42 +0100)
committerVinod Koul <vinod.koul@intel.com>
Mon, 22 Dec 2014 07:03:23 +0000 (12:33 +0530)
Now that the generic slave caps code can make use of the device assigned
capabilities, instead of relying on a callback to be implemented.

Make use of this code.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/at_xdmac.c

index c7f335088d1ead0283cc986991dfe260f71fdfd8..8c799f66a6dcc803e1a0f4e9faaedc9db18c5092 100644 (file)
 
 #define AT_XDMAC_MAX_CHAN      0x20
 
+#define AT_XDMAC_DMA_BUSWIDTHS\
+       (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\
+       BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |\
+       BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |\
+       BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |\
+       BIT(DMA_SLAVE_BUSWIDTH_8_BYTES))
+
 enum atc_status {
        AT_XDMAC_CHAN_IS_CYCLIC = 0,
        AT_XDMAC_CHAN_IS_PAUSED,
@@ -1234,27 +1241,6 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
        return;
 }
 
-#define AT_XDMAC_DMA_BUSWIDTHS\
-       (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\
-       BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |\
-       BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |\
-       BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) |\
-       BIT(DMA_SLAVE_BUSWIDTH_8_BYTES))
-
-static int at_xdmac_device_slave_caps(struct dma_chan *dchan,
-                                     struct dma_slave_caps *caps)
-{
-
-       caps->src_addr_widths = AT_XDMAC_DMA_BUSWIDTHS;
-       caps->dst_addr_widths = AT_XDMAC_DMA_BUSWIDTHS;
-       caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
-       caps->cmd_pause = true;
-       caps->cmd_terminate = true;
-       caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
-
-       return 0;
-}
-
 #ifdef CONFIG_PM
 static int atmel_xdmac_prepare(struct device *dev)
 {
@@ -1428,7 +1414,10 @@ static int at_xdmac_probe(struct platform_device *pdev)
        atxdmac->dma.device_pause                       = at_xdmac_device_pause;
        atxdmac->dma.device_resume                      = at_xdmac_device_resume;
        atxdmac->dma.device_terminate_all               = at_xdmac_device_terminate_all;
-       atxdmac->dma.device_slave_caps                  = at_xdmac_device_slave_caps;
+       atxdmac->dma.src_addr_widths = AT_XDMAC_DMA_BUSWIDTHS;
+       atxdmac->dma.dst_addr_widths = AT_XDMAC_DMA_BUSWIDTHS;
+       atxdmac->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
+       atxdmac->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
        /* Disable all chans and interrupts. */
        at_xdmac_off(atxdmac);