mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
cam: add wakelock for the actuator noise reduction.
-Sometimes system will suspend during the delaywork. so add wakelock to ensure system is awake. -port from 1984717 Change-Id: Ie081d6d3e6642c7d6f77b2a1f3eb9a3d82c9f69c Signed-off-by: wangshuo18 <wangshuo18@lenovo.com> Reviewed-on: https://gerrit.mot.com/1985991 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenxin Xi <xizx@motorola.com> Reviewed-by: Long Cheng <chengl1@motorola.com> Reviewed-by: Zhuoran Xu <xuzr3@motorola.com> Reviewed-by: Bolei Shang <shangbl1@lenovo.com> Reviewed-by: Shuo Wang <wangsh18@motorola.com> Reviewed-by: Yongqin Wan <wanyq1@motorola.com> Reviewed-by: Zhilong Wang <wangzl30@motorola.com> Reviewed-by: Quanlin Zhu <zhuql3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
70cfea590d
commit
216643ab56
1 changed files with 10 additions and 0 deletions
|
|
@ -27,6 +27,8 @@
|
|||
#include "mot_actuator_policy.h"
|
||||
#include "cam_sensor_io.h"
|
||||
#include "cam_req_mgr_dev.h"
|
||||
#include "linux/pm_wakeup.h"
|
||||
|
||||
/*=================ACTUATOR HW INFO====================*/
|
||||
#define DEVICE_NAME_LEN 32
|
||||
#define MAX_ACTUATOR_NUM 3
|
||||
|
|
@ -314,6 +316,7 @@ struct mot_actuator_ctrl_t {
|
|||
struct workqueue_struct *mot_actuator_wq;
|
||||
struct delayed_work delay_work;
|
||||
struct mutex actuator_lock;
|
||||
struct wakeup_source actuator_wakelock;
|
||||
};
|
||||
|
||||
enum mot_actuator_state_e {
|
||||
|
|
@ -686,6 +689,7 @@ int mot_actuator_on_vibrate_start(void)
|
|||
bool is_exiting = false;
|
||||
ktime_t start,end,duration;
|
||||
start = ktime_get();
|
||||
__pm_stay_awake(&mot_actuator_fctrl.actuator_wakelock);
|
||||
cancel_delayed_work(&mot_actuator_fctrl.delay_work);
|
||||
if (mutex_is_locked(&mot_actuator_fctrl.actuator_lock)) {
|
||||
is_exiting = true;
|
||||
|
|
@ -907,6 +911,7 @@ static void mot_actuator_delayed_process(struct work_struct *work)
|
|||
}
|
||||
mot_actuator_state = MOT_ACTUATOR_RELEASED;
|
||||
mutex_unlock(&actuator_fctrl->actuator_lock);
|
||||
__pm_relax(&actuator_fctrl->actuator_wakelock);
|
||||
}
|
||||
|
||||
static inline ssize_t msm_actuator_show(struct device *dev,
|
||||
|
|
@ -1097,6 +1102,9 @@ static int mot_actuator_init_subdev(struct mot_actuator_ctrl_t *f_ctrl)
|
|||
|
||||
INIT_DELAYED_WORK(&f_ctrl->delay_work, mot_actuator_delayed_process);
|
||||
mutex_init(&f_ctrl->actuator_lock);
|
||||
memset(&f_ctrl->actuator_wakelock, 0, sizeof(f_ctrl->actuator_wakelock));
|
||||
f_ctrl->actuator_wakelock.name = "actuator_hold_wl";
|
||||
wakeup_source_add(&f_ctrl->actuator_wakelock);
|
||||
|
||||
{//Debug/tuning interfaces
|
||||
int i;
|
||||
|
|
@ -1133,6 +1141,8 @@ void mot_actuator_driver_exit(void)
|
|||
mot_actuator_fctrl.mot_actuator_wq = NULL;
|
||||
}
|
||||
cam_unregister_subdev(&mot_actuator_fctrl.v4l2_dev_str);
|
||||
__pm_relax(&mot_actuator_fctrl.actuator_wakelock);
|
||||
wakeup_source_remove(&mot_actuator_fctrl.actuator_wakelock);
|
||||
}
|
||||
|
||||
MODULE_DESCRIPTION("MOT ACTUATOR");
|
||||
|
|
|
|||
Loading…
Reference in a new issue