Merge "msm: camera: sensor: Power down in case of cci init failure" into camera-kernel.lnx.4.0

This commit is contained in:
Camera Software Integration 2020-10-20 13:24:55 -07:00 • committed by Gerrit - the friendly Code Review server
commit a3af5ac2a3
5 changed files with 33 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;
}
/**

View file

@ -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;
}

View file

@ -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;
}
}

View file

@ -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)