diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2014-10-23 18:00:39 +0800 |
---|---|---|
committer | Shengjiu Wang <shengjiu.wang@freescale.com> | 2014-10-28 18:47:06 +0800 |
commit | 5e74f9510104df33b7c85f266f6e017428277047 (patch) | |
tree | 79cb041597961d08daa576034e19bd7ced66862a /sound | |
parent | 6dc915199870f692c41f6694557e281d61bc9207 (diff) |
MLK-9723-2: ASoC: fsl_sai: fix no frame clk in master mode
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: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 0c3e1bfe7a98..73622e7a2b8f 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -477,6 +477,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: @@ -500,6 +507,9 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream, return ret; } + regmap_update_bits(sai->regmap, FSL_SAI_xCR1(tx), FSL_SAI_CR1_RFW_MASK, + tx ? (FSL_SAI_MAXBURST_TX * 2) : (FSL_SAI_MAXBURST_RX - 1)); + regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, FSL_SAI_CR3_TRCE); @@ -538,11 +548,6 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) regmap_write(sai->regmap, FSL_SAI_TCSR, 0); regmap_write(sai->regmap, FSL_SAI_RCSR, 0); - regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, - FSL_SAI_MAXBURST_TX * 2); - regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, - FSL_SAI_MAXBURST_RX - 1); - snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, &sai->dma_params_rx); |