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

Commit 36f62a6c authored by Venu Raidu's avatar Venu Raidu Committed by vraidu
Browse files

msm: camera_v2: Reset CPP AXI at camera close



CPP AXI need to be reset during camera close,
to overcome stale data.

Change-Id: I4af43bbf67a84eaa5fc2a722854117a5936ab896
Signed-off-by: default avatarVenu Raidu <vraidu@codeaurora.org>
parent 5598d766
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1486,6 +1486,8 @@ static int cpp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
	uint32_t i;
	int rc = -1;
	int counter = 0;
	u32 result = 0;
	struct cpp_device *cpp_dev = NULL;
	struct msm_device_queue *processing_q = NULL;
	struct msm_device_queue *eventData_q = NULL;
@@ -1566,6 +1568,26 @@ static int cpp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
			msm_camera_io_r(cpp_dev->cpp_hw_base + 0x88));
		pr_debug("DEBUG_R1: 0x%x\n",
			msm_camera_io_r(cpp_dev->cpp_hw_base + 0x8C));
		/* mask IRQ status */
		msm_camera_io_w(0xB, cpp_dev->cpp_hw_base + 0xC);

		while (counter < MSM_CPP_AXI_RESET_RETRIES) {
			/* MMSS_A_CPP_AXI_CMD = 0x16C, reset 0x1*/
			msm_camera_io_w(0x1, cpp_dev->cpp_hw_base + 0x16C);
			usleep_range(100, 200);
			result = msm_camera_io_r(cpp_dev->cpp_hw_base + 0x16C);
			if (result & 0x1) {
				pr_debug("CPP AXI reset successful result %d",
					 result);
				break;
			}
			counter++;
		}

		if (!(result & 0x1))
			pr_err("CPP AXI reset un-successful result %d",
				 result);

		msm_camera_io_w(0x0, cpp_dev->base + MSM_CPP_MICRO_CLKEN_CTL);
		msm_cpp_clear_timer(cpp_dev);
		cpp_release_hardware(cpp_dev);
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@
#define MSM_CPP_START_ADDRESS		0x0
#define MSM_CPP_END_ADDRESS			0x3F00

#define MSM_CPP_AXI_RESET_RETRIES	5
#define MSM_CPP_POLL_RETRIES		200
#define MSM_CPP_TASKLETQ_SIZE		16
#define MSM_CPP_TX_FIFO_LEVEL		16