msm: camera: sensor: Duplicate sensor changes
Add support to skip HW operations (power/CCI) for sensor nodes with "hw-no-ops" property. These nodes are dummy entries since CSID reads data from a different sensor. CRs-Fixed: 3150840 Change-Id: I6ceb3f9d2ea4f16abb9d5d2a6b89d5cb1d95c614 Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com> (cherry picked from commit 3deec40a9a58296f6f43d3cfe15b092e5a16c28b)
This commit is contained in:
@@ -996,6 +996,9 @@ int cam_sensor_match_id(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s_ctrl->hw_no_ops)
|
||||
return rc;
|
||||
|
||||
rc = camera_io_dev_read(
|
||||
&(s_ctrl->io_master_info),
|
||||
slave_info->sensor_id_reg_addr,
|
||||
@@ -1517,9 +1520,10 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl,
|
||||
}
|
||||
|
||||
if (s_ctrl->i2c_data.read_settings.is_settings_valid) {
|
||||
rc = cam_sensor_i2c_read_data(
|
||||
&s_ctrl->i2c_data.read_settings,
|
||||
&s_ctrl->io_master_info);
|
||||
if (!s_ctrl->hw_no_ops)
|
||||
rc = cam_sensor_i2c_read_data(
|
||||
&s_ctrl->i2c_data.read_settings,
|
||||
&s_ctrl->io_master_info);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_SENSOR, "%s: cannot read data: %d",
|
||||
s_ctrl->sensor_name, rc);
|
||||
@@ -1642,7 +1646,7 @@ int cam_sensor_power(struct v4l2_subdev *sd, int on)
|
||||
|
||||
int cam_sensor_power_up(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0;
|
||||
struct cam_sensor_power_ctrl_t *power_info;
|
||||
struct cam_camera_slave_info *slave_info;
|
||||
struct cam_hw_soc_info *soc_info = &s_ctrl->soc_info;
|
||||
@@ -1653,6 +1657,9 @@ int cam_sensor_power_up(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s_ctrl->hw_no_ops)
|
||||
return rc;
|
||||
|
||||
power_info = &s_ctrl->sensordata->power_info;
|
||||
slave_info = &(s_ctrl->sensordata->slave_info);
|
||||
|
||||
@@ -1717,6 +1724,9 @@ int cam_sensor_power_down(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s_ctrl->hw_no_ops)
|
||||
return rc;
|
||||
|
||||
power_info = &s_ctrl->sensordata->power_info;
|
||||
soc_info = &s_ctrl->soc_info;
|
||||
|
||||
@@ -1807,9 +1817,10 @@ int cam_sensor_apply_settings(struct cam_sensor_ctrl_t *s_ctrl,
|
||||
if (i2c_set->is_settings_valid == 1) {
|
||||
list_for_each_entry(i2c_list,
|
||||
&(i2c_set->list_head), list) {
|
||||
rc = cam_sensor_i2c_modes_util(
|
||||
&(s_ctrl->io_master_info),
|
||||
i2c_list);
|
||||
if (!s_ctrl->hw_no_ops)
|
||||
rc = cam_sensor_i2c_modes_util(
|
||||
&(s_ctrl->io_master_info),
|
||||
i2c_list);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_SENSOR,
|
||||
"Failed to apply settings: %d",
|
||||
@@ -1839,9 +1850,10 @@ int cam_sensor_apply_settings(struct cam_sensor_ctrl_t *s_ctrl,
|
||||
i2c_set[offset].request_id == req_id) {
|
||||
list_for_each_entry(i2c_list,
|
||||
&(i2c_set[offset].list_head), list) {
|
||||
rc = cam_sensor_i2c_modes_util(
|
||||
&(s_ctrl->io_master_info),
|
||||
i2c_list);
|
||||
if (!s_ctrl->hw_no_ops)
|
||||
rc = cam_sensor_i2c_modes_util(
|
||||
&(s_ctrl->io_master_info),
|
||||
i2c_list);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_SENSOR,
|
||||
"Failed to apply settings: %d",
|
||||
|
@@ -115,6 +115,7 @@ struct cam_sensor_dev_res_info {
|
||||
* @is_stopped_by_user: Indicate if sensor has been stopped by userland
|
||||
* @stream_off_after_eof: Indicates if sensor needs to stream off after eof
|
||||
* @is_res_info_updated: Indicate if resolution info is updated
|
||||
* @hw_no_ops: To determine whether HW operations need to be disabled
|
||||
*/
|
||||
struct cam_sensor_ctrl_t {
|
||||
char device_name[CAM_CTX_DEV_NAME_MAX_LENGTH];
|
||||
@@ -152,6 +153,7 @@ struct cam_sensor_ctrl_t {
|
||||
bool is_stopped_by_user;
|
||||
bool stream_off_after_eof;
|
||||
bool is_res_info_updated;
|
||||
bool hw_no_ops;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -284,6 +284,11 @@ static int32_t cam_sensor_driver_get_dt_data(struct cam_sensor_ctrl_t *s_ctrl)
|
||||
goto FREE_SENSOR_DATA;
|
||||
}
|
||||
|
||||
if (!of_property_read_bool(of_node, "hw-no-ops"))
|
||||
s_ctrl->hw_no_ops = false;
|
||||
else
|
||||
s_ctrl->hw_no_ops = true;
|
||||
|
||||
return rc;
|
||||
|
||||
FREE_SENSOR_DATA:
|
||||
|
Reference in New Issue
Block a user