diff options
-rw-r--r-- | Documentation/devicetree/bindings/sound/wm8750.txt | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm8750.c | 10 |
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 @@ | |||
1 | WM8750 and WM8987 audio CODECs | ||
2 | |||
3 | These devices support both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required 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 | |||
13 | Example: | ||
14 | |||
15 | codec: 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 | ||
755 | static const struct of_device_id wm8750_of_match[] = { | ||
756 | { .compatible = "wlf,wm8750", }, | ||
757 | { .compatible = "wlf,wm8987", }, | ||
758 | { } | ||
759 | }; | ||
760 | MODULE_DEVICE_TABLE(of, wm8750_of_match); | ||
761 | |||
754 | #if defined(CONFIG_SPI_MASTER) | 762 | #if defined(CONFIG_SPI_MASTER) |
755 | static int __devinit wm8750_spi_probe(struct spi_device *spi) | 763 | static 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), |