]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dmaengine: dw_dma: add Device Tree probing capability
authorViresh Kumar <viresh.linux@gmail.com>
Fri, 20 Apr 2012 14:45:34 +0000 (20:15 +0530)
committerVinod Koul <vinod.koul@linux.intel.com>
Fri, 11 May 2012 05:13:40 +0000 (10:43 +0530)
SPEAr platforms now support DT and so must convert all drivers to support DT.
This patch adds DT probing support for Synopsys DMA controller and updates its
documentation too.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Documentation/devicetree/bindings/dma/snps-dma.txt [new file with mode: 0644]
drivers/dma/dw_dmac.c

diff --git a/Documentation/devicetree/bindings/dma/snps-dma.txt b/Documentation/devicetree/bindings/dma/snps-dma.txt
new file mode 100644 (file)
index 0000000..c0d85db
--- /dev/null
@@ -0,0 +1,17 @@
+* Synopsys Designware DMA Controller
+
+Required properties:
+- compatible: "snps,dma-spear1340"
+- reg: Address range of the DMAC registers
+- interrupt-parent: Should be the phandle for the interrupt controller
+  that services interrupts for this device
+- interrupt: Should contain the DMAC interrupt number
+
+Example:
+
+       dma@fc000000 {
+               compatible = "snps,dma-spear1340";
+               reg = <0xfc000000 0x1000>;
+               interrupt-parent = <&vic1>;
+               interrupts = <12>;
+       };
index 300d976b66617e1ac02f0de059a8b0c5a736c554..13b92983b241e4921af97d2ab3706ac23a473729 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/of.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
@@ -1592,12 +1593,21 @@ static const struct dev_pm_ops dw_dev_pm_ops = {
        .poweroff_noirq = dw_suspend_noirq,
 };
 
+#ifdef CONFIG_OF
+static const struct of_device_id dw_dma_id_table[] = {
+       { .compatible = "snps,dma-spear1340" },
+       {}
+};
+MODULE_DEVICE_TABLE(of, dw_dma_id_table);
+#endif
+
 static struct platform_driver dw_driver = {
        .remove         = __exit_p(dw_remove),
        .shutdown       = dw_shutdown,
        .driver = {
                .name   = "dw_dmac",
                .pm     = &dw_dev_pm_ops,
+               .of_match_table = of_match_ptr(dw_dma_id_table),
        },
 };