Explorar o código

msm: camera: isp: Set device enable flag after enable csid hardware

Device enable flag is getting set after configuring the CSID csi rx
and csid path configuration. If irq comes after configuring the csi rx
hardware then irq handler is not handling as it is checking the device
enable flag. So set device enable flag after enabling the hardware.

CRs-Fixed: 2541840
Change-Id: I022b6dccef4153c34bc8cf99e7a18e2978f92d3f
Signed-off-by: Ravikishore Pampana <[email protected]>
Ravikishore Pampana %!s(int64=5) %!d(string=hai) anos
pai
achega
d1469c8f6a

+ 5 - 4
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c

@@ -1194,6 +1194,7 @@ static int cam_ife_csid_enable_hw(struct cam_ife_csid_hw  *csid_hw)
 	struct cam_hw_soc_info                 *soc_info;
 	uint32_t                               i, val;
 	int                                    clk_lvl;
+	unsigned long                          flags;
 
 	csid_reg = csid_hw->csid_info->csid_reg;
 	soc_info = &csid_hw->hw_info->soc_info;
@@ -1274,6 +1275,10 @@ static int cam_ife_csid_enable_hw(struct cam_ife_csid_hw  *csid_hw)
 	CAM_DBG(CAM_ISP, "CSID:%d CSID HW version: 0x%x",
 		csid_hw->hw_intf->hw_idx, val);
 
+	spin_lock_irqsave(&csid_hw->lock_state, flags);
+	csid_hw->device_enabled = 1;
+	spin_unlock_irqrestore(&csid_hw->lock_state, flags);
+
 	return 0;
 
 disable_soc:
@@ -3257,7 +3262,6 @@ int cam_ife_csid_init_hw(void *hw_priv,
 	struct cam_hw_info                     *csid_hw_info;
 	struct cam_isp_resource_node           *res;
 	const struct cam_ife_csid_reg_offset   *csid_reg;
-	unsigned long                           flags;
 
 	if (!hw_priv || !init_args ||
 		(arg_size != sizeof(struct cam_isp_resource_node))) {
@@ -3338,9 +3342,6 @@ int cam_ife_csid_init_hw(void *hw_priv,
 	if (rc)
 		cam_ife_csid_disable_hw(csid_hw);
 
-	spin_lock_irqsave(&csid_hw->lock_state, flags);
-	csid_hw->device_enabled = 1;
-	spin_unlock_irqrestore(&csid_hw->lock_state, flags);
 end:
 	mutex_unlock(&csid_hw->hw_info->hw_mutex);
 	return rc;