Skip to contentSkip to conversation

ARM: kirkwood: extend the kirkwood pcm/dma driver for DT usage

PATCH In review Jean-Francois Moine 3 participants 4 messages Jul 23, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: kirkwood: extend the kirkwood pcm/dma driver for DT usage

The kirkwood pcm/dma driver is used without DT in the Kirkwood machine. This patch adds a DT compatible definition for use in other Marvell machines as the Armada 88AP510 (Dove).

---
 Documentation/devicetree/bindings/sound/kirkwood-dma.txt | 11 +++++++++++
 sound/soc/kirkwood/kirkwood-dma.c                        | 11 +++++++++++
 2 files changed, 22 insertions(+)
Documentation/devicetree/bindings/sound/kirkwood-dma.txt new file +11 -0
new file mode 100644
index 0000000..9dd2989
@@ -0,0 +1,11 @@
+* mvebu (Kirkwood, Dove, Armada 370) PCM/DMA controller
+
+Required properties:
+
+- compatible: "marvell,mvebu-pcm-audio"
+
+Example:
+
+pcm: pcm {
+	compatible = "marvell,mvebu-pcm-audio";
+};
sound/soc/kirkwood/kirkwood-dma.c +11 -0
index a9f1453..b91045a 100644
@@ -19,6 +19,8 @@
 #include <linux/dma-mapping.h>
 #include <linux/mbus.h>
 #include <sound/soc.h>
+#include <linux/of.h>
+
 #include "kirkwood.h"
 
 #define KIRKWOOD_RATES \
@@ -383,10 +385,19 @@ static int kirkwood_soc_platform_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id kirkwood_pcm_of_match[] = {
+	{ .compatible = "marvell,mvebu-pcm-audio" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, kirkwood_pcm_of_match);
+#endif
+
 static struct platform_driver kirkwood_pcm_driver = {
 	.driver = {
 			.name = "kirkwood-pcm-audio",
 			.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(kirkwood_pcm_of_match),
 	},
 
 	.probe = kirkwood_soc_platform_probe,
Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
maintainer
#1 lore raw

Documentation/devicetree/bindings/sound/kirkwood-dma.txt line 11

Quoted 7 lines · Jean-Francois Moine

+- compatible: "marvell,mvebu-pcm-audio"

Documentation/devicetree/bindings/sound/kirkwood-dma.txt new file +6 -0
+
+Example:
+
+pcm: pcm {
+	compatible = "marvell,mvebu-pcm-audio";
+};

This device has no registers or other hardware - this looks like a stub device which shouldn't be visible in DT but should instead be created by the I2S driver - look at how most of the other DT platforms using dmaengine work.

#2 lore raw
Quoted 14 lines · Mark Brown

Documentation/devicetree/bindings/sound/kirkwood-dma.txt line 11

Quoted 7 lines · Jean-Francois Moine

+- compatible: "marvell,mvebu-pcm-audio"

Documentation/devicetree/bindings/sound/kirkwood-dma.txt new file +6 -0
+
+Example:
+
+pcm: pcm {
+	compatible = "marvell,mvebu-pcm-audio";
+};

This device has no registers or other hardware - this looks like a stub device which shouldn't be visible in DT but should instead be created by the I2S driver - look at how most of the other DT platforms using dmaengine work.

There is no separate DMA engine on this platform. dmaengine is totally irrelevant to this hardware.

maintainer
#3 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 4 lines · Mark Brown

This device has no registers or other hardware - this looks like a stub device which shouldn't be visible in DT but should instead be created by the I2S driver - look at how most of the other DT platforms using dmaengine work.

There is no separate DMA engine on this platform. dmaengine is totally irrelevant to this hardware.

The pattern for instantiating a DMA controller that's integrated into the DAI is the same as that where the DMA controller is a shared IP accessed via dmaengine so it's still useful to look at these platforms to see how to do the instnatiation.