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

Commit d6489c91 authored by Alok Pandey's avatar Alok Pandey Committed by Karthik Anantha Ram
Browse files

msm: camera: icp: Avoid accessing unclocked registers



If icp-pc is set, it may access register after clock
is disabled. This change avoid any such access.

Change-Id: I6cb56059e3ba5c7bf809ad544c50b2e89288e271
Signed-off-by: default avatarAlok Pandey <akumarpa@codeaurora.org>
parent c8e96269
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -536,6 +536,11 @@ void cam_hfi_disable_cpu(void __iomem *icp_base)

	val = cam_io_r(icp_base + HFI_REG_A5_CSR_NSEC_RESET);
	cam_io_w_mb(val, icp_base + HFI_REG_A5_CSR_NSEC_RESET);

	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_RESET,
		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);
	cam_io_w_mb((uint32_t)INTR_DISABLE,
		g_hfi->csr_base + HFI_REG_A5_CSR_A2HOSTINTEN);
}

void cam_hfi_enable_cpu(void __iomem *icp_base)
@@ -886,11 +891,6 @@ void cam_hfi_deinit(void __iomem *icp_base)
	g_hfi->cmd_q_state = false;
	g_hfi->msg_q_state = false;

	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_RESET,
		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);

	cam_io_w_mb((uint32_t)INTR_DISABLE,
		g_hfi->csr_base + HFI_REG_A5_CSR_A2HOSTINTEN);
	kzfree(g_hfi);
	g_hfi = NULL;