* [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support
@ 2013-05-03 11:16 Alexander Shiyan
2013-05-03 11:16 ` [PATCH 2/2] ARM: dts: Add DMA support to imx27 device tree Alexander Shiyan
2013-05-03 11:32 ` [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Sascha Hauer
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-05-03 11:16 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds device tree probe support for imx-dma driver.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
.../devicetree/bindings/dma/fsl-imx-dma.txt | 18 ++++++++++++++++++
drivers/dma/imx-dma.c | 21 +++++++++++++++++++--
2 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-dma.txt
diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-dma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-dma.txt
new file mode 100644
index 0000000..9409682
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/fsl-imx-dma.txt
@@ -0,0 +1,18 @@
+* Freescale Direct Memory Access (DMA) Controller for i.MX
+
+Required properties:
+- compatible: Should be "fsl,<chip>-dma"
+- reg: Should contain DMA registers location and length
+- interrupts: Should contain DMA interrupt
+- clocks: Pointer to the reference clocks
+- clock-names: Names of DMA reference clocks
+
+Examples:
+
+dma: dma at 10001000 {
+ compatible = "fsl,imx27-dma";
+ reg = <0x10001000 0x1000>;
+ interrupts = <32>;
+ clocks = <&clks 50>, <&clks 70>;
+ clock-names = "ipg", "ahb";
+};
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index f285833..ce8c2a0 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -27,6 +27,8 @@
#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <asm/irq.h>
#include <linux/platform_data/dma-imx.h>
@@ -202,6 +204,14 @@ static struct platform_device_id imx_dma_devtype[] = {
};
MODULE_DEVICE_TABLE(platform, imx_dma_devtype);
+static const struct of_device_id imx_dma_dt_ids[] = {
+ { .compatible = "fsl,imx1-dma", .data = &imx_dma_devtype[IMX1_DMA], },
+ { .compatible = "fsl,imx21-dma", .data = &imx_dma_devtype[IMX21_DMA], },
+ { .compatible = "fsl,imx27-dma", .data = &imx_dma_devtype[IMX27_DMA], },
+ { }
+};
+MODULE_DEVICE_TABLE(of, imx_dma_dt_ids);
+
static inline int is_imx1_dma(struct imxdma_engine *imxdma)
{
return imxdma->devtype == IMX1_DMA;
@@ -997,7 +1007,9 @@ static void imxdma_issue_pending(struct dma_chan *chan)
}
static int __init imxdma_probe(struct platform_device *pdev)
- {
+{
+ const struct of_device_id *of_id =
+ of_match_device(imx_dma_dt_ids, &pdev->dev);
struct imxdma_engine *imxdma;
struct resource *res;
int ret, i;
@@ -1007,6 +1019,8 @@ static int __init imxdma_probe(struct platform_device *pdev)
if (!imxdma)
return -ENOMEM;
+ if (of_id)
+ pdev->id_entry = of_id->data;
imxdma->devtype = pdev->id_entry->driver_data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1136,6 +1150,8 @@ static int __init imxdma_probe(struct platform_device *pdev)
goto err;
}
+ dev_info(imxdma->dev, "initialized\n");
+
return 0;
err:
@@ -1158,7 +1174,8 @@ static int imxdma_remove(struct platform_device *pdev)
static struct platform_driver imxdma_driver = {
.driver = {
- .name = "imx-dma",
+ .name = "imx-dma",
+ .of_match_table = imx_dma_dt_ids,
},
.id_table = imx_dma_devtype,
.remove = imxdma_remove,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: dts: Add DMA support to imx27 device tree
2013-05-03 11:16 [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Alexander Shiyan
@ 2013-05-03 11:16 ` Alexander Shiyan
2013-05-03 11:32 ` [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Sascha Hauer
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-05-03 11:16 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
arch/arm/boot/dts/imx27.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index cd85828..943e8f3 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -61,6 +61,14 @@
reg = <0x10000000 0x20000>;
ranges;
+ dma: dma at 10001000 {
+ compatible = "fsl,imx27-dma";
+ reg = <0x10001000 0x1000>;
+ interrupts = <32>;
+ clocks = <&clks 50>, <&clks 70>;
+ clock-names = "ipg", "ahb";
+ };
+
wdog: wdog at 10002000 {
compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
reg = <0x10002000 0x1000>;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support
2013-05-03 11:16 [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Alexander Shiyan
2013-05-03 11:16 ` [PATCH 2/2] ARM: dts: Add DMA support to imx27 device tree Alexander Shiyan
@ 2013-05-03 11:32 ` Sascha Hauer
2013-05-03 11:37 ` Re[2]: " Alexander Shiyan
1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2013-05-03 11:32 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 03, 2013 at 03:16:08PM +0400, Alexander Shiyan wrote:
> This patch adds device tree probe support for imx-dma driver.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
There's already v6 of a series adding devicetree support for imx-dma
available:
See http://comments.gmane.org/gmane.linux.drivers.devicetree/34800
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re[2]: [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support
2013-05-03 11:32 ` [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Sascha Hauer
@ 2013-05-03 11:37 ` Alexander Shiyan
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-05-03 11:37 UTC (permalink / raw)
To: linux-arm-kernel
> On Fri, May 03, 2013 at 03:16:08PM +0400, Alexander Shiyan wrote:
> > This patch adds device tree probe support for imx-dma driver.
> >
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>
> There's already v6 of a series adding devicetree support for imx-dma
> available:
>
> See http://comments.gmane.org/gmane.linux.drivers.devicetree/34800
Ah, OK. Then just throw these patches.
---
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-03 11:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-03 11:16 [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Alexander Shiyan
2013-05-03 11:16 ` [PATCH 2/2] ARM: dts: Add DMA support to imx27 device tree Alexander Shiyan
2013-05-03 11:32 ` [PATCH 1/2] dmaengine: imx-dma: Add device tree probe support Sascha Hauer
2013-05-03 11:37 ` Re[2]: " Alexander Shiyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).