<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 30, 2023 at 4:30 PM Emil Abildgaard Svendsen <<a href="mailto:EMAS@bang-olufsen.dk">EMAS@bang-olufsen.dk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Slot width should follow the physical width of the format instead of the<br>
data width.<br>
<br>
This is needed for formats like SNDRV_PCM_FMTBIT_S24_LE where physical<br>
width is 32 and data width is 24. By using the physical width, data<br>
won't get misaligned.</blockquote><div> </div><div>There are different requirements for this slot width. Some need physical width, </div><div>Some need format width. We need to be careful about change here. </div><div><br></div><div>Actually there is .set_tdm_slot API for slot specific setting, please use this API.</div><div><br></div><div>best regards</div><div>wang shengjiu</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Emil Svendsen <<a href="mailto:emas@bang-olufsen.dk" target="_blank">emas@bang-olufsen.dk</a>><br>
---<br>
 sound/soc/fsl/fsl_sai.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c<br>
index 939c6bdd22c4..213e2d462076 100644<br>
--- a/sound/soc/fsl/fsl_sai.c<br>
+++ b/sound/soc/fsl/fsl_sai.c<br>
@@ -519,13 +519,13 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,<br>
        unsigned int channels = params_channels(params);<br>
        struct snd_dmaengine_dai_dma_data *dma_params;<br>
        struct fsl_sai_dl_cfg *dl_cfg = sai->dl_cfg;<br>
+       u32 slot_width = params_physical_width(params);<br>
        u32 word_width = params_width(params);<br>
        int trce_mask = 0, dl_cfg_idx = 0;<br>
        int dl_cfg_cnt = sai->dl_cfg_cnt;<br>
        u32 dl_type = FSL_SAI_DL_I2S;<br>
        u32 val_cr4 = 0, val_cr5 = 0;<br>
        u32 slots = (channels == 1) ? 2 : channels;<br>
-       u32 slot_width = word_width;<br>
        int adir = tx ? RX : TX;<br>
        u32 pins, bclk;<br>
        u32 watermark;<br>
-- <br>
2.34.1<br>
</blockquote></div></div>