diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-14 07:42:01 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-04-22 12:05:54 -0400 |
commit | 2c88ee6b6b9a715f2caba87b7c993ca485f68c0d (patch) | |
tree | 5d70829e8112342e85ea0fded29d7f98c0df0311 /drivers/dma | |
parent | 83bb3126cc63620fe23c2a0539800ab7f8cf7ba4 (diff) |
dmaengine: edma: Implement device_slave_caps callback
With the callback implemented omap-dma can provide information to client
drivers regarding to supported address widths, directions, residue
granularity, etc.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Joel Fernandes <joelf@ti.com>
Reviewed-and-Tested-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/edma.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 5c24b6024278..ce230f8f6d98 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
@@ -853,6 +853,23 @@ static void __init edma_chan_init(struct edma_cc *ecc, | |||
853 | } | 853 | } |
854 | } | 854 | } |
855 | 855 | ||
856 | #define EDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ | ||
857 | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ | ||
858 | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES)) | ||
859 | |||
860 | static int edma_dma_device_slave_caps(struct dma_chan *dchan, | ||
861 | struct dma_slave_caps *caps) | ||
862 | { | ||
863 | caps->src_addr_widths = EDMA_DMA_BUSWIDTHS; | ||
864 | caps->dstn_addr_widths = EDMA_DMA_BUSWIDTHS; | ||
865 | caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | ||
866 | caps->cmd_pause = true; | ||
867 | caps->cmd_terminate = true; | ||
868 | caps->residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; | ||
869 | |||
870 | return 0; | ||
871 | } | ||
872 | |||
856 | static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, | 873 | static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, |
857 | struct device *dev) | 874 | struct device *dev) |
858 | { | 875 | { |
@@ -863,6 +880,7 @@ static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, | |||
863 | dma->device_issue_pending = edma_issue_pending; | 880 | dma->device_issue_pending = edma_issue_pending; |
864 | dma->device_tx_status = edma_tx_status; | 881 | dma->device_tx_status = edma_tx_status; |
865 | dma->device_control = edma_control; | 882 | dma->device_control = edma_control; |
883 | dma->device_slave_caps = edma_dma_device_slave_caps; | ||
866 | dma->dev = dev; | 884 | dma->dev = dev; |
867 | 885 | ||
868 | INIT_LIST_HEAD(&dma->channels); | 886 | INIT_LIST_HEAD(&dma->channels); |