diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-01-11 09:24:40 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-14 20:41:57 (GMT) |
commit | 817873f4b155b22a24c48d6a38ee32007e2d856e (patch) | |
tree | b1dd52e13d803783dd37d713d9433f45bde1ed4c /sound/soc | |
parent | 64a9aa9cf57dd551a9ae9bf48f5e63be608aae72 (diff) | |
download | linux-817873f4b155b22a24c48d6a38ee32007e2d856e.tar.xz |
ASoC: pcm: Properly initialize hw->rate_max
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1a617fd..2b89496 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -170,6 +170,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); |