From 83117789d006e712dded04f40ea4f1ad6e22932c Mon Sep 17 00:00:00 2001 From: wangshuo18 Date: Thu, 10 Jun 2021 16:45:58 +0800 Subject: [PATCH] aw8695: move camera start entry before the vibrator timer -In the current logic,the camera process is after setting the vibrator timer. The camera will take some time,which cause the vibration duration to be shorter. Especially when we use launch_lens to move lens step-by-step. -So move camera process before setting vibrator timer. Change-Id: Ib8115444015f6160c25177e9065aa0f6a2fcede3 Signed-off-by: wangshuo18 Reviewed-on: https://gerrit.mot.com/1976296 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Long Cheng Reviewed-by: Xingyun Fu Reviewed-by: Qiang Guo Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/misc/awinic/aw8695/aw8695.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/misc/awinic/aw8695/aw8695.c b/drivers/misc/awinic/aw8695/aw8695.c index 0bfaa6cfcc01..873c4013de42 100644 --- a/drivers/misc/awinic/aw8695/aw8695.c +++ b/drivers/misc/awinic/aw8695/aw8695.c @@ -604,14 +604,6 @@ static int aw8695_haptic_play_go(struct aw8695 *aw8695, bool flag) } } if(flag == true) { -#ifdef CONFIG_AF_NOISE_ELIMINATION - 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 aw8695_i2c_write_bits(aw8695, AW8695_REG_GO, AW8695_BIT_GO_MASK, AW8695_BIT_GO_ENABLE); GET_TIME_OF_DAY(&aw8695->pre_enter_time); @@ -1982,6 +1974,12 @@ static void aw8695_vibrate(struct aw8695 *aw8695, int value) aw8695_haptic_play_wav_seq(aw8695, 0x01); break; case HAPTIC_LONG: +#ifdef CONFIG_AF_NOISE_ELIMINATION + 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 aw8695->duration = value; /* wav index config */ aw8695->index = 0x02;