Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3c1bed1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: sensor: reduce park lens time"

parents a354466c ee7d81f0
Loading
Loading
Loading
Loading
+26 −2
Original line number Diff line number Diff line
@@ -22,6 +22,10 @@ DEFINE_MSM_MUTEX(msm_actuator_mutex);
#undef CDBG
#define CDBG(fmt, args...) pr_debug(fmt, ##args)

#define PARK_LENS_LONG_STEP 7
#define PARK_LENS_MID_STEP 5
#define PARK_LENS_SMALL_STEP 3

static struct v4l2_file_operations msm_actuator_v4l2_subdev_fops;
static int32_t msm_actuator_power_up(struct msm_actuator_ctrl_t *a_ctrl);
static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl);
@@ -387,8 +391,28 @@ static int32_t msm_actuator_park_lens(struct msm_actuator_ctrl_t *a_ctrl)

	next_lens_pos = a_ctrl->step_position_table[a_ctrl->curr_step_pos];
	while (next_lens_pos) {
		next_lens_pos = (next_lens_pos > a_ctrl->park_lens.max_step) ?
			(next_lens_pos - a_ctrl->park_lens.max_step) : 0;
		/* conditions which help to reduce park lens time */
		if (next_lens_pos > (a_ctrl->park_lens.max_step *
			PARK_LENS_LONG_STEP)) {
			next_lens_pos = next_lens_pos -
				(a_ctrl->park_lens.max_step *
				PARK_LENS_LONG_STEP);
		} else if (next_lens_pos > (a_ctrl->park_lens.max_step *
			PARK_LENS_MID_STEP)) {
			next_lens_pos = next_lens_pos -
				(a_ctrl->park_lens.max_step *
				PARK_LENS_MID_STEP);
		} else if (next_lens_pos > (a_ctrl->park_lens.max_step *
			PARK_LENS_SMALL_STEP)) {
			next_lens_pos = next_lens_pos -
				(a_ctrl->park_lens.max_step *
				PARK_LENS_SMALL_STEP);
		} else {
			next_lens_pos = (next_lens_pos >
				a_ctrl->park_lens.max_step) ?
				(next_lens_pos - a_ctrl->park_lens.
				max_step) : 0;
		}
		a_ctrl->func_tbl->actuator_parse_i2c_params(a_ctrl,
			next_lens_pos, a_ctrl->park_lens.hw_params,
			a_ctrl->park_lens.damping_delay);