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

Commit 5e835c1d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ais: cci: Wait for RESET_ACK when a NACK is received"

parents fd968a92 b8d89b5d
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1511,7 +1511,17 @@ static int32_t cam_cci_read(struct v4l2_subdev *sd,
		cam_cci_flush_queue(cci_dev, master);
		goto rel_mutex_q;
	} else {
		rc = 0;
		//If rd_done is complete with NACK wait until RESET_ACK
		//is received.
		if (cci_dev->cci_master_info[master].status == -EINVAL) {
			rc = wait_for_completion_timeout(
			&cci_dev->cci_master_info[master].reset_complete,
			CCI_TIMEOUT);
		}
		if (rc <= 0) {
			CAM_ERR(CAM_CCI,
				"wait_for_completion_timeout rc = %d, rc");
		}
	}

	read_words = cam_io_r_mb(base +
@@ -1857,6 +1867,7 @@ static int32_t cam_cci_read_bytes(struct v4l2_subdev *sd,
	 * we load the burst read cmd.
	 */
	reinit_completion(&cci_dev->cci_master_info[master].th_complete);
	reinit_completion(&cci_dev->cci_master_info[master].reset_complete);

	CAM_DBG(CAM_CCI, "Bytes to read %u", read_bytes);
	do {
+5 −3
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -81,7 +81,8 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
			cci_master_info = &cci_dev->cci_master_info[MASTER_0];
			cci_dev->cci_master_info[MASTER_0].reset_pending =
				FALSE;
			if (!cci_master_info->status)
			if (!cci_master_info->status ||
					cci_master_info->status == -EINVAL)
				complete(&cci_master_info->reset_complete);
			cci_master_info->status = 0;
		}
@@ -89,7 +90,8 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
			cci_master_info = &cci_dev->cci_master_info[MASTER_1];
			cci_dev->cci_master_info[MASTER_1].reset_pending =
				FALSE;
			if (!cci_master_info->status)
			if (!cci_master_info->status ||
					cci_master_info->status == -EINVAL)
				complete(&cci_master_info->reset_complete);
			cci_master_info->status = 0;
		}