Skip to content

Commit 5c11f63

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_sai: Fix channel swap issue on i.MX8MP
[ Upstream commit 8f0f016 ] When flag mclk_with_tere and mclk_direction_output enabled, The SAI transmitter or receiver will be enabled in very early stage, that if FSL_SAI_xMR is set by previous case, for example previous case is one channel, current case is two channels, then current case started with wrong xMR in the beginning, then channel swap happen. The patch is to clear xMR in hw_free() to avoid such channel swap issue. Fixes: 3e4a826 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://msgid.link/r/1702953057-4499-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 264d8c9 commit 5c11f63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/soc/fsl/fsl_sai.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream,
715715
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
716716
unsigned int ofs = sai->soc_data->reg_offset;
717717

718+
/* Clear xMR to avoid channel swap with mclk_with_tere enabled case */
719+
regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0);
720+
718721
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs),
719722
FSL_SAI_CR3_TRCE_MASK, 0);
720723

0 commit comments

Comments
 (0)