Browse Source

Merge "msm: camera: cci: Increase queue size for burst write mode" into camera-kernel.lnx.5.0

Savita Patted 4 years ago
parent
commit
7c5578eed1

+ 16 - 6
drivers/cam_sensor_module/cam_cci/cam_cci_core.c

@@ -427,9 +427,12 @@ static void cam_cci_process_half_q(struct cci_device *cci_dev,
 	void __iomem *base = soc_info->reg_map[0].mem_base;
 	uint32_t reg_val = 1 << ((master * 2) + queue);
 
+	CAM_DBG(CAM_CCI, "ENTER");
+
 	spin_lock_irqsave(&cci_dev->cci_master_info[master].lock_q[queue],
 		flags);
 	if (atomic_read(&cci_dev->cci_master_info[master].q_free[queue]) == 0) {
+		CAM_DBG(CAM_CCI, "queue: %d is free", queue);
 		cam_cci_load_report_cmd(cci_dev, master, queue);
 		atomic_set(&cci_dev->cci_master_info[master].q_free[queue], 1);
 		cam_io_w_mb(reg_val, base +
@@ -446,7 +449,7 @@ static int32_t cam_cci_process_full_q(struct cci_device *cci_dev,
 	int32_t rc = 0;
 	unsigned long flags;
 
-
+	CAM_DBG(CAM_CCI, "ENTER");
 	spin_lock_irqsave(&cci_dev->cci_master_info[master].lock_q[queue],
 		flags);
 	if (atomic_read(&cci_dev->cci_master_info[master].q_free[queue]) == 1) {
@@ -455,6 +458,7 @@ static int32_t cam_cci_process_full_q(struct cci_device *cci_dev,
 			1);
 		spin_unlock_irqrestore(
 			&cci_dev->cci_master_info[master].lock_q[queue], flags);
+		CAM_DBG(CAM_CCI, "Queue: %d is set to 1", queue);
 		rc = cam_cci_wait(cci_dev, master, queue);
 		if (rc < 0) {
 			CAM_ERR(CAM_CCI,
@@ -465,6 +469,7 @@ static int32_t cam_cci_process_full_q(struct cci_device *cci_dev,
 	} else {
 		spin_unlock_irqrestore(
 			&cci_dev->cci_master_info[master].lock_q[queue], flags);
+		CAM_DBG(CAM_CCI, "Queue: %d is set to 0", queue);
 		rc = cam_cci_wait_report_cmd(cci_dev, master, queue);
 		if (rc < 0) {
 			CAM_ERR(CAM_CCI,
@@ -474,6 +479,8 @@ static int32_t cam_cci_process_full_q(struct cci_device *cci_dev,
 		}
 	}
 
+	CAM_DBG(CAM_CCI, "EXIT");
+
 	return rc;
 }
 
@@ -751,10 +758,11 @@ static int32_t cam_cci_data_queue(struct cci_device *cci_dev,
 	max_queue_size =
 		cci_dev->cci_i2c_queue_info[master][queue].max_queue_size;
 
-	if (c_ctrl->cmd == MSM_CCI_I2C_WRITE_SEQ)
+	if ((c_ctrl->cmd == MSM_CCI_I2C_WRITE_SEQ) ||
+		(c_ctrl->cmd == MSM_CCI_I2C_WRITE_BURST))
 		queue_size = max_queue_size;
 	else
-		queue_size = max_queue_size/2;
+		queue_size = max_queue_size / 2;
 	reg_addr = i2c_cmd->reg_addr;
 
 	if (sync_en == MSM_SYNC_ENABLE && cci_dev->valid_sync &&
@@ -781,7 +789,7 @@ static int32_t cam_cci_data_queue(struct cci_device *cci_dev,
 			i2c_cmd, &pack);
 		if (len <= 0) {
 			CAM_ERR(CAM_CCI,
-				"Calculate comamnd len failed, len:%d", len);
+				"Calculate command len failed, len:%d", len);
 			return -EINVAL;
 		}
 
@@ -906,10 +914,12 @@ static int32_t cam_cci_data_queue(struct cci_device *cci_dev,
 				master * 0x200 + queue * 0x100);
 
 			read_val += 1;
-			cam_io_w_mb(read_val, base +
-				CCI_I2C_M0_Q0_EXEC_WORD_CNT_ADDR + reg_offset);
+
 		}
 
+		cam_io_w_mb(read_val, base +
+			CCI_I2C_M0_Q0_EXEC_WORD_CNT_ADDR + reg_offset);
+
 		if ((delay > 0) && (delay < CCI_MAX_DELAY) &&
 			en_seq_write == 0) {
 			cmd = (uint32_t)((delay * cci_dev->cycles_per_us) /

+ 2 - 2
drivers/cam_sensor_module/cam_cci/cam_cci_dev.c

@@ -73,8 +73,8 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
 
 	irq_status0 = cam_io_r_mb(base + CCI_IRQ_STATUS_0_ADDR);
 	irq_status1 = cam_io_r_mb(base + CCI_IRQ_STATUS_1_ADDR);
-	CAM_DBG(CAM_CCI,
-		"BASE: %pK, irq0:%x irq1:%x",
+	CAM_INFO(CAM_CCI,
+		"BASE: %p, irq0:%x irq1:%x",
 		base, irq_status0, irq_status1);
 
 	if (irq_status0 & CCI_IRQ_STATUS_0_RST_DONE_ACK_BMSK) {