diff options
Diffstat (limited to 'arch/arm/common/edma.c')
| -rw-r--r-- | arch/arm/common/edma.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 117f955a2a06..8e1a0245907f 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
| @@ -269,6 +269,11 @@ static const struct edmacc_param dummy_paramset = { | |||
| 269 | .ccnt = 1, | 269 | .ccnt = 1, |
| 270 | }; | 270 | }; |
| 271 | 271 | ||
| 272 | static const struct of_device_id edma_of_ids[] = { | ||
| 273 | { .compatible = "ti,edma3", }, | ||
| 274 | {} | ||
| 275 | }; | ||
| 276 | |||
| 272 | /*****************************************************************************/ | 277 | /*****************************************************************************/ |
| 273 | 278 | ||
| 274 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, | 279 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, |
| @@ -560,14 +565,38 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, | |||
| 560 | static int prepare_unused_channel_list(struct device *dev, void *data) | 565 | static int prepare_unused_channel_list(struct device *dev, void *data) |
| 561 | { | 566 | { |
| 562 | struct platform_device *pdev = to_platform_device(dev); | 567 | struct platform_device *pdev = to_platform_device(dev); |
| 563 | int i, ctlr; | 568 | int i, count, ctlr; |
| 569 | struct of_phandle_args dma_spec; | ||
| 564 | 570 | ||
| 571 | if (dev->of_node) { | ||
| 572 | count = of_property_count_strings(dev->of_node, "dma-names"); | ||
| 573 | if (count < 0) | ||
| 574 | return 0; | ||
| 575 | for (i = 0; i < count; i++) { | ||
| 576 | if (of_parse_phandle_with_args(dev->of_node, "dmas", | ||
| 577 | "#dma-cells", i, | ||
| 578 | &dma_spec)) | ||
| 579 | continue; | ||
| 580 | |||
| 581 | if (!of_match_node(edma_of_ids, dma_spec.np)) { | ||
| 582 | of_node_put(dma_spec.np); | ||
| 583 | continue; | ||
| 584 | } | ||
| 585 | |||
| 586 | clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]), | ||
| 587 | edma_cc[0]->edma_unused); | ||
| 588 | of_node_put(dma_spec.np); | ||
| 589 | } | ||
| 590 | return 0; | ||
| 591 | } | ||
| 592 | |||
| 593 | /* For non-OF case */ | ||
| 565 | for (i = 0; i < pdev->num_resources; i++) { | 594 | for (i = 0; i < pdev->num_resources; i++) { |
| 566 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && | 595 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && |
| 567 | (int)pdev->resource[i].start >= 0) { | 596 | (int)pdev->resource[i].start >= 0) { |
| 568 | ctlr = EDMA_CTLR(pdev->resource[i].start); | 597 | ctlr = EDMA_CTLR(pdev->resource[i].start); |
| 569 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), | 598 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), |
| 570 | edma_cc[ctlr]->edma_unused); | 599 | edma_cc[ctlr]->edma_unused); |
| 571 | } | 600 | } |
| 572 | } | 601 | } |
| 573 | 602 | ||
| @@ -1762,11 +1791,6 @@ static int edma_probe(struct platform_device *pdev) | |||
| 1762 | return 0; | 1791 | return 0; |
| 1763 | } | 1792 | } |
| 1764 | 1793 | ||
| 1765 | static const struct of_device_id edma_of_ids[] = { | ||
| 1766 | { .compatible = "ti,edma3", }, | ||
| 1767 | {} | ||
| 1768 | }; | ||
| 1769 | |||
| 1770 | static struct platform_driver edma_driver = { | 1794 | static struct platform_driver edma_driver = { |
| 1771 | .driver = { | 1795 | .driver = { |
| 1772 | .name = "edma", | 1796 | .name = "edma", |
