From 422de0bbf49c799fc85bb1744b30897708309c74 Mon Sep 17 00:00:00 2001 From: Venkat Chinta Date: Thu, 10 Oct 2019 11:31:03 -0700 Subject: [PATCH] msm: camera: ife: Deinit input mux resources We must deinit IFE input mux resources before the check for open count. Without this change the last bus resource is the last to enter this function when open count reaches zero. So input mux resources are never deinitialized. CRs-Fixed: 2545140 Change-Id: I355afce7d631cdb00e3f6da0ba0be40c2e2b63a2 Signed-off-by: Venkat Chinta --- .../isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c index 0244e41d5a034..11d6a602117c9 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c @@ -251,6 +251,13 @@ int cam_vfe_deinit_hw(void *hw_priv, void *deinit_hw_args, uint32_t arg_size) return -EINVAL; } + isp_res = (struct cam_isp_resource_node *)deinit_hw_args; + if (isp_res && isp_res->deinit) { + rc = isp_res->deinit(isp_res, NULL, 0); + if (rc) + CAM_ERR(CAM_ISP, "deinit failed"); + } + mutex_lock(&vfe_hw->hw_mutex); if (!vfe_hw->open_count) { mutex_unlock(&vfe_hw->hw_mutex); @@ -281,13 +288,6 @@ int cam_vfe_deinit_hw(void *hw_priv, void *deinit_hw_args, uint32_t arg_size) CAM_ERR(CAM_ISP, "Bus HW deinit Failed rc=%d", rc); } - isp_res = (struct cam_isp_resource_node *)deinit_hw_args; - if (isp_res && isp_res->deinit) { - rc = isp_res->deinit(isp_res, NULL, 0); - if (rc) - CAM_ERR(CAM_ISP, "deinit failed"); - } - rc = cam_vfe_reset(hw_priv, &reset_core_args, sizeof(uint32_t)); /* Turn OFF Regulators, Clocks and other SOC resources */