From 5faa703a275bf1c87be3da1c5d4d31c9632f4fbf Mon Sep 17 00:00:00 2001 From: Shuyu Li Date: Wed, 12 Dec 2018 16:25:47 +0800 Subject: [PATCH] audio: auge: The recorded data L/R channel has 7.5 degree phase diff [1/1] PD#SWPL-3145 Problem: The L/R channel has 7.5 degree phase diff Solution: Change reg_tdmin_in_rev_ws of EE_AUDIO_TDMIN_X_CTRL 1->0 Verify: Verify by T962x2_X301 board Change-Id: I6ca624db10ff96481dd7f413d9f184aeee8c95b3 Signed-off-by: Shuyu Li --- sound/soc/amlogic/auge/tdm.c | 4 +++- sound/soc/amlogic/auge/tdm_hw.c | 11 +++++++++++ sound/soc/amlogic/auge/tdm_hw.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sound/soc/amlogic/auge/tdm.c b/sound/soc/amlogic/auge/tdm.c index b62b09b..60703fa 100644 --- a/sound/soc/amlogic/auge/tdm.c +++ b/sound/soc/amlogic/auge/tdm.c @@ -798,8 +798,10 @@ static int aml_dai_set_tdm_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) if (cpu_dai->capture_active && p_tdm->chipinfo && p_tdm->chipinfo->adc_fn - && p_tdm->acodec_adc) + && p_tdm->acodec_adc){ aml_update_tdmin_skew(p_tdm->actrl, p_tdm->id, 4); + aml_update_tdmin_rev_ws(p_tdm->actrl, p_tdm->id, 0); + } return 0; } diff --git a/sound/soc/amlogic/auge/tdm_hw.c b/sound/soc/amlogic/auge/tdm_hw.c index d76614f..c167b44 100644 --- a/sound/soc/amlogic/auge/tdm_hw.c +++ b/sound/soc/amlogic/auge/tdm_hw.c @@ -414,6 +414,17 @@ void aml_update_tdmin_skew(struct aml_audio_controller *actrl, 0x7 << 16, skew << 16); } +void aml_update_tdmin_rev_ws(struct aml_audio_controller *actrl, + int idx, int is_rev) +{ + unsigned int reg_in, off_set; + + off_set = EE_AUDIO_TDMIN_B_CTRL - EE_AUDIO_TDMIN_A_CTRL; + reg_in = EE_AUDIO_TDMIN_A_CTRL + off_set * idx; + aml_audiobus_update_bits(actrl, reg_in, + 0x1 << 25, is_rev << 25); +} + void aml_tdm_set_slot_out( struct aml_audio_controller *actrl, int index, int slots, int slot_width, diff --git a/sound/soc/amlogic/auge/tdm_hw.h b/sound/soc/amlogic/auge/tdm_hw.h index 103c732..7e47302 100644 --- a/sound/soc/amlogic/auge/tdm_hw.h +++ b/sound/soc/amlogic/auge/tdm_hw.h @@ -91,6 +91,9 @@ extern void aml_tdm_set_format( extern void aml_update_tdmin_skew(struct aml_audio_controller *actrl, int idx, int skew); +extern void aml_update_tdmin_rev_ws(struct aml_audio_controller *actrl, + int idx, int is_rev); + extern void aml_tdm_set_slot_out( struct aml_audio_controller *actrl, int index, int slots, int slot_width, -- 2.7.4