aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-03 04:34:59 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-14 00:42:51 -0400
commitce31a0f5a6d2c73b61d04f7d886a1f8101eed29f (patch)
tree6ce8ed84e59414d3333c436ea6044f4198dd9fd7
parent53a5a83d24d8ee9567bfcbaf3b37ca5a00ab16a9 (diff)
ASoC: Add device tree binding for WM8750
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
-rw-r--r--Documentation/devicetree/bindings/sound/wm8750.txt18
-rw-r--r--sound/soc/codecs/wm8750.c10
2 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/sound/wm8750.txt b/Documentation/devicetree/bindings/sound/wm8750.txt
new file mode 100644
index 000000000000..8db239fd5ecd
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm8750.txt
@@ -0,0 +1,18 @@
1WM8750 and WM8987 audio CODECs
2
3These devices support both I2C and SPI (configured with pin strapping
4on the board).
5
6Required properties:
7
8 - compatible : "wlf,wm8750" or "wlf,wm8987"
9
10 - reg : the I2C address of the device for I2C, the chip select
11 number for SPI.
12
13Example:
14
15codec: wm8750@1a {
16 compatible = "wlf,wm8750";
17 reg = <0x1a>;
18};
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index 82ac5fcaa2b2..bbb697470d82 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -21,6 +21,7 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/of_device.h>
24#include <sound/core.h> 25#include <sound/core.h>
25#include <sound/pcm.h> 26#include <sound/pcm.h>
26#include <sound/pcm_params.h> 27#include <sound/pcm_params.h>
@@ -751,6 +752,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8750 = {
751 .reg_cache_default = wm8750_reg, 752 .reg_cache_default = wm8750_reg,
752}; 753};
753 754
755static const struct of_device_id wm8750_of_match[] = {
756 { .compatible = "wlf,wm8750", },
757 { .compatible = "wlf,wm8987", },
758 { }
759};
760MODULE_DEVICE_TABLE(of, wm8750_of_match);
761
754#if defined(CONFIG_SPI_MASTER) 762#if defined(CONFIG_SPI_MASTER)
755static int __devinit wm8750_spi_probe(struct spi_device *spi) 763static int __devinit wm8750_spi_probe(struct spi_device *spi)
756{ 764{
@@ -789,6 +797,7 @@ static struct spi_driver wm8750_spi_driver = {
789 .driver = { 797 .driver = {
790 .name = "wm8750-codec", 798 .name = "wm8750-codec",
791 .owner = THIS_MODULE, 799 .owner = THIS_MODULE,
800 .of_match_table = wm8750_of_match,
792 }, 801 },
793 .id_table = wm8750_spi_ids, 802 .id_table = wm8750_spi_ids,
794 .probe = wm8750_spi_probe, 803 .probe = wm8750_spi_probe,
@@ -835,6 +844,7 @@ static struct i2c_driver wm8750_i2c_driver = {
835 .driver = { 844 .driver = {
836 .name = "wm8750-codec", 845 .name = "wm8750-codec",
837 .owner = THIS_MODULE, 846 .owner = THIS_MODULE,
847 .of_match_table = wm8750_of_match,
838 }, 848 },
839 .probe = wm8750_i2c_probe, 849 .probe = wm8750_i2c_probe,
840 .remove = __devexit_p(wm8750_i2c_remove), 850 .remove = __devexit_p(wm8750_i2c_remove),