summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorStas Sergeev <stsp@list.ru>2013-04-17 16:34:06 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-17 14:29:36 +0100
commit60b6f1a1e578a5f8a245d4b7622ebf2bad7798cb (patch)
tree9575faa1f56a73ed880bad81441970ae341247f0 /sound
parent379cf39781fdb34c75bab6ac54707bc4466f3dc4 (diff)
downloadlinux-3.10-60b6f1a1e578a5f8a245d4b7622ebf2bad7798cb.tar.gz
linux-3.10-60b6f1a1e578a5f8a245d4b7622ebf2bad7798cb.tar.bz2
linux-3.10-60b6f1a1e578a5f8a245d4b7622ebf2bad7798cb.zip
ASoC: define playback and capture streams in dummy codec
This patch adds a playback and capture streams to the dummy codec DAI configuration. Most permissive set of sampling rates and formats is used. This patch is needed for playback and capturing on a codec-less systems, as otherwise the PCM device nodes are not even created. Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-utils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index fe4541df498..4b3be6c3c91 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -90,8 +90,33 @@ static struct snd_soc_platform_driver dummy_platform = {
};
static struct snd_soc_codec_driver dummy_codec;
+
+#define STUB_RATES SNDRV_PCM_RATE_8000_192000
+#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
+ SNDRV_PCM_FMTBIT_U8 | \
+ SNDRV_PCM_FMTBIT_S16_LE | \
+ SNDRV_PCM_FMTBIT_U16_LE | \
+ SNDRV_PCM_FMTBIT_S24_LE | \
+ SNDRV_PCM_FMTBIT_U24_LE | \
+ SNDRV_PCM_FMTBIT_S32_LE | \
+ SNDRV_PCM_FMTBIT_U32_LE | \
+ SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
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,
+ .formats = STUB_FORMATS,
+ },
};
static int snd_soc_dummy_probe(struct platform_device *pdev)