[PATCH 02/10] dmaengine: bcm2835: also support generic dma-channel-mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since commit e2d896c08ca3 ("Documentation: bindings: dma: Add
binding for dma-channel-mask") there is a generic property to list
available DMA channels for the kernel to use. The generic property
has been implemented by some other platforms.
So implement support for the generic one and consider the
vendor specific one as deprecated. This also simplifies the YAML
conversion of the BCM2835 DMA DT bindings a little bit.

Cc: John Stultz <john.stultz@xxxxxxxxxx>
Signed-off-by: Stefan Wahren <stefan.wahren@xxxxxxxx>
---
 drivers/dma/bcm2835-dma.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 0807fb9eb262..a0573977a373 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -941,12 +941,18 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
 	}
 
 	/* Request DMA channel mask from device tree */
-	if (of_property_read_u32(pdev->dev.of_node,
-			"brcm,dma-channel-mask",
-			&chans_available)) {
-		dev_err(&pdev->dev, "Failed to get channel mask\n");
-		rc = -EINVAL;
-		goto err_no_dma;
+	if (of_property_read_u32(pdev->dev.of_node, "dma-channel-mask",
+				 &chans_available)) {
+		if (of_property_read_u32(pdev->dev.of_node,
+					 "brcm,dma-channel-mask",
+					 &chans_available)) {
+			dev_err(&pdev->dev, "Failed to get channel mask\n");
+			rc = -EINVAL;
+			goto err_no_dma;
+		} else {
+			dev_warn(&pdev->dev,
+				 "brcm,dma-channel-mask is deprecated, update your device-tree\n");
+		}
 	}
 
 	/* get irqs for each channel that we support */
-- 
2.34.1




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux