diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2018-08-27 14:26:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 17:59:43 +0100 |
commit | 8cb302840cd44cb344731c8a505f1244fe6253c9 (patch) | |
tree | 7f1bc21050de3e0c177a0163094ac613d32a633c /sound | |
parent | caf450580cd30f35010d86f1fbde95c84578eee3 (diff) | |
download | linux-stable-8cb302840cd44cb344731c8a505f1244fe6253c9.tar.gz linux-stable-8cb302840cd44cb344731c8a505f1244fe6253c9.tar.bz2 linux-stable-8cb302840cd44cb344731c8a505f1244fe6253c9.zip |
ASoC: dpcm: Properly initialise hw->rate_max
[ Upstream commit e33ffbd9cd39da09831ce62c11025d830bf78d9e ]
If the CPU DAI does not initialise rate_max, say if using
using KNOT or CONTINUOUS, then the rate_max field will be
initialised to 0. A value of zero in the rate_max field of
the hardware runtime will cause the sound card to support no
sample rates at all. Obviously this is not desired, just a
different mechanism is being used to apply the constraints. As
such update the setting of rate_max in dpcm_init_runtime_hw
to be consistent with the non-DPCM cases and set rate_max to
UINT_MAX if nothing is defined on the CPU DAI.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 052b6294a428..24047375c2fb 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1578,7 +1578,7 @@ static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, u64 formats) { runtime->hw.rate_min = stream->rate_min; - runtime->hw.rate_max = stream->rate_max; + runtime->hw.rate_max = min_not_zero(stream->rate_max, UINT_MAX); runtime->hw.channels_min = stream->channels_min; runtime->hw.channels_max = stream->channels_max; if (runtime->hw.formats) |