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

Commit 23b26c22 authored by Kyong Hwa Bae's avatar Kyong Hwa Bae
Browse files

msm: camera: sensor: Update actuator power up state



When power up the actuator, set the current actuator
state as power up. So when the time of power down,
actuator can be actually turned off.
Delete vcm_enable, pwd that is not referred any more.

Change-Id: Ifa1d4dd6a8833d662683e82986877d687bdfa09b
Signed-off-by: default avatarKyong Hwa Bae <kbae@codeaurora.org>
parent aa5e73a6
Loading
Loading
Loading
Loading
+1 −16
Original line number Diff line number Diff line
@@ -526,11 +526,6 @@ static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl)
				pr_err("%s:%d Lens park failed.\n",
					__func__, __LINE__);
		}
		if (a_ctrl->vcm_enable) {
			rc = gpio_direction_output(a_ctrl->vcm_pwd, 0);
			if (!rc)
				gpio_free(a_ctrl->vcm_pwd);
		}

		rc = msm_actuator_vreg_control(a_ctrl, 0);
		if (rc < 0) {
@@ -716,7 +711,6 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl,

	a_ctrl->curr_step_pos = 0;
	a_ctrl->curr_region_index = 0;
	a_ctrl->actuator_state = ACTUATOR_POWER_UP;
	CDBG("Exit\n");

	return rc;
@@ -1024,22 +1018,13 @@ static int32_t msm_actuator_power_up(struct msm_actuator_ctrl_t *a_ctrl)
	int rc = 0;
	CDBG("%s called\n", __func__);

	CDBG("vcm info: %d %d\n", a_ctrl->vcm_pwd,
		a_ctrl->vcm_enable);

	rc = msm_actuator_vreg_control(a_ctrl, 1);
	if (rc < 0) {
		pr_err("%s failed %d\n", __func__, __LINE__);
		return rc;
	}

	if (a_ctrl->vcm_enable) {
		rc = gpio_request(a_ctrl->vcm_pwd, "msm_actuator");
		if (!rc) {
			CDBG("Enable VCM PWD\n");
			gpio_direction_output(a_ctrl->vcm_pwd, 1);
		}
	}
	a_ctrl->actuator_state = ACTUATOR_POWER_UP;

	CDBG("Exit\n");
	return rc;
+0 −2
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ struct msm_actuator_ctrl_t {
	struct msm_actuator_reg_params_t reg_tbl[MAX_ACTUATOR_REG_TBL_SIZE];
	uint16_t region_size;
	void *user_data;
	uint32_t vcm_pwd;
	uint32_t vcm_enable;
	uint32_t total_steps;
	uint16_t pwd_step;
	uint16_t initial_code;