ASoC: Add device tree binding for WM8770
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 29 Aug 2011 13:12:15 +0000 (14:12 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 31 Aug 2011 08:52:43 +0000 (09:52 +0100)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Documentation/devicetree/bindings/sound/wm8770.txt [new file with mode: 0644]
sound/soc/codecs/wm8770.c

diff --git a/Documentation/devicetree/bindings/sound/wm8770.txt b/Documentation/devicetree/bindings/sound/wm8770.txt
new file mode 100644 (file)
index 0000000..866e00c
--- /dev/null
@@ -0,0 +1,16 @@
+WM8770 audio CODEC
+
+This device supports SPI.
+
+Required properties:
+
+  - compatible : "wlf,wm8770"
+
+  - reg : the chip select number.
+
+Example:
+
+codec: wm8770@1 {
+       compatible = "wlf,wm8770";
+       reg = <1>;
+};
index 19b92baa9e8c480c7a07b479c95d0f94f62ef4ae..aa05e6507f844a2ac90c970e939a92efc9de0ff7 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/of_device.h>
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
@@ -684,6 +685,12 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8770 = {
        .reg_cache_default = wm8770_reg_defs
 };
 
+static const struct of_device_id wm8770_of_match[] = {
+       { .compatible = "wlf,wm8770", },
+       { }
+};
+MODULE_DEVICE_TABLE(of, wm8770_of_match);
+
 #if defined(CONFIG_SPI_MASTER)
 static int __devinit wm8770_spi_probe(struct spi_device *spi)
 {
@@ -715,6 +722,7 @@ static struct spi_driver wm8770_spi_driver = {
        .driver = {
                .name = "wm8770",
                .owner = THIS_MODULE,
+               .of_match_table = wm8770_of_match,
        },
        .probe = wm8770_spi_probe,
        .remove = __devexit_p(wm8770_spi_remove)