Merge "msm: camera: icp: Protect a5 init/deinit calls" into camera-kernel.lnx.5.0

Цей коміт міститься в:
Savita Patted
2021-07-06 08:58:21 -07:00
зафіксовано Gerrit - the friendly Code Review server
джерело 5000fbf826 1c49642a1f
коміт 39cb012e64

Переглянути файл

@@ -203,6 +203,13 @@ int cam_a5_init_hw(void *device_priv,
return -EINVAL;
}
spin_lock_irqsave(&a5_dev->hw_lock, flags);
if (a5_dev->hw_state == CAM_HW_STATE_POWER_UP) {
spin_unlock_irqrestore(&a5_dev->hw_lock, flags);
return 0;
}
spin_unlock_irqrestore(&a5_dev->hw_lock, flags);
a5_soc_info = soc_info->soc_private;
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
@@ -277,7 +284,10 @@ int cam_a5_deinit_hw(void *device_priv,
}
spin_lock_irqsave(&a5_dev->hw_lock, flags);
a5_dev->hw_state = CAM_HW_STATE_POWER_DOWN;
if (a5_dev->hw_state == CAM_HW_STATE_POWER_DOWN) {
spin_unlock_irqrestore(&a5_dev->hw_lock, flags);
return 0;
}
spin_unlock_irqrestore(&a5_dev->hw_lock, flags);
rc = cam_a5_disable_soc_resources(soc_info);
@@ -291,6 +301,10 @@ int cam_a5_deinit_hw(void *device_priv,
core_info->cpas_start = false;
}
spin_lock_irqsave(&a5_dev->hw_lock, flags);
a5_dev->hw_state = CAM_HW_STATE_POWER_DOWN;
spin_unlock_irqrestore(&a5_dev->hw_lock, flags);
return rc;
}