aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/stm
diff options
context:
space:
mode:
authorOlivier Moysan2019-02-28 14:19:22 +0100
committerMark Brown2019-03-03 23:39:16 +0000
commitb8468192971807c43a80d6e2c41f83141cb7b211 (patch)
tree4e0d7fd406530f2972dc196100ccaa1b16335ac7 /sound/soc/stm
parent5f8a1000c3e630c3ac06f1d664eeaa755bce8823 (diff)
ASoC: stm32: sai: fix exposed capabilities in spdif mode
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>
Diffstat (limited to 'sound/soc/stm')
-rw-r--r--sound/soc/stm/stm32_sai_sub.c8
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 506360b7bc01..e418f446e03b 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -682,6 +682,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);