diff options
| author | Vijay kumar Tumati <vtumati@codeaurora.org> | 2018-02-08 15:08:11 +0530 |
|---|---|---|
| committer | Vijay kumar Tumati <vtumati@codeaurora.org> | 2018-02-09 12:30:59 +0530 |
| commit | 2fe9f37f2ed69bb06ccf3e83248917c77c348924 (patch) | |
| tree | d3855388df1eeb7805433a4eb883d2983c6834d7 | |
| parent | 6b83a15ee11921e51663980cdd8bfb714366d5cb (diff) | |
msm: camera: Handle actuator close before power down
In case when userspace process is killed, actuator
subdev is first closed and then power down is called.
In this sequence, we need to handle actuator states
properly to shutdown all the regulators during close.
Change-Id: I843b463a1b576971e16d1554ded20984dd0ec436
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c index 827f77c4fe23..4142903a5af5 100644 --- a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c +++ b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1571,6 +1571,13 @@ static int msm_actuator_close(struct v4l2_subdev *sd, } kfree(a_ctrl->i2c_reg_tbl); a_ctrl->i2c_reg_tbl = NULL; + if (a_ctrl->actuator_state == ACT_OPS_ACTIVE) { + rc = msm_actuator_power_down(a_ctrl); + if (rc < 0) { + pr_err("%s:%d Actuator Power down failed\n", + __func__, __LINE__); + } + } a_ctrl->actuator_state = ACT_DISABLE_STATE; mutex_unlock(a_ctrl->actuator_mutex); CDBG("Exit\n"); |
