cam: reduce launch_lens step,add judgement before init

1.Reduces the number and length of launch_lens,to reduce delay of vibrating.
-Optimize delay of vibrating,but it still have about 110ms delay. 
2.Do not init actuator when camera APP is holding actuator.
-Fix the wide camera image shaking issue when the phone was vibrating

Change-Id: I7ee1c1a063cb6428d36544b6958e1b2f19f518ed
Signed-off-by: wangshuo18 <wangshuo18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1976594
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Liu <liuwang2@lenovo.com>
Reviewed-by: Darong Huang <huangdra@motorola.com>
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Xingyun Fu <fuxy7@motorola.com>
Reviewed-by: Qiang Guo <guoq8@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangshuo18 2021-06-10 21:32:37 +08:00 • committed by zhaoji1
commit 70cfea590d

View file

@ -341,8 +341,9 @@ static mot_park_lens_step lens_park_table[PARK_LENS_MAX_STAGES] = {
};
static mot_launch_lens_step lens_launch_table[LAUNCH_LENS_MAX_STAGES] = {
{300, 300},
{720, 60},
{840, 40},
{700, 100},
{820, 60},
{900, 40},
};
static bool runtime_inited = 0;
@ -560,13 +561,19 @@ static int32_t mot_actuator_launch_lens(uint32_t index, uint32_t dac_value)
static int32_t mot_actuator_vib_move_lens(uint32_t index)
{
int32_t ret = 0;
unsigned int consumers = 0;
if (mot_device_index >= MOT_DEVICE_NUM || index > mot_dev_list[mot_device_index].actuator_num) {
CAM_ERR(CAM_ACTUATOR, "INVALID device!!!");
return -1;
}
if (mot_actuator_state <= MOT_ACTUATOR_IDLE || mot_actuator_state >= MOT_ACTUATOR_RELEASED) {
consumers = mot_actuator_get_consumers();
CAM_DBG(CAM_ACTUATOR, "consumers=%d",consumers);
if (consumers & CLINET_CAMERA_MASK) {
/*Don't init actuator when camera on*/
CAM_WARN(CAM_ACTUATOR, "Camera is holding actuator,don't init actuator for vibrator,consumers=%d",consumers);
} else if (mot_actuator_state <= MOT_ACTUATOR_IDLE || mot_actuator_state >= MOT_ACTUATOR_RELEASED) {
mot_actuator_init_runtime();
mot_actuator_power_on(index);
ret = mot_actuator_init_cci(index);
@ -591,8 +598,6 @@ static int32_t mot_actuator_vib_move_lens(uint32_t index)
if (ret == 0 && mot_actuator_state == MOT_ACTUATOR_INITED) {
/*Move lens to the specified position.*/
unsigned int consumers = mot_actuator_get_consumers();
CAM_WARN(CAM_ACTUATOR, "actuator consumers: %d", consumers);
if ((consumers & CLINET_VIBRATOR_MASK) == 0) {