Forráskód Böngészése

msm: camera: icp: Fix getting wrong device type to deinit clk

After device inactive period timeouts, icp hw mgr receives a callback
to deinit the inactive device's clock. The current implementation of
the callback fetches the wrong hw type to deinit. This change will
get the right device type to deinit.

CRs-Fixed: 3449530
Change-Id: I63700d35d62d6096d09d23c933e22da623d087c9
Signed-off-by: Sokchetra Eung <[email protected]>
Sokchetra Eung 2 éve
szülő
commit
19f99bbb85

+ 2 - 0
drivers/cam_icp/icp_hw/bps_hw/bps_soc.c

@@ -171,5 +171,7 @@ int cam_bps_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable)
 	else
 		cam_soc_util_clk_disable_default(soc_info, CAM_CLK_SW_CLIENT_IDX);
 
+	CAM_DBG(CAM_ICP, "%s BPS clock", clk_enable ? "Enable" : "Disable");
+
 	return rc;
 }

+ 3 - 3
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -448,7 +448,7 @@ static int32_t cam_icp_deinit_idle_clk(void *priv, void *data)
 		goto done;
 	}
 
-	hw_dev_type = ctx_data->hw_dev_type;
+	hw_dev_type = CAM_ICP_GET_HW_DEV_TYPE_FROM_HW_CLK_TYPE(clk_info->hw_type);
 	if (!CAM_ICP_IS_VALID_HW_DEV_TYPE(hw_dev_type)) {
 		CAM_ERR(CAM_ICP, "%s: Invalid HW device type: %u",
 			ctx_data->ctx_id_string, hw_dev_type);
@@ -458,8 +458,8 @@ static int32_t cam_icp_deinit_idle_clk(void *priv, void *data)
 
 	clk_upd_cmd.dev_pc_enable = hw_mgr->dev_pc_flag;
 
-	CAM_DBG(CAM_PERF, "[%s] Disable %d",
-		hw_mgr->hw_mgr_name, clk_info->hw_type);
+	CAM_DBG(CAM_PERF, "[%s] Disable clock: %u hw dev type: %u",
+		hw_mgr->hw_mgr_name, clk_info->hw_type, hw_dev_type);
 
 	for (i = 0; i < hw_mgr->hw_dev_cnt[hw_dev_type]; i++) {
 		dev_intf = hw_mgr->devices[hw_dev_type][i];

+ 2 - 0
drivers/cam_icp/icp_hw/ipe_hw/ipe_soc.c

@@ -174,5 +174,7 @@ int cam_ipe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable)
 	else
 		cam_soc_util_clk_disable_default(soc_info, CAM_CLK_SW_CLIENT_IDX);
 
+	CAM_DBG(CAM_ICP, "%s IPE clock", clk_enable ? "Enable" : "Disable");
+
 	return rc;
 }

+ 2 - 0
drivers/cam_icp/icp_hw/ofe_hw/ofe_soc.c

@@ -157,5 +157,7 @@ int cam_ofe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable)
 	else
 		cam_soc_util_clk_disable_default(soc_info, CAM_CLK_SW_CLIENT_IDX);
 
+	CAM_DBG(CAM_ICP, "%s OFE clock", clk_enable ? "Enable" : "Disable");
+
 	return rc;
 }