[PATCH 8/8] ASoC: add snd-soc-dummy DT support
From: Kuninori Morimoto <hidden>
Date: 2014-08-20 07:13:08
Also in:
alsa-devel
Subsystem:
open firmware and flattened device tree bindings, sound, sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers:
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Linus Torvalds
From: Kuninori Morimoto <redacted> This patch adds snd-soc-dummy DT binding support. It removes .stream_name from dummy_dai, because "Playback" / "Capture" is very popular naming. The DAPM will lost correct route settings if other CPU/Codec was using same stream name. And it will be problem when DPCM case. Like below FE CPU (rsnd): "DAI0 Playback" Codec (dummy): "Playback" BE CPU (dummy): "Playback" Codec (ak4642): "Playback" simple-audio-card,routing = "Playback", "DAI0 Playback"; Signed-off-by: Kuninori Morimoto <redacted> --- .../devicetree/bindings/sound/snd-soc-dummy | 13 +++++++++++++ sound/soc/soc-utils.c | 12 +++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/snd-soc-dummy
diff --git a/Documentation/devicetree/bindings/sound/snd-soc-dummy b/Documentation/devicetree/bindings/sound/snd-soc-dummy
new file mode 100644
index 0000000..ea3fe0c
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/snd-soc-dummy@@ -0,0 +1,13 @@ +snd-soc-dummy: + +ALSA SoC dummy codec. + +Required properties: + + - compatible : "alsa-soc-dummy" + +Example: + +sound_dummy { + compatible = "alsa-soc-dummy"; +};
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index 7f22ca3..df11010 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c@@ -12,7 +12,8 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ - +#include <linux/module.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/export.h> #include <sound/core.h>
@@ -104,14 +105,12 @@ static struct snd_soc_codec_driver dummy_codec; static struct snd_soc_dai_driver dummy_dai = { .name = "snd-soc-dummy-dai", .playback = { - .stream_name = "Playback", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES, .formats = STUB_FORMATS, }, .capture = { - .stream_name = "Capture", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES,
@@ -151,10 +150,17 @@ static int snd_soc_dummy_remove(struct platform_device *pdev) return 0; } +static struct of_device_id soc_dummy_of_match[] = { + { .compatible = "alsa-soc-dummy" }, + {}, +}; +MODULE_DEVICE_TABLE(of, soc_dummy_of_match); + static struct platform_driver soc_dummy_driver = { .driver = { .name = "snd-soc-dummy", .owner = THIS_MODULE, + .of_match_table = soc_dummy_of_match, }, .probe = snd_soc_dummy_probe, .remove = snd_soc_dummy_remove,
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html