[alsa-devel] [PATCH v2 02/11] ASoC: dpcm: Allow PCMs to omit the set of supported formats

Lars-Peter Clausen lars at metafoo.de
Mon Jan 6 14:19:07 CET 2014


Allow PCMs that do not impose any restrictions on the supported formats to set
the formats field to 0, Instead of assuming that this means that the PCM does
not support any formats (which doesn't make much sense), assume that it supports
all formats. This brings the behavior of DPCM closer to that of non-DPCM.

Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
Cc: Jean-Francois Moine <moinejf at free.fr>
---
New in v2
---
 sound/soc/soc-pcm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 898149e..86b670e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1242,7 +1242,10 @@ static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
 	runtime->hw.rate_max = stream->rate_max;
 	runtime->hw.channels_min = stream->channels_min;
 	runtime->hw.channels_max = stream->channels_max;
-	runtime->hw.formats &= stream->formats;
+	if (runtime->hw.formats)
+		runtime->hw.formats &= stream->formats;
+	else
+		runtime->hw.formats = stream->formats;
 	runtime->hw.rates = stream->rates;
 }
 
-- 
1.8.0



More information about the Alsa-devel mailing list