summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Moysan <olivier.moysan@st.com>2019-11-04 08:36:54 -0500
committerMark Brown <broonie@kernel.org>2019-11-05 13:52:21 -0500
commiteaf072e512d54c95b0977eda06cbca3151ace1e5 (patch)
tree7cfff4a6353ac0d1f21b40f7ed14f127ebc00400
parent5dc7d5bc9627eb26d33c7c7eefc467cf217f9326 (diff)
ASoC: stm32: sai: add restriction on mmap support
Do not support mmap in S/PDIF mode. In S/PDIF mode the buffer has to be copied, to allow the channel status bits insertion. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20191104133654.28750-1-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/stm/stm32_sai_sub.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index a4060813bc74..48e629ac2d88 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -1218,6 +1218,16 @@ static int stm32_sai_pcm_process_spdif(struct snd_pcm_substream *substream,
1218 return 0; 1218 return 0;
1219} 1219}
1220 1220
1221/* No support of mmap in S/PDIF mode */
1222static const struct snd_pcm_hardware stm32_sai_pcm_hw_spdif = {
1223 .info = SNDRV_PCM_INFO_INTERLEAVED,
1224 .buffer_bytes_max = 8 * PAGE_SIZE,
1225 .period_bytes_min = 1024,
1226 .period_bytes_max = PAGE_SIZE,
1227 .periods_min = 2,
1228 .periods_max = 8,
1229};
1230
1221static const struct snd_pcm_hardware stm32_sai_pcm_hw = { 1231static const struct snd_pcm_hardware stm32_sai_pcm_hw = {
1222 .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP, 1232 .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP,
1223 .buffer_bytes_max = 8 * PAGE_SIZE, 1233 .buffer_bytes_max = 8 * PAGE_SIZE,
@@ -1270,7 +1280,7 @@ static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config = {
1270}; 1280};
1271 1281
1272static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config_spdif = { 1282static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config_spdif = {
1273 .pcm_hardware = &stm32_sai_pcm_hw, 1283 .pcm_hardware = &stm32_sai_pcm_hw_spdif,
1274 .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, 1284 .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
1275 .process = stm32_sai_pcm_process_spdif, 1285 .process = stm32_sai_pcm_process_spdif,
1276}; 1286};