alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: twl6040: Support for DT
@ 2012-05-08 11:52 Peter Ujfalusi
  2012-05-08 12:26 ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Ujfalusi @ 2012-05-08 11:52 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Misael Lopez Cruz

Enable Device Tree based loading of the codec driver.

Example of dts section to load the twl6040-codec driver:
twl6040: twl6040@4b {
	...
	twl6040_codec: twl6040@0 {
		compatible = "ti,twl6040-codec";
		interrupts = <1>;
	};
};

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 .../devicetree/bindings/sound/twl6040.txt          |   26 ++++++++++++++++++++
 sound/soc/codecs/twl6040.c                         |    8 ++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/twl6040.txt

diff --git a/Documentation/devicetree/bindings/sound/twl6040.txt b/Documentation/devicetree/bindings/sound/twl6040.txt
new file mode 100644
index 0000000..1f3dd70
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/twl6040.txt
@@ -0,0 +1,26 @@
+ASoC codec driver for the twl6040 family
+
+The ASoC codec driver is a child of the twl6040 MFD dirver.
+Documentation/devicetree/bindings/mfd/twl6040.txt
+
+Required properties:
+- compatible : Must be "ti,twl6040-codec";
+- interrupts: 1, Jack plug detection IRQ
+
+Example:
+/*
+ * 8-channel high quality low-power audio codec
+ * http://www.ti.com/lit/ds/symlink/twl6040.pdf
+ */
+twl6040: twl6040@4b {
+	...
+	twl6040_codec: twl6040@0 {
+		compatible = "ti,twl6040-codec";
+		interrupts = <1>;
+	};
+};
+
+sound { /* ASoC machine dirver */
+	...
+	dai-link,codec = <&twl6040_codec>;
+};
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 0747260..85c6e0c 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -25,6 +25,7 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/platform_device.h>
+#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/mfd/twl6040.h>
 
@@ -1229,10 +1230,17 @@ static int __devexit twl6040_codec_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id twl6040_codec_of_match[] = {
+	{.compatible = "ti,twl6040-codec", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, twl6040_codec_of_match);
+
 static struct platform_driver twl6040_codec_driver = {
 	.driver = {
 		.name = "twl6040-codec",
 		.owner = THIS_MODULE,
+		.of_match_table = twl6040_codec_of_match,
 	},
 	.probe = twl6040_codec_probe,
 	.remove = __devexit_p(twl6040_codec_remove),
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-05-15  8:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-08 11:52 [PATCH] ASoC: twl6040: Support for DT Peter Ujfalusi
2012-05-08 12:26 ` Mark Brown
2012-05-08 12:42   ` Peter Ujfalusi
2012-05-08 13:41     ` Mark Brown
2012-05-09 12:01       ` Peter Ujfalusi
2012-05-09 13:35         ` Mark Brown
2012-05-10 12:55           ` Peter Ujfalusi
2012-05-11 14:05             ` Mark Brown
     [not found]           ` <20120509133511.GQ3955-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-05-11 11:02             ` Cousson, Benoit
2012-05-11 13:08               ` Mark Brown
     [not found]                 ` <20120511130816.GB3960-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-05-11 15:44                   ` Cousson, Benoit
2012-05-11 20:34                     ` Mark Brown
2012-05-14 11:38                       ` Peter Ujfalusi
2012-05-14 12:11                         ` Mark Brown
2012-05-15  8:00                           ` Peter Ujfalusi
2012-05-14 15:34                   ` Tony Lindgren
2012-05-15  7:41                     ` Peter Ujfalusi

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).