mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
SurfNA: earpiece no sound
root cause: incorrect NXP AMPE reg value when power on fix: if AMPE==0 and PWDN ==0, force set AMPE value to 1 Change-Id: Ib7605261b76cac3238b5fa23a7d74a091f0b5ffd Signed-off-by: guoyf2 <guoyf2@lenovo.com> Reviewed-on: https://gerrit.mot.com/1356869 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yunfei Guo <guoyf2@motorola.com> Reviewed-by: Zhengming Yao <yaozm1@lenovo.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
7168b79a8f
commit
1f58f0b219
2 changed files with 18 additions and 4 deletions
|
|
@ -74,6 +74,7 @@ static int tfa98xx_kmsg_regs = 0;
|
|||
static int tfa98xx_ftrace_regs = 0;
|
||||
|
||||
static uint32_t tfa98xx_rpc_send_delay = 0;
|
||||
static bool tfa98xx_ampe_monitor = false;
|
||||
|
||||
static char *fw_name = "tfa98xx.cnt";
|
||||
module_param(fw_name, charp, S_IRUGO | S_IWUSR);
|
||||
|
|
@ -1325,7 +1326,6 @@ static int tfa98xx_set_profile(struct snd_kcontrol *kcontrol,
|
|||
return 0;
|
||||
|
||||
new_profile = ucontrol->value.integer.value[0];
|
||||
pr_err("%s:new_profile:%d profile :%d\n",__func__,new_profile, profile);
|
||||
if (new_profile == profile)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1575,7 +1575,6 @@ static int tfa98xx_set_stereo_ctl(struct snd_kcontrol *kcontrol,
|
|||
tfa98xx->flags |= TFA98XX_FLAG_CHIP_SELECTED;
|
||||
tfa98xx->profile = 1;
|
||||
tfa98xx_mixer_profile = 1;
|
||||
pr_err("%s:profile:%d\n",__func__,tfa98xx->profile);
|
||||
}
|
||||
else
|
||||
tfa98xx->flags &= ~TFA98XX_FLAG_CHIP_SELECTED;
|
||||
|
|
@ -1635,8 +1634,8 @@ static int tfa98xx_algo_set_gain_ctl(struct snd_kcontrol *kcontrol,
|
|||
if(0 == tfa98xx_mixer_profile) {
|
||||
ret = send_tfa_cal_in_band(&buff[1], nr - 1);
|
||||
} else {
|
||||
pr_err("%s:bypass mode current profile is %d\n", __func__, tfa98xx_mixer_profile);
|
||||
}
|
||||
pr_debug("%s:bypass mode current profile is %d\n", __func__, tfa98xx_mixer_profile);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2937,6 +2936,8 @@ static int tfa98xx_mute(struct snd_soc_dai *dai, int mute, int stream)
|
|||
tfa98xx_adsp_send_calib_values(tfa98xx);
|
||||
} else {
|
||||
pr_err("current profile:%d\n",tfa98xx->profile);
|
||||
if(tfa98xx_ampe_monitor)
|
||||
queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->monitor_work, 5*HZ);
|
||||
}
|
||||
/* Start DSP */
|
||||
if ((tfa98xx->flags & TFA98XX_FLAG_CHIP_SELECTED) &&
|
||||
|
|
@ -3155,6 +3156,8 @@ static int tfa98xx_parse_dt(struct device *dev, struct tfa98xx *tfa98xx,
|
|||
tfa98xx_rpc_send_delay = 2;
|
||||
}
|
||||
|
||||
tfa98xx_ampe_monitor = of_property_read_bool(np, "rcv-ampe-monitor");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3717,6 +3717,7 @@ enum Tfa98xx_Error tfa_status(struct tfa_device *tfa)
|
|||
{
|
||||
int value;
|
||||
uint16_t val;
|
||||
uint16_t val2;
|
||||
|
||||
/*
|
||||
* check IC status bits: cold start
|
||||
|
|
@ -3728,6 +3729,16 @@ enum Tfa98xx_Error tfa_status(struct tfa_device *tfa)
|
|||
val = (uint16_t)value;
|
||||
|
||||
/* pr_debug("SYS_STATUS0: 0x%04x\n", val); */
|
||||
value = TFA_READ_REG(tfa, AMPE);
|
||||
if (value < 0)
|
||||
return -value;
|
||||
val2 = (uint16_t)value;
|
||||
if (!TFA_GET_BF_VALUE(tfa, AMPE, val2)&& !TFA_GET_BF_VALUE(tfa, PWDN, val2)) {
|
||||
pr_err("ERROR: AMPE=0, PWDN=0\n");
|
||||
TFA_SET_BF_VOLATILE(tfa, AMPE, 1);
|
||||
//return Tfa98xx_Error_DSP_not_running;
|
||||
}
|
||||
|
||||
if (TFA_GET_BF_VALUE(tfa, ACS, val) ||
|
||||
TFA_GET_BF_VALUE(tfa, WDS, val)) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue