Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 551661bf authored by Karthik Anantha Ram's avatar Karthik Anantha Ram
Browse files

msm: camera: cci: Modify condition check to read CCI data



If the buffer level is zero, we continue to wait for the
next irq and not proceed to read the data registers as part
of cci read sequence.

Change-Id: I60a9a2388789a17e5ff01742b7e8928a71cbe421
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent 92e25747
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ static int32_t cam_cci_burst_read(struct v4l2_subdev *sd,
		read_words = cam_io_r_mb(base +
			CCI_I2C_M0_READ_BUF_LEVEL_ADDR + master * 0x100);
		total_read_words += read_words;
		do {
		while (read_words > 0) {
			val = cam_io_r_mb(base +
				CCI_I2C_M0_READ_DATA_ADDR + master * 0x100);
			for (i = 0; (i < 4) &&
@@ -1032,7 +1032,8 @@ static int32_t cam_cci_burst_read(struct v4l2_subdev *sd,
					index++;
				}
			}
		} while (--read_words > 0);
			read_words--;
		}
	}

rel_mutex:
@@ -1200,7 +1201,7 @@ static int32_t cam_cci_read(struct v4l2_subdev *sd,
	index = 0;
	CAM_DBG(CAM_CCI, "index %d num_type %d", index, read_cfg->num_byte);
	first_byte = 0;
	do {
	while (read_words > 0) {
		val = cam_io_r_mb(base +
			CCI_I2C_M0_READ_DATA_ADDR + master * 0x100);
		CAM_DBG(CAM_CCI, "read val 0x%x", val);
@@ -1217,7 +1218,8 @@ static int32_t cam_cci_read(struct v4l2_subdev *sd,
				index++;
			}
		}
	} while (--read_words > 0);
		read_words--;
	}
rel_mutex:
	mutex_unlock(&cci_dev->cci_master_info[master].mutex_q[queue]);