diff options
author | Vinod Koul <vinod.koul@intel.com> | 2013-09-02 12:10:40 (GMT) |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-09-02 12:10:40 (GMT) |
commit | 355cdafe14d72c616dc804a756f3af4f4df4fe8c (patch) | |
tree | 592ef60b65da9a539daa84f5d1cf52cf483b362b /drivers/dma | |
parent | 4770ee44359ad454992d544cf14f8d330a93f5ca (diff) | |
parent | ca38ff133eb85b64e62b508a7726ea0247edd359 (diff) | |
download | linux-355cdafe14d72c616dc804a756f3af4f4df4fe8c.tar.xz |
Merge branch 'topic/api_caps' into for-linus
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/pl330.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index cfd2d70..36ed301 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2870,6 +2870,32 @@ static irqreturn_t pl330_irq_handler(int irq, void *data) return IRQ_NONE; } +#define PL330_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 pl330_dma_device_slave_caps(struct dma_chan *dchan, + struct dma_slave_caps *caps) +{ + caps->src_addr_widths = PL330_DMA_BUSWIDTHS; + caps->dstn_addr_widths = PL330_DMA_BUSWIDTHS; + caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); + caps->cmd_pause = false; + caps->cmd_terminate = true; + + /* + * This is the limit for transfers with a buswidth of 1, larger + * buswidths will have larger limits. + */ + caps->max_sg_len = 1900800; + caps->max_sg_nr = 0; + + return 0; +} + static int pl330_probe(struct amba_device *adev, const struct amba_id *id) { @@ -2975,6 +3001,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) pd->device_prep_slave_sg = pl330_prep_slave_sg; pd->device_control = pl330_control; pd->device_issue_pending = pl330_issue_pending; + pd->device_slave_caps = pl330_dma_device_slave_caps; ret = dma_async_device_register(pd); if (ret) { |