فهرست منبع

msm: camera: isp: Modify check for multi vc-dt

Modify check for multi vc-dt. The change also programs the
right value for dynamic switch select.

CRs-Fixed: 2841729
Change-Id: I9b7459f77d65a83f3d559967a04d81357f7c6de3
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 4 سال پیش
والد
کامیت
7f6ac037d5

+ 2 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/iopoll.h>
@@ -398,7 +398,7 @@ int cam_ife_csid_is_vc_full_width(struct cam_ife_csid_cid_data *cid_data)
 		if (!p_cid->cid_cnt)
 			continue;
 
-		if (p_cid->num_vc_dt >= CAM_IFE_CSID_MULTI_VC_DT_GRP_MAX) {
+		if (p_cid->num_vc_dt > CAM_IFE_CSID_MULTI_VC_DT_GRP_MAX) {
 			CAM_ERR(CAM_ISP, "Invalid num_vc_dt:%d cid: %d",
 				p_cid->num_vc_dt, i);
 			rc = -EINVAL;

+ 2 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.h

@@ -304,11 +304,11 @@ struct cam_ife_csid_cid_data {
  * @lane_cfg:                 lane configuration
  * @tpg_mux_sel:              TPG mux sel
  * @tpg_num_sel:              TPG num sel
- * @dynamic_senso_switch_en:  Flag if dynamic sensor switch is enabled
  * @mup:                      Mode Update bit. 0 for odd vc, 1 for even VC
  * @epd_supported:            Flag to check if epd supported
  * @irq_handle:               IRQ Handle
  * @err_irq_handle:           Error IRQ Handle
+ * @dynamic_sensor_switch_en: Flag if dynamic sensor switch is enabled
  */
 struct cam_ife_csid_rx_cfg  {
 	uint32_t                        phy_sel;
@@ -317,11 +317,11 @@ struct cam_ife_csid_rx_cfg  {
 	uint32_t                        lane_cfg;
 	uint32_t                        tpg_mux_sel;
 	uint32_t                        tpg_num_sel;
-	uint32_t                        dynamic_sensor_switch_en;
 	uint32_t                        mup;
 	uint32_t                        epd_supported;
 	uint32_t                        irq_handle;
 	uint32_t                        err_irq_handle;
+	bool                            dynamic_sensor_switch_en;
 };
 
 int cam_ife_csid_is_pix_res_format_supported(

+ 3 - 3
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -1982,7 +1982,7 @@ static int cam_ife_csid_hw_ver2_config_rx(
 		reserve->in_port->lane_num;
 	csid_hw->res_type = reserve->in_port->res_type;
 	csid_hw->rx_cfg.dynamic_sensor_switch_en =
-		reserve->in_port->dynamic_sensor_switch_en;
+		(bool)reserve->in_port->dynamic_sensor_switch_en;
 	csid_hw->rx_cfg.epd_supported =
 		reserve->in_port->epd_supported;
 
@@ -3348,10 +3348,10 @@ static int cam_ife_csid_ver2_enable_csi2(struct cam_ife_csid_ver2_hw *csid_hw)
 	/*Configure Rx cfg1*/
 	val = 1 << csi2_reg->misr_enable_shift_val;
 	val |= 1 << csi2_reg->ecc_correction_shift_en;
-	val |= (rx_cfg->dynamic_sensor_switch_en
-			<< csi2_reg->dyn_sensor_switch_shift_en);
 	val |= (rx_cfg->epd_supported
 			<< csi2_reg->epd_mode_shift_en);
+	if (rx_cfg->dynamic_sensor_switch_en)
+		val |= 1 << csi2_reg->dyn_sensor_switch_shift_en;
 
 	vc_full_width = cam_ife_csid_is_vc_full_width(csid_hw->cid_data);