Commit 08d15f03 authored by Mark Brown's avatar Mark Brown

ASoC: Switch FSL SSI DAI over to symmetric_rates

The effect of symmetric_constraints should provide a standard way to
enforce the use of the same sample rate for both directions.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarTimur Tabi <timur@freescale.com>
parent 0c0e09e2
...@@ -375,18 +375,14 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, ...@@ -375,18 +375,14 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
struct snd_pcm_runtime *first_runtime = struct snd_pcm_runtime *first_runtime =
ssi_private->first_stream->runtime; ssi_private->first_stream->runtime;
if (!first_runtime->rate || !first_runtime->sample_bits) { if (!first_runtime->sample_bits) {
dev_err(substream->pcm->card->dev, dev_err(substream->pcm->card->dev,
"set sample rate and size in %s stream first\n", "set sample size in %s stream first\n",
substream->stream == SNDRV_PCM_STREAM_PLAYBACK substream->stream == SNDRV_PCM_STREAM_PLAYBACK
? "capture" : "playback"); ? "capture" : "playback");
return -EAGAIN; return -EAGAIN;
} }
snd_pcm_hw_constraint_minmax(substream->runtime,
SNDRV_PCM_HW_PARAM_RATE,
first_runtime->rate, first_runtime->rate);
/* If we're in synchronous mode, then we need to constrain /* If we're in synchronous mode, then we need to constrain
* the sample size as well. We don't support independent sample * the sample size as well. We don't support independent sample
* rates in asynchronous mode. * rates in asynchronous mode.
...@@ -693,6 +689,7 @@ struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info) ...@@ -693,6 +689,7 @@ struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
fsl_ssi_dai->name = ssi_private->name; fsl_ssi_dai->name = ssi_private->name;
fsl_ssi_dai->id = ssi_info->id; fsl_ssi_dai->id = ssi_info->id;
fsl_ssi_dai->dev = ssi_info->dev; fsl_ssi_dai->dev = ssi_info->dev;
fsl_ssi_dai->symmetric_rates = 1;
ret = snd_soc_register_dai(fsl_ssi_dai); ret = snd_soc_register_dai(fsl_ssi_dai);
if (ret != 0) { if (ret != 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment