All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ASoC: pcm: Properly initialize hw->rate_max
@ 2014-01-10 15:06 Lars-Peter Clausen
  2014-01-10 15:06 ` [PATCH 2/5] ASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates Lars-Peter Clausen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2014-01-10 15:06 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Takashi Iwai; +Cc: alsa-devel, Lars-Peter Clausen

If none of the components (CODEC or CPU DAI) sets a maximum sample rate we'll
end up with the rate_max field of the runtime hardware set to 0.  (Note that it
is still possible for the components to constrain the supported sample rates
using other methods, e.g. setting a list constraint) If rate_max is 0 this means
that the sound card doesn't support any rates at all, which is not the desired
result. So initialize rate_max to UINT_MAX. For symmetry reasons also set
rate_min to 0.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-pcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 313adba..b6e0c32 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -252,6 +252,9 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
 		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
 		hw->rates |= codec_stream->rates;
 
+	hw->rate_min = 0;
+	hw->rate_max = UINT_MAX;
+
 	snd_pcm_limit_hw_rates(runtime);
 
 	hw->rate_min = max(hw->rate_min, cpu_stream->rate_min);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-10 15:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-10 15:06 [PATCH 1/5] ASoC: pcm: Properly initialize hw->rate_max Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 2/5] ASoC: fsl: Don't mix SNDRV_PCM_RATE_CONTINUOUS with specific rates Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 3/5] ASoC: s6000: " Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 4/5] ALSA: Add helper function for intersecting two rate masks Lars-Peter Clausen
2014-01-10 15:17   ` Takashi Iwai
2014-01-10 15:49     ` Lars-Peter Clausen
2014-01-10 15:06 ` [PATCH 5/5] ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper Lars-Peter Clausen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.