summaryrefslogtreecommitdiffstats
path: root/sound/soc/stm
diff options
context:
space:
mode:
authorolivier moysan <olivier.moysan@st.com>2017-11-06 16:18:52 +0100
committerMark Brown <broonie@kernel.org>2017-11-06 16:45:36 +0100
commit9036e4acc81700a51e5f42820ba4570bea9b6f48 (patch)
tree59b3f8202dd6e57ec7dd5ee0c55b3f03251fe2f5 /sound/soc/stm
parentASoC: stm32: sai: fix warning in stm32_sai_set_config() (diff)
downloadlinux-9036e4acc81700a51e5f42820ba4570bea9b6f48.tar.xz
linux-9036e4acc81700a51e5f42820ba4570bea9b6f48.zip
ASoC: stm32: spdifrx: fix 16 bits capture
Change DMA bus width to manage properly 16 bits packed format. 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_spdifrx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 84cc5678beba..d7dbe84d5eeb 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -750,17 +750,21 @@ static int stm32_spdifrx_hw_params(struct snd_pcm_substream *substream,
switch (data_size) {
case 16:
fmt = SPDIFRX_DRFMT_PACKED;
- spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
break;
case 32:
fmt = SPDIFRX_DRFMT_LEFT;
- spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
break;
default:
dev_err(&spdifrx->pdev->dev, "Unexpected data format\n");
return -EINVAL;
}
+ /*
+ * Set buswidth to 4 bytes for all data formats.
+ * Packed format: transfer 2 x 2 bytes samples
+ * Left format: transfer 1 x 3 bytes samples + 1 dummy byte
+ */
+ spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
snd_soc_dai_init_dma_data(cpu_dai, NULL, &spdifrx->dma_params);
return regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR,