diff options
author | Olivier Moysan <olivier.moysan@st.com> | 2019-02-28 16:19:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-10 18:54:05 +0300 |
commit | c37f7344075a424fd4c70f0710a4feeed7ac1fb1 (patch) | |
tree | 5b5f06f3046436606423b7ae55f06a0490ecd0de /sound/soc | |
parent | 2aeceaaff09b2fb329976ba67889d9a5c5bcc750 (diff) | |
download | linux-c37f7344075a424fd4c70f0710a4feeed7ac1fb1.tar.xz |
ASoC: stm32: sai: fix exposed capabilities in spdif mode
[ Upstream commit b8468192971807c43a80d6e2c41f83141cb7b211 ]
Change capabilities exposed in SAI S/PDIF mode, to match
actually supported formats.
In S/PDIF mode only 32 bits stereo is supported.
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/stm/stm32_sai_sub.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index e8df3cc341b5..2fb2b914e78b 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -498,6 +498,14 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, sai->substream = substream; + if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) { + snd_pcm_hw_constraint_mask64(substream->runtime, + SNDRV_PCM_HW_PARAM_FORMAT, + SNDRV_PCM_FMTBIT_S32_LE); + snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_CHANNELS, 2); + } + ret = clk_prepare_enable(sai->sai_ck); if (ret < 0) { dev_err(cpu_dai->dev, "Failed to enable clock: %d\n", ret); |