Skip to content

Commit 197c53c

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: fsl_sai: Don't disable bitclock for i.MX8MP
On i.MX8MP, the BCE and TERE bit are binding with mclk enablement, if BCE and TERE are cleared the MCLK also be disabled on output pin, that cause the external codec (wm8960) in wrong state. Codec (wm8960) is using the mclk to generate PLL clock, if mclk is disabled before disabling PLL, the codec (wm8960) won't generate bclk and frameclk when sysclk switch to MCLK source in next test case. The test case: $aplay -r44100 test1.wav (PLL source) $aplay -r48000 test2.wav (MCLK source) aplay: pcm_write:2127: write error: Input/output error Fixes: 269f399 ("ASoC: fsl_sai: Disable bit clock with transmitter") Signed-off-by: Shengjiu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5c8a033 commit 197c53c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sound/soc/fsl/fsl_sai.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,15 @@ static void fsl_sai_config_disable(struct fsl_sai *sai, int dir)
710710
{
711711
unsigned int ofs = sai->soc_data->reg_offset;
712712
bool tx = dir == TX;
713-
u32 xcsr, count = 100;
713+
u32 xcsr, count = 100, mask;
714+
715+
if (sai->soc_data->mclk_with_tere && sai->mclk_direction_output)
716+
mask = FSL_SAI_CSR_TERE;
717+
else
718+
mask = FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE;
714719

715720
regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs),
716-
FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE, 0);
721+
mask, 0);
717722

718723
/* TERE will remain set till the end of current frame */
719724
do {

0 commit comments

Comments
 (0)