diff mbox

[3/5] ASoC: Davinci: pcm: Add device tree bindings

Message ID 1344948125-5649-4-git-send-email-gururaja.hebbar@ti.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Hebbar, Gururaja Aug. 14, 2012, 12:42 p.m. UTC
Device tree support for Davinci/OMAP2+ pcm driver.

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
---
:000000 100644 0000000... be494bb... A	Documentation/devicetree/bindings/sound/davinci-pcm.txt
:100644 100644 fefb3d4... 0765101... M	sound/soc/davinci/davinci-pcm.c
 .../devicetree/bindings/sound/davinci-pcm.txt      |   13 +++++++++++++
 sound/soc/davinci/davinci-pcm.c                    |   11 +++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

Comments

Mark Brown Aug. 17, 2012, 10:31 p.m. UTC | #1
On Tue, Aug 14, 2012 at 06:12:03PM +0530, Hebbar, Gururaja wrote:
> Device tree support for Davinci/OMAP2+ pcm driver.

This looks like it's a device which maps a shared DMA controller in the
SoC core into ASoC rather than actual hardware.  Such devices are
usually instantiated automatically from the DAI rather than being
represented in the device tree since they are a Linux internal thing
really - the Tegra and Freescale drivers provide examples of how this
sort of thing can be done.
Hebbar, Gururaja Aug. 22, 2012, 1:50 p.m. UTC | #2
On Sat, Aug 18, 2012 at 04:01:24, Mark Brown wrote:
> On Tue, Aug 14, 2012 at 06:12:03PM +0530, Hebbar, Gururaja wrote:
> > Device tree support for Davinci/OMAP2+ pcm driver.
> 
> This looks like it's a device which maps a shared DMA controller in the
> SoC core into ASoC rather than actual hardware.  Such devices are
> usually instantiated automatically from the DAI rather than being
> represented in the device tree since they are a Linux internal thing
> really - the Tegra and Freescale drivers provide examples of how this
> sort of thing can be done.

>From your for-3.7 branch, I could only find such implementation in Tegra
Platform. 
Most Freescale platforms implements this through a device/driver method.
Exception being sound/soc/mxs/mxs-pcm.c

So should I follow tegra implementation?
> 


Regards, 
Gururaja
Mark Brown Aug. 22, 2012, 3:58 p.m. UTC | #3
On Wed, Aug 22, 2012 at 01:50:09PM +0000, Hebbar, Gururaja wrote:

> From your for-3.7 branch, I could only find such implementation in Tegra
> Platform. 
> Most Freescale platforms implements this through a device/driver method.
> Exception being sound/soc/mxs/mxs-pcm.c

> So should I follow tegra implementation?

Tegra and mxs should be good examples, yes.
Hebbar, Gururaja Aug. 23, 2012, 5:13 a.m. UTC | #4
On Wed, Aug 22, 2012 at 21:28:08, Mark Brown wrote:
> On Wed, Aug 22, 2012 at 01:50:09PM +0000, Hebbar, Gururaja wrote:
> 
> > From your for-3.7 branch, I could only find such implementation in Tegra
> > Platform. 
> > Most Freescale platforms implements this through a device/driver method.
> > Exception being sound/soc/mxs/mxs-pcm.c
> 
> > So should I follow tegra implementation?
> 
> Tegra and mxs should be good examples, yes.

Ok. Will update in V2

> 


Regards, 
Gururaja
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/davinci-pcm.txt b/Documentation/devicetree/bindings/sound/davinci-pcm.txt
new file mode 100644
index 0000000..be494bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/davinci-pcm.txt
@@ -0,0 +1,13 @@ 
+Texas Instruments - Davinci/OMAP2+ PCM module
+
+PCM module doesn't use/require any platform data. Hence only
+compatible field needs to be populated.
+
+Required properties:
+- compatible: "ti,davinci-pcm-audio"
+
+Example:
+
+pcm: davinci-pcm-audio {
+	compatible = "ti,davinci-pcm-audio";
+};
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index fefb3d4..0765101 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -16,6 +16,8 @@ 
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
 #include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -874,10 +876,19 @@  static int __devexit davinci_soc_platform_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#if defined(CONFIG_OF)
+static const struct of_device_id davinci_pcm_dt_ids[] = {
+	{ .compatible = "ti,davinci-pcm-audio", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, davinci_pcm_dt_ids);
+#endif
+
 static struct platform_driver davinci_pcm_driver = {
 	.driver = {
 			.name = "davinci-pcm-audio",
 			.owner = THIS_MODULE,
+			.of_match_table = of_match_ptr(davinci_pcm_dt_ids),
 	},
 
 	.probe = davinci_soc_platform_probe,