aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kristiansson <stefan.kristiansson@saunalahti.fi>2014-09-29 15:41:10 -0400
committerMark Brown <broonie@kernel.org>2014-09-30 08:27:27 -0400
commit555b9ee1368a9ceddd5c963ad918db5120638674 (patch)
tree155751d595b0e076783b7d808d0dc5690fd0c5d1
parentfe2a08b3bf1a6e35c00e18843bc19aa1778432c3 (diff)
ASoC: ssm2602: add device tree bindings
Allow the ssm2602/ssm2603/ssm2604 codec driver to be instantiated from the device tree. Also, add Kconfig prompts to allow manual selection of both the I2C and SPI configuration versions of the driver. Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
-rw-r--r--Documentation/devicetree/bindings/sound/adi,ssm2602.txt19
-rw-r--r--sound/soc/codecs/Kconfig8
-rw-r--r--sound/soc/codecs/ssm2602-i2c.c9
-rw-r--r--sound/soc/codecs/ssm2602-spi.c7
4 files changed, 41 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/sound/adi,ssm2602.txt b/Documentation/devicetree/bindings/sound/adi,ssm2602.txt
new file mode 100644
index 000000000000..3b3302fe399b
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/adi,ssm2602.txt
@@ -0,0 +1,19 @@
1Analog Devices SSM2602, SSM2603 and SSM2604 I2S audio CODEC devices
2
3SSM2602 support both I2C and SPI as the configuration interface,
4the selection is made by the MODE strap-in pin.
5SSM2603 and SSM2604 only support I2C as the configuration interface.
6
7Required properties:
8
9 - compatible : One of "adi,ssm2602", "adi,ssm2603" or "adi,ssm2604"
10
11 - reg : the I2C address of the device for I2C, the chip select
12 number for SPI.
13
14 Example:
15
16 ssm2602: ssm2602@1a {
17 compatible = "adi,ssm2602";
18 reg = <0x1a>;
19 };
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 8838838e25ed..3649e7399ec7 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -520,12 +520,16 @@ config SND_SOC_SSM2602
520 tristate 520 tristate
521 521
522config SND_SOC_SSM2602_SPI 522config SND_SOC_SSM2602_SPI
523 tristate "Analog Devices SSM2602 CODEC - SPI"
524 depends on SPI_MASTER
523 select SND_SOC_SSM2602 525 select SND_SOC_SSM2602
524 tristate 526 select REGMAP_SPI
525 527
526config SND_SOC_SSM2602_I2C 528config SND_SOC_SSM2602_I2C
529 tristate "Analog Devices SSM2602 CODEC - I2C"
530 depends on I2C
527 select SND_SOC_SSM2602 531 select SND_SOC_SSM2602
528 tristate 532 select REGMAP_I2C
529 533
530config SND_SOC_STA32X 534config SND_SOC_STA32X
531 tristate 535 tristate
diff --git a/sound/soc/codecs/ssm2602-i2c.c b/sound/soc/codecs/ssm2602-i2c.c
index abd63d537173..0d9779d6bfda 100644
--- a/sound/soc/codecs/ssm2602-i2c.c
+++ b/sound/soc/codecs/ssm2602-i2c.c
@@ -41,10 +41,19 @@ static const struct i2c_device_id ssm2602_i2c_id[] = {
41}; 41};
42MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id); 42MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id);
43 43
44static const struct of_device_id ssm2602_of_match[] = {
45 { .compatible = "adi,ssm2602", },
46 { .compatible = "adi,ssm2603", },
47 { .compatible = "adi,ssm2604", },
48 { }
49};
50MODULE_DEVICE_TABLE(of, ssm2602_of_match);
51
44static struct i2c_driver ssm2602_i2c_driver = { 52static struct i2c_driver ssm2602_i2c_driver = {
45 .driver = { 53 .driver = {
46 .name = "ssm2602", 54 .name = "ssm2602",
47 .owner = THIS_MODULE, 55 .owner = THIS_MODULE,
56 .of_match_table = ssm2602_of_match,
48 }, 57 },
49 .probe = ssm2602_i2c_probe, 58 .probe = ssm2602_i2c_probe,
50 .remove = ssm2602_i2c_remove, 59 .remove = ssm2602_i2c_remove,
diff --git a/sound/soc/codecs/ssm2602-spi.c b/sound/soc/codecs/ssm2602-spi.c
index 2bf55e24a7bb..b5df14fbe3ad 100644
--- a/sound/soc/codecs/ssm2602-spi.c
+++ b/sound/soc/codecs/ssm2602-spi.c
@@ -26,10 +26,17 @@ static int ssm2602_spi_remove(struct spi_device *spi)
26 return 0; 26 return 0;
27} 27}
28 28
29static const struct of_device_id ssm2602_of_match[] = {
30 { .compatible = "adi,ssm2602", },
31 { }
32};
33MODULE_DEVICE_TABLE(of, ssm2602_of_match);
34
29static struct spi_driver ssm2602_spi_driver = { 35static struct spi_driver ssm2602_spi_driver = {
30 .driver = { 36 .driver = {
31 .name = "ssm2602", 37 .name = "ssm2602",
32 .owner = THIS_MODULE, 38 .owner = THIS_MODULE,
39 .of_match_table = ssm2602_of_match,
33 }, 40 },
34 .probe = ssm2602_spi_probe, 41 .probe = ssm2602_spi_probe,
35 .remove = ssm2602_spi_remove, 42 .remove = ssm2602_spi_remove,