msm: camera: sensor: Power down in case of cci init failure
Currently power down is not happening in case of cci_init failure. This can lead to corruption for the next power up, as power down did not happen for the previous session. This change does power down in case of cci failure and as a part of that it can power up resources correctly in next session. CRs-Fixed: 2797857 Change-Id: I9089222cb45834ae895903a4a3e21dd799beb3ed Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Цей коміт міститься в:
@@ -106,8 +106,15 @@ static int32_t cam_actuator_power_up(struct cam_actuator_ctrl_t *a_ctrl)
|
||||
}
|
||||
|
||||
rc = camera_io_init(&a_ctrl->io_master_info);
|
||||
if (rc < 0)
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_ACTUATOR, "cci init failed: rc: %d", rc);
|
||||
goto cci_failure;
|
||||
}
|
||||
|
||||
return rc;
|
||||
cci_failure:
|
||||
if (cam_sensor_util_power_down(power_info, soc_info))
|
||||
CAM_ERR(CAM_ACTUATOR, "Power down failure");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@@ -185,10 +185,15 @@ static int cam_eeprom_power_up(struct cam_eeprom_ctrl_t *e_ctrl,
|
||||
rc = camera_io_init(&(e_ctrl->io_master_info));
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_EEPROM, "cci_init failed");
|
||||
return -EINVAL;
|
||||
goto cci_failure;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
cci_failure:
|
||||
if (cam_sensor_util_power_down(power_info, soc_info))
|
||||
CAM_ERR(CAM_EEPROM, "Power down failure");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -153,8 +153,15 @@ static int cam_ois_power_up(struct cam_ois_ctrl_t *o_ctrl)
|
||||
}
|
||||
|
||||
rc = camera_io_init(&o_ctrl->io_master_info);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_OIS, "cci_init failed: rc: %d", rc);
|
||||
goto cci_failure;
|
||||
}
|
||||
|
||||
return rc;
|
||||
cci_failure:
|
||||
if (cam_sensor_util_power_down(power_info, soc_info))
|
||||
CAM_ERR(CAM_OIS, "Power Down failed");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@@ -462,8 +462,8 @@ int cam_res_mgr_gpio_request(struct device *dev, uint gpio,
|
||||
CAM_DBG(CAM_RES, "gpio: %u not found in gpio_res list", gpio);
|
||||
rc = gpio_request_one(gpio, flags, label);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_RES, "gpio %d:%s request fails",
|
||||
gpio, label);
|
||||
CAM_ERR(CAM_RES, "gpio %d:%s request fails rc = %d",
|
||||
gpio, label, rc);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@@ -1197,10 +1197,18 @@ int cam_sensor_power_up(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
}
|
||||
|
||||
rc = camera_io_init(&(s_ctrl->io_master_info));
|
||||
if (rc < 0)
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_SENSOR, "cci_init failed: rc: %d", rc);
|
||||
goto cci_failure;
|
||||
}
|
||||
|
||||
return rc;
|
||||
cci_failure:
|
||||
if (cam_sensor_util_power_down(power_info, soc_info))
|
||||
CAM_ERR(CAM_SENSOR, "power down failure");
|
||||
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
int cam_sensor_power_down(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
|
Посилання в новій задачі
Заблокувати користувача