diff mbox series

ASoC: fsl_sai: Use physical format width

Message ID 168019239506.26.13518757920586712702@mailman-core.alsa-project.org (mailing list archive)
State New, archived
Headers show
Series ASoC: fsl_sai: Use physical format width | expand

Commit Message

Emil Abildgaard Svendsen March 30, 2023, 8:30 a.m. UTC
Slot width should follow the physical width of the format instead of the
data width.

This is needed for formats like SNDRV_PCM_FMTBIT_S24_LE where physical
width is 32 and data width is 24. By using the physical width, data
won't get misaligned.

Signed-off-by: Emil Svendsen <emas@bang-olufsen.dk>
---
 sound/soc/fsl/fsl_sai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 939c6bdd22c4..213e2d462076 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -519,13 +519,13 @@  static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
 	unsigned int channels = params_channels(params);
 	struct snd_dmaengine_dai_dma_data *dma_params;
 	struct fsl_sai_dl_cfg *dl_cfg = sai->dl_cfg;
+	u32 slot_width = params_physical_width(params);
 	u32 word_width = params_width(params);
 	int trce_mask = 0, dl_cfg_idx = 0;
 	int dl_cfg_cnt = sai->dl_cfg_cnt;
 	u32 dl_type = FSL_SAI_DL_I2S;
 	u32 val_cr4 = 0, val_cr5 = 0;
 	u32 slots = (channels == 1) ? 2 : channels;
-	u32 slot_width = word_width;
 	int adir = tx ? RX : TX;
 	u32 pins, bclk;
 	u32 watermark;