]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: pcm: Always honor DAI min and max sample rate constraints
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 27 Nov 2013 08:58:18 +0000 (09:58 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 27 Nov 2013 16:43:12 +0000 (16:43 +0000)
commit30ac4eb049d7ccdbf5e9a75bfca4d51c0e3a98ab
tree5169621088303663b48e8841b67bb3f75b84b8bd
parentd23423747dce2e23895ad88b49ca8f6648a7f6d4
ASoC: pcm: Always honor DAI min and max sample rate constraints

snd_pcm_limit_hw_rates() will initialize the minimum and maximum sample rate for
the PCM stream based on the rates specified in the rates field. Since we call
snd_pcm_limit_hw_rates() after soc_pcm_init_runtime_hw() it will essentially
overwrite the min and max rate set in soc_pcm_init_runtime_hw(). This may cause
the minimum or maximum rate to be set to a value outside the range of one of the
components if one of the components sets either SNDRV_PCM_RATE_CONTINUOUS or
SNDRV_PCM_RATE_KNOT and the other component specified a discrete rate via
SNDRV_PCM_RATE_[0-9]* that is outside of the first component's rate range. To
fix this first calculate the minimum and maximum rates using
snd_pcm_limit_hw_rates() and then on top of that apply the contraints specified
in the snd_soc_pcm_stream structs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Takashi iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-pcm.c