Эх сурвалжийг харах

msm: camera: sensor: Correct condition check for BURST/SEQ write

Sensor IO framework decides based on slave write request to perform
desire opertion at CCI hw. Currently this framework uses wrong
condition to pass on the correct information to CCI hw. This change
fixes this condition to pass on the correct operation to perform
at CCI hw. Also update hard code value to appropriate enums to align
the opertion with slaves.

CRs-Fixed: 2913072
Change-Id: I3067314e6bccb513f343e3bcbc3f1b72355f2291
Signed-off-by: Jigarkumar Zala <[email protected]>
Jigarkumar Zala 4 жил өмнө
parent
commit
7263fb5529

+ 2 - 2
drivers/cam_sensor_module/cam_actuator/cam_actuator_core.c

@@ -171,7 +171,7 @@ static int32_t cam_actuator_i2c_modes_util(
 		rc = camera_io_dev_write_continuous(
 			io_master_info,
 			&(i2c_list->i2c_settings),
-			0);
+			CAM_SENSOR_I2C_WRITE_SEQ);
 		if (rc < 0) {
 			CAM_ERR(CAM_ACTUATOR,
 				"Failed to seq write I2C settings: %d",
@@ -182,7 +182,7 @@ static int32_t cam_actuator_i2c_modes_util(
 		rc = camera_io_dev_write_continuous(
 			io_master_info,
 			&(i2c_list->i2c_settings),
-			1);
+			CAM_SENSOR_I2C_WRITE_BURST);
 		if (rc < 0) {
 			CAM_ERR(CAM_ACTUATOR,
 				"Failed to burst write I2C settings: %d",

+ 2 - 2
drivers/cam_sensor_module/cam_eeprom/cam_eeprom_core.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -1164,7 +1164,7 @@ static int32_t cam_eeprom_write(struct cam_eeprom_ctrl_t *e_ctrl)
 			&(i2c_set->list_head), list) {
 			rc = camera_io_dev_write_continuous(
 				&e_ctrl->io_master_info,
-				&i2c_list->i2c_settings, 1);
+				&i2c_list->i2c_settings, CAM_SENSOR_I2C_WRITE_BURST);
 		if (rc < 0) {
 			CAM_ERR(CAM_EEPROM,
 				"Error in EEPROM write");

+ 4 - 4
drivers/cam_sensor_module/cam_ois/cam_ois_core.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -280,7 +280,7 @@ static int cam_ois_apply_settings(struct cam_ois_ctrl_t *o_ctrl,
 			rc = camera_io_dev_write_continuous(
 				&(o_ctrl->io_master_info),
 				&(i2c_list->i2c_settings),
-				0);
+				CAM_SENSOR_I2C_WRITE_SEQ);
 			if (rc < 0) {
 				CAM_ERR(CAM_OIS,
 					"Failed to seq write I2C settings: %d",
@@ -413,7 +413,7 @@ static int cam_ois_fw_download(struct cam_ois_ctrl_t *o_ctrl)
 	}
 
 	rc = camera_io_dev_write_continuous(&(o_ctrl->io_master_info),
-		&i2c_reg_setting, 1);
+		&i2c_reg_setting, CAM_SENSOR_I2C_WRITE_BURST);
 	if (rc < 0) {
 		CAM_ERR(CAM_OIS, "OIS FW(prog) size(%d) download failed. %d",
 			total_bytes, rc);
@@ -459,7 +459,7 @@ static int cam_ois_fw_download(struct cam_ois_ctrl_t *o_ctrl)
 	}
 
 	rc = camera_io_dev_write_continuous(&(o_ctrl->io_master_info),
-		&i2c_reg_setting, 1);
+		&i2c_reg_setting, CAM_SENSOR_I2C_WRITE_BURST);
 
 	if (rc < 0)
 		CAM_ERR(CAM_OIS, "OIS FW(coeff) size(%d) download failed rc: %d",

+ 2 - 2
drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c

@@ -360,7 +360,7 @@ static int32_t cam_sensor_i2c_modes_util(
 		rc = camera_io_dev_write_continuous(
 			io_master_info,
 			&(i2c_list->i2c_settings),
-			0);
+			CAM_SENSOR_I2C_WRITE_SEQ);
 		if (rc < 0) {
 			CAM_ERR(CAM_SENSOR,
 				"Failed to seq write I2C settings: %d",
@@ -371,7 +371,7 @@ static int32_t cam_sensor_i2c_modes_util(
 		rc = camera_io_dev_write_continuous(
 			io_master_info,
 			&(i2c_list->i2c_settings),
-			1);
+			CAM_SENSOR_I2C_WRITE_BURST);
 		if (rc < 0) {
 			CAM_ERR(CAM_SENSOR,
 				"Failed to burst write I2C settings: %d",

+ 3 - 3
drivers/cam_sensor_module/cam_sensor_io/cam_sensor_cci_i2c.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, 2021 The Linux Foundation. All rights reserved.
  */
 
 #include "cam_sensor_cmn_header.h"
@@ -149,10 +149,10 @@ int32_t cam_cci_i2c_write_continuous_table(
 {
 	int32_t rc = 0;
 
-	if (cam_sensor_i2c_write_flag == 1)
+	if (cam_sensor_i2c_write_flag == CAM_SENSOR_I2C_WRITE_BURST)
 		rc = cam_cci_i2c_write_table_cmd(client, write_setting,
 			MSM_CCI_I2C_WRITE_BURST);
-	else if (cam_sensor_i2c_write_flag == 0)
+	else if (cam_sensor_i2c_write_flag == CAM_SENSOR_I2C_WRITE_SEQ)
 		rc = cam_cci_i2c_write_table_cmd(client, write_setting,
 			MSM_CCI_I2C_WRITE_SEQ);
 

+ 2 - 2
drivers/cam_sensor_module/cam_sensor_utils/cam_sensor_util.c

@@ -830,7 +830,7 @@ int cam_sensor_util_i2c_apply_setting(
 	}
 	case CAM_SENSOR_I2C_WRITE_SEQ: {
 		rc = camera_io_dev_write_continuous(
-			io_master_info, &(i2c_list->i2c_settings), 0);
+			io_master_info, &(i2c_list->i2c_settings), CAM_SENSOR_I2C_WRITE_SEQ);
 		if (rc < 0) {
 			CAM_ERR(CAM_SENSOR,
 				"Failed to seq write I2C settings: %d",
@@ -841,7 +841,7 @@ int cam_sensor_util_i2c_apply_setting(
 	}
 	case CAM_SENSOR_I2C_WRITE_BURST: {
 		rc = camera_io_dev_write_continuous(
-			io_master_info, &(i2c_list->i2c_settings), 1);
+			io_master_info, &(i2c_list->i2c_settings), CAM_SENSOR_I2C_WRITE_BURST);
 		if (rc < 0) {
 			CAM_ERR(CAM_SENSOR,
 				"Failed to burst write I2C settings: %d",