aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorNicolin Chen <Guangyu.Chen@freescale.com>2014-04-04 03:09:47 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:58:16 -0400
commit7f28e4df4bc091583ec5e4d29aaca92d2db53c96 (patch)
treebfec1ccafb348e9f5c8c1a9b0263f1660ff2aa8c /sound/soc/fsl
parent0ce9f203cd68f31d74c290026e2f2e471576f529 (diff)
ASoC: fsl_sai: Fix Bit Clock Polarity configurations
The BCP bit in TCR4/RCR4 register rules as followings: 0 Bit clock is active high with drive outputs on rising edge and sample inputs on falling edge. 1 Bit clock is active low with drive outputs on falling edge and sample inputs on rising edge. For all formats currently supported in the fsl_sai driver, they're exactly sending data on the falling edge and sampling on the rising edge. However, the driver clears this BCP bit for all of them which results click noise when working with SGTL5000 and big noise with WM8962. Thus this patch corrects the BCP settings for all the formats here to fix the nosie issue. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Acked-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit ef33bc3217c7aa9868f497c4f797cc50ad3ce357)
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl_sai.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 05776dbaa4d9..71688fa4f400 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -206,7 +206,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
206 * that is, together with the last bit of the previous 206 * that is, together with the last bit of the previous
207 * data word. 207 * data word.
208 */ 208 */
209 val_cr2 &= ~FSL_SAI_CR2_BCP; 209 val_cr2 |= FSL_SAI_CR2_BCP;
210 val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP; 210 val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP;
211 break; 211 break;
212 case SND_SOC_DAIFMT_LEFT_J: 212 case SND_SOC_DAIFMT_LEFT_J:
@@ -214,7 +214,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
214 * Frame high, one word length for frame sync, 214 * Frame high, one word length for frame sync,
215 * frame sync asserts with the first bit of the frame. 215 * frame sync asserts with the first bit of the frame.
216 */ 216 */
217 val_cr2 &= ~FSL_SAI_CR2_BCP; 217 val_cr2 |= FSL_SAI_CR2_BCP;
218 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); 218 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
219 break; 219 break;
220 case SND_SOC_DAIFMT_DSP_A: 220 case SND_SOC_DAIFMT_DSP_A:
@@ -224,7 +224,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
224 * that is, together with the last bit of the previous 224 * that is, together with the last bit of the previous
225 * data word. 225 * data word.
226 */ 226 */
227 val_cr2 &= ~FSL_SAI_CR2_BCP; 227 val_cr2 |= FSL_SAI_CR2_BCP;
228 val_cr4 &= ~FSL_SAI_CR4_FSP; 228 val_cr4 &= ~FSL_SAI_CR4_FSP;
229 val_cr4 |= FSL_SAI_CR4_FSE; 229 val_cr4 |= FSL_SAI_CR4_FSE;
230 sai->is_dsp_mode = true; 230 sai->is_dsp_mode = true;
@@ -234,7 +234,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
234 * Frame high, one bit for frame sync, 234 * Frame high, one bit for frame sync,
235 * frame sync asserts with the first bit of the frame. 235 * frame sync asserts with the first bit of the frame.
236 */ 236 */
237 val_cr2 &= ~FSL_SAI_CR2_BCP; 237 val_cr2 |= FSL_SAI_CR2_BCP;
238 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); 238 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
239 sai->is_dsp_mode = true; 239 sai->is_dsp_mode = true;
240 break; 240 break;