]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: fsl_sai: Fix incorrect condition check in trigger()
authorNicolin Chen <Guangyu.Chen@freescale.com>
Fri, 11 Apr 2014 14:10:00 +0000 (22:10 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:48 +0000 (21:16 -0600)
Patch ASoC: fsl_sai: Fix buggy configurations in trigger() doesn't entirely
fix the condition: FRDE of the current substream direction is being cleared
while the code is still using the non-updated one.

Thus this patch fixes this issue by checking the opposite one's FRDE alone
since the current one's is absolutely disabled.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f84526cfae46672308a361333c76b724384b61ee)

sound/soc/fsl/fsl_sai.c

index 1c93282fbd2696a9475499ee7e4b0d51ddb0f615..a25e8884b09d893e1d58c2b60eecfe3bf5db21ef 100644 (file)
@@ -409,7 +409,8 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
                regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx),
                                   FSL_SAI_CSR_xIE_MASK, 0);
 
-               if (!(tcsr & FSL_SAI_CSR_FRDE || rcsr & FSL_SAI_CSR_FRDE)) {
+               /* Check if the opposite FRDE is also disabled */
+               if (!(tx ? rcsr & FSL_SAI_CSR_FRDE : tcsr & FSL_SAI_CSR_FRDE)) {
                        regmap_update_bits(sai->regmap, FSL_SAI_TCSR,
                                           FSL_SAI_CSR_TERE, 0);
                        regmap_update_bits(sai->regmap, FSL_SAI_RCSR,