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

msm: camera: actuator: Add the timestamp in different io config

This change add the timestamp in different io config when read
actuator packet. In order to ensure the accuracy of the time dimension
of the data, the timestamp of the Kernel is returned synchronously when
read HALL data.

CRs-Fixed: 3244812
Change-Id: I2ddb9450108e2b0f47769c7b02078903c4f3812b
Signed-off-by: Wang Kan <[email protected]>
Wang Kan 2 жил өмнө
parent
commit
b4b329c260

+ 19 - 0
drivers/cam_sensor_module/cam_actuator/cam_actuator_core.c

@@ -704,6 +704,7 @@ int32_t cam_actuator_i2c_pkt_parse(struct cam_actuator_ctrl_t *a_ctrl,
 		}
 		break;
 	case CAM_ACTUATOR_PACKET_OPCODE_READ: {
+		uint64_t qtime_ns;
 		struct cam_buf_io_cfg *io_cfg;
 		struct i2c_settings_array i2c_read_settings;
 
@@ -757,6 +758,24 @@ int32_t cam_actuator_i2c_pkt_parse(struct cam_actuator_ctrl_t *a_ctrl,
 			goto end;
 		}
 
+		if (csl_packet->num_io_configs > 1) {
+			rc = cam_sensor_util_get_current_qtimer_ns(&qtime_ns);
+			if (rc < 0) {
+				CAM_ERR(CAM_SENSOR, "failed to get qtimer rc:%d");
+				delete_request(&i2c_read_settings);
+				return rc;
+			}
+
+			rc = cam_sensor_util_write_qtimer_to_io_buffer(
+				qtime_ns, &io_cfg[1]);
+			if (rc < 0) {
+				CAM_ERR(CAM_ACTUATOR,
+					"write qtimer failed rc: %d", rc);
+				delete_request(&i2c_read_settings);
+				return rc;
+			}
+		}
+
 		rc = delete_request(&i2c_read_settings);
 		if (rc < 0) {
 			CAM_ERR(CAM_ACTUATOR,

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

@@ -146,7 +146,7 @@ int32_t cam_sensor_util_get_current_qtimer_ns(uint64_t *qtime_ns)
 	if (qtime_ns != NULL) {
 		*qtime_ns = mul_u64_u32_div(ticks,
 			QTIMER_MUL_FACTOR, QTIMER_DIV_FACTOR);
-		CAM_DBG(CAM_SENSOR, "Qtimer time: 0x%x", *qtime_ns);
+		CAM_DBG(CAM_SENSOR, "Qtimer time: 0x%lx", *qtime_ns);
 	} else {
 		CAM_ERR(CAM_SENSOR, "NULL pointer passed");
 		return -EINVAL;