Browse Source

msm: camera: tpg: call soc disable resources in shutdown

Without this, tpg is keeping refCount on titan top gdsc and
thus causing qchannel handshake side effects.
Sequence:
1. TPG calls cpas_start, increments refCount on gdsc with
   soc_enable_resources
2. run usecase
3. TPG missing disable_soc_resource
4. TPG calling cpas_stop : which shuts down qchannel
5. When next iteration starts, because gdsc is still on from
   previous session, cpas top is not getting reset state
   registers - thus keeping qchannel still in shut down state.
   qchannel goes to good state if gdsc is actually turned off
   and then turned on.

CRs-Fixed: 3131613
Change-Id: Iacb837f7ee3fd7d6b094d0271d0f2d9c15f0b306
Signed-off-by: Pavan Kumar Chilamkurthi <[email protected]>
Pavan Kumar Chilamkurthi 3 năm trước cách đây
mục cha
commit
83b1ffe863
1 tập tin đã thay đổi với 9 bổ sung6 xóa
  1. 9 6
      drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c

+ 9 - 6
drivers/cam_sensor_module/cam_tpg/tpg_hw/tpg_hw.c

@@ -646,12 +646,15 @@ int tpg_hw_reset(struct tpg_hw *hw)
 
 	/* disable the hw */
 	mutex_lock(&hw->mutex);
-	if ((hw->state != TPG_HW_STATE_HW_DISABLED) &&
-			cam_cpas_stop(hw->cpas_handle)) {
-		CAM_ERR(CAM_TPG, "TPG[%d] CPAS stop failed",
-				hw->hw_idx);
-		rc = -EINVAL;
-	} else {
+	if (hw->state != TPG_HW_STATE_HW_DISABLED) {
+		rc = cam_soc_util_disable_platform_resource(hw->soc_info, true, false);
+		if (rc)
+			CAM_ERR(CAM_TPG, "TPG[%d] Disable platform failed %d", hw->hw_idx, rc);
+
+		rc = cam_cpas_stop(hw->cpas_handle);
+		if (rc)
+			CAM_ERR(CAM_TPG, "TPG[%d] CPAS stop failed", hw->hw_idx);
+
 		hw->state = TPG_HW_STATE_HW_DISABLED;
 	}
 	mutex_unlock(&hw->mutex);