mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
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>
This commit is contained in:
parent
7e751e375a
commit
9036e4acc8
@ -750,17 +750,21 @@ static int stm32_spdifrx_hw_params(struct snd_pcm_substream *substream,
|
|||||||
switch (data_size) {
|
switch (data_size) {
|
||||||
case 16:
|
case 16:
|
||||||
fmt = SPDIFRX_DRFMT_PACKED;
|
fmt = SPDIFRX_DRFMT_PACKED;
|
||||||
spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
fmt = SPDIFRX_DRFMT_LEFT;
|
fmt = SPDIFRX_DRFMT_LEFT;
|
||||||
spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(&spdifrx->pdev->dev, "Unexpected data format\n");
|
dev_err(&spdifrx->pdev->dev, "Unexpected data format\n");
|
||||||
return -EINVAL;
|
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);
|
snd_soc_dai_init_dma_data(cpu_dai, NULL, &spdifrx->dma_params);
|
||||||
|
|
||||||
return regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR,
|
return regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR,
|
||||||
|
Loading…
Reference in New Issue
Block a user