From 35ff849a256f84b0bae8102d9d55fa8e3e47c4c2 Mon Sep 17 00:00:00 2001 From: guoyf2 Date: Tue, 21 May 2019 17:17:27 +0800 Subject: [PATCH] NXP patch to fix earpiece no sound issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NXP patch to fix (CR) Issue description: No sound issue has been found in handheld mode in one of Moto Projects, SurfNa project(tfa9871, driver code Ver6.5.0). About 1/600 chance root cause: If set SBSL=1, the AMPE usually can be AMPE=1 automatically. But sometimes can’t be set AMPE=1 by itself. So AMPE must be set to 1 manually in code. Dependency on automatic AMPE setting is not a wise way. In driver 6.5.0, there’s no code to set AMPE during profile switch, but boot up sequence has already been added. Solution: Add AMPE=1 operation in profile switching Change-Id: I3de27e826d39c93f2d011d0f9d8fe9877e8efc89 Signed-off-by: guoyf2 Reviewed-on: https://gerrit.mot.com/1358094 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhengming Yao Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- sound/soc/codecs/tfa_container.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tfa_container.c b/sound/soc/codecs/tfa_container.c index e032eb91d935..58e79b246163 100644 --- a/sound/soc/codecs/tfa_container.c +++ b/sound/soc/codecs/tfa_container.c @@ -1832,7 +1832,10 @@ enum Tfa98xx_Error tfaContWriteProfile(struct tfa_device *tfa, int prof_idx, int } if ((prof->group != previous_prof->group || prof->group == 0) && (tfa->tfa_family == 2)) { - if (TFA_GET_BF(tfa, REFCKSEL) == 0) { + if (tfa->is_probus_device) { + pr_debug("%s: probus device set AMPE=1", __func__); + TFA_SET_BF_VOLATILE(tfa, AMPE, 1); + } else if(TFA_GET_BF(tfa, REFCKSEL) == 0) { /* set SBSL to go to operation mode */ TFA_SET_BF_VOLATILE(tfa, SBSL, 1); }