Commit 2c88ee6b authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Vinod Koul

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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: default avatarJoel Fernandes <joelf@ti.com>
Reviewed-and-Tested-by: default avatarJoel Fernandes <joelf@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 83bb3126
...@@ -853,6 +853,23 @@ static void __init edma_chan_init(struct edma_cc *ecc, ...@@ -853,6 +853,23 @@ static void __init edma_chan_init(struct edma_cc *ecc,
} }
} }
#define EDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
static int edma_dma_device_slave_caps(struct dma_chan *dchan,
struct dma_slave_caps *caps)
{
caps->src_addr_widths = EDMA_DMA_BUSWIDTHS;
caps->dstn_addr_widths = EDMA_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_DESCRIPTOR;
return 0;
}
static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma,
struct device *dev) struct device *dev)
{ {
...@@ -863,6 +880,7 @@ static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, ...@@ -863,6 +880,7 @@ static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma,
dma->device_issue_pending = edma_issue_pending; dma->device_issue_pending = edma_issue_pending;
dma->device_tx_status = edma_tx_status; dma->device_tx_status = edma_tx_status;
dma->device_control = edma_control; dma->device_control = edma_control;
dma->device_slave_caps = edma_dma_device_slave_caps;
dma->dev = dev; dma->dev = dev;
INIT_LIST_HEAD(&dma->channels); INIT_LIST_HEAD(&dma->channels);
......
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