Fix artificial vibrating pattern caused AF always on.

When vibrating with pattern [0,200,0,50], the vibrating will be started with
200ms duration first, when 200ms timeout, vibrator will be stopped with
duration 50ms which will not be considered as long vibrating, then AF will
not be turned off after that. This change is for fixing above issue, though
we haven't got evidence pointing to above metioned vibrating pattern is user
really encounted issue.

Change-Id: Iadc8ff7b9e00a11dc1d3e89b822e6cb8adb76116
Signed-off-by: chenglong1 <chenglong1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1973075
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zhilong Wang <wangzl30@motorola.com>
Reviewed-by: Darong Huang <huangdra@motorola.com>
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Shuo Wang <wangsh18@motorola.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
chenglong1 2021-06-08 14:53:06 +08:00 • committed by Long Cheng
commit f7dec3bb51

View file

@ -67,6 +67,9 @@
#define PM_QOS_VALUE_VB 400
struct pm_qos_request pm_qos_req_vb;
#ifdef CONFIG_AF_NOISE_ELIMINATION
static bool is_af_enabled = false;
#endif
/******************************************************
*
* variable
@ -603,6 +606,7 @@ static int aw8695_haptic_play_go(struct aw8695 *aw8695, bool flag)
if (aw8695->haptic_mode == HAPTIC_LONG) {
pr_info("%s: %d: mot_actuator_on_vibrate_start, duration=%d, haptic_mode=%d, play_mode=%hhu \n", __func__,__LINE__
,aw8695->duration,aw8695->haptic_mode,aw8695->play_mode);
is_af_enabled = true;
mot_actuator_on_vibrate_start();
}
#endif
@ -644,10 +648,11 @@ static int aw8695_haptic_stop(struct aw8695 *aw8695)
aw8695_haptic_play_mode(aw8695, AW8695_HAPTIC_STANDBY_MODE);
#ifdef CONFIG_AF_NOISE_ELIMINATION
if (aw8695->haptic_mode == HAPTIC_LONG) {
if ((aw8695->haptic_mode == HAPTIC_LONG) || (is_af_enabled == true)) {
pr_info("%s: %d: mot_actuator_on_vibrate_stop, duration=%d, haptic_mode=%d, play_mode=%hhu \n", __func__,__LINE__
,aw8695->duration,aw8695->haptic_mode,aw8695->play_mode);
mot_actuator_on_vibrate_stop();
is_af_enabled = false;
}
#endif