public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_sai: fix no frame clk in master mode
@ 2015-08-12  2:25 Zidan Wang
  2015-08-12  3:53 ` Nicolin Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Zidan Wang @ 2015-08-12  2:25 UTC (permalink / raw)
  To: nicoleotsuka; +Cc: alsa-devel, timur, Zidan Wang, lgirdwood, tiwai, broonie

After several open/close sai test with ctrl+c, there will be I/O error.
The SAI can't work anymore, can't recover. There will be no frame clock.
With adding the software reset in trigger stop, the issue can be fixed.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
---
 sound/soc/fsl/fsl_sai.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 5c737f1..6a947dc 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -504,6 +504,13 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
 					   FSL_SAI_CSR_FR, FSL_SAI_CSR_FR);
 			regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
 					   FSL_SAI_CSR_FR, FSL_SAI_CSR_FR);
+
+			/* Software Reset for both Tx and Rx */
+			regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR);
+			regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR);
+			/* Clear SR bit to finish the reset */
+			regmap_write(sai->regmap, FSL_SAI_TCSR, 0);
+			regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
 		}
 		break;
 	default:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-23  7:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12  2:25 [PATCH] ASoC: fsl_sai: fix no frame clk in master mode Zidan Wang
2015-08-12  3:53 ` Nicolin Chen
2015-08-12  7:59   ` Zidan Wang
2015-08-12  9:19     ` Nicolin Chen
2015-08-18  2:01       ` Zidan Wang
2015-08-21  7:47         ` Nicolin Chen
2015-08-21  8:40           ` Zidan Wang
2015-10-23  7:48             ` Nicolin Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox