diff options
| author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-03-29 09:33:30 -0400 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@intel.com> | 2014-03-29 09:33:30 -0400 |
| commit | 80b0e0abfbcf9897ee263a79bc4cbdcfeca72431 (patch) | |
| tree | 98d9a33911b0ae054b52848da9c065cd08d16a52 | |
| parent | 4501fe61b286e35be5b372a4f1ffcf5881ceeaed (diff) | |
dma: omap-dma: 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: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| -rw-r--r-- | drivers/dma/omap-dma.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 362e7c49f2e1..928a0fa39f89 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
| @@ -597,6 +597,23 @@ static void omap_dma_free(struct omap_dmadev *od) | |||
| 597 | kfree(od); | 597 | kfree(od); |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | #define OMAP_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ | ||
| 601 | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ | ||
| 602 | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES)) | ||
| 603 | |||
| 604 | static int omap_dma_device_slave_caps(struct dma_chan *dchan, | ||
| 605 | struct dma_slave_caps *caps) | ||
| 606 | { | ||
| 607 | caps->src_addr_widths = OMAP_DMA_BUSWIDTHS; | ||
| 608 | caps->dstn_addr_widths = OMAP_DMA_BUSWIDTHS; | ||
| 609 | caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | ||
| 610 | caps->cmd_pause = true; | ||
| 611 | caps->cmd_terminate = true; | ||
| 612 | caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; | ||
| 613 | |||
| 614 | return 0; | ||
| 615 | } | ||
| 616 | |||
| 600 | static int omap_dma_probe(struct platform_device *pdev) | 617 | static int omap_dma_probe(struct platform_device *pdev) |
| 601 | { | 618 | { |
| 602 | struct omap_dmadev *od; | 619 | struct omap_dmadev *od; |
| @@ -615,6 +632,7 @@ static int omap_dma_probe(struct platform_device *pdev) | |||
| 615 | od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg; | 632 | od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg; |
| 616 | od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic; | 633 | od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic; |
| 617 | od->ddev.device_control = omap_dma_control; | 634 | od->ddev.device_control = omap_dma_control; |
| 635 | od->ddev.device_slave_caps = omap_dma_device_slave_caps; | ||
| 618 | od->ddev.dev = &pdev->dev; | 636 | od->ddev.dev = &pdev->dev; |
| 619 | INIT_LIST_HEAD(&od->ddev.channels); | 637 | INIT_LIST_HEAD(&od->ddev.channels); |
| 620 | INIT_LIST_HEAD(&od->pending); | 638 | INIT_LIST_HEAD(&od->pending); |
