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

Commit de796cee authored by Depeng Shao's avatar Depeng Shao
Browse files

msm: camera: sensor: Fix power related issues



Put the regulator while powering down sensor, it
will be got again while powering up sensor. And,
configure the gpios to correct value, rather than
always power on the gpios.

Change-Id: I2bc1a3820bf0c1d8e09a609813bd2e3da825f41c
Signed-off-by: default avatarDepeng Shao <depengs@codeaurora.org>
parent 1fc99d9c
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -1349,7 +1349,8 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,

			rc = msm_cam_sensor_handle_reg_gpio(
				power_setting->seq_type,
				gpio_num_info, 1);
				gpio_num_info,
				(int) power_setting->config_val);
			if (rc < 0) {
				CAM_ERR(CAM_SENSOR,
					"Error in handling VREG GPIO");
@@ -1476,6 +1477,9 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
				power_setting->data[0] =
						soc_info->rgltr[vreg_idx];

				regulator_put(
					soc_info->rgltr[vreg_idx]);
				soc_info->rgltr[vreg_idx] = NULL;
			}
			else
				CAM_ERR(CAM_SENSOR, "seq_val:%d > num_vreg: %d",
@@ -1577,6 +1581,10 @@ static int cam_config_mclk_reg(struct cam_sensor_power_ctrl_t *ctrl,

				ps->data[0] =
					soc_info->rgltr[j];

				regulator_put(
					soc_info->rgltr[j]);
				soc_info->rgltr[j] = NULL;
			}
		}
	}
@@ -1667,6 +1675,10 @@ int msm_camera_power_down(struct cam_sensor_power_ctrl_t *ctrl,

					ps->data[0] =
						soc_info->rgltr[ps->seq_val];

					regulator_put(
						soc_info->rgltr[ps->seq_val]);
					soc_info->rgltr[ps->seq_val] = NULL;
				}
				else
					CAM_ERR(CAM_SENSOR,