diff options
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index a437899d2d11..a79a9b0c08fd 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c | |||
@@ -327,7 +327,7 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, | |||
327 | { | 327 | { |
328 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); | 328 | struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); |
329 | bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; | 329 | bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; |
330 | u32 xcsr; | 330 | u32 xcsr, count = 100; |
331 | 331 | ||
332 | /* | 332 | /* |
333 | * The transmitter bit clock and frame sync are to be | 333 | * The transmitter bit clock and frame sync are to be |
@@ -369,11 +369,20 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, | |||
369 | if (!(xcsr & FSL_SAI_CSR_FRDE)) { | 369 | if (!(xcsr & FSL_SAI_CSR_FRDE)) { |
370 | /* Disable both directions and reset their FIFOs */ | 370 | /* Disable both directions and reset their FIFOs */ |
371 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, | 371 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, |
372 | FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR, | 372 | FSL_SAI_CSR_TERE, 0); |
373 | FSL_SAI_CSR_FR); | ||
374 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, | 373 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, |
375 | FSL_SAI_CSR_TERE | FSL_SAI_CSR_FR, | 374 | FSL_SAI_CSR_TERE, 0); |
376 | FSL_SAI_CSR_FR); | 375 | |
376 | /* TERE will remain set till the end of current frame */ | ||
377 | do { | ||
378 | udelay(10); | ||
379 | regmap_read(sai->regmap, FSL_SAI_xCSR(tx), &xcsr); | ||
380 | } while (--count && xcsr & FSL_SAI_CSR_TERE); | ||
381 | |||
382 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, | ||
383 | FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); | ||
384 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, | ||
385 | FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); | ||
377 | } | 386 | } |
378 | break; | 387 | break; |
379 | default: | 388 | default: |