From a0e5135248c86e462ddb68e601a036140547f5d9 Mon Sep 17 00:00:00 2001 From: chengxue Date: Mon, 25 Jan 2021 15:19:13 +0800 Subject: [PATCH] msm: camera: csiphy: add logic for csiphy shutdown While csiphy is shutdown abnormally, we also need to program off csiphy hw common register, to avoid the residual of active csiphy hw cnt during monkey test. CRs-Fixed: 2861912 Change-Id: I1767c729b205a96e5f298265e65b37150dac03b6 Signed-off-by: chengxue --- drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c index 187dbc64b3..6134d87f11 100644 --- a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c +++ b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c @@ -942,6 +942,15 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev) cam_csiphy_reset_phyconfig_param(csiphy_dev, i); } + if (csiphy_dev->ctrl_reg->csiphy_reg + .prgm_cmn_reg_across_csiphy) { + mutex_lock(&active_csiphy_cnt_mutex); + active_csiphy_hw_cnt--; + mutex_unlock(&active_csiphy_cnt_mutex); + + cam_csiphy_prgm_cmn_data(csiphy_dev, true); + } + cam_csiphy_reset(csiphy_dev); cam_soc_util_disable_platform_resource(soc_info, true, true);