Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19cbc406 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Add Phy source for CPHY TPG" into camera-kernel.lnx.4.0

parents a418ea16 c2ef7b6b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1667,6 +1667,13 @@ static int cam_ife_mgr_acquire_cid_res(
	if (in_port->num_out_res)
		out_port = &(in_port->data[0]);

	if (ife_ctx->is_tpg) {
		if (ife_ctx->res_list_tpg.hw_res[0]->hw_intf->hw_idx == 0)
			csid_acquire.phy_sel = CAM_ISP_IFE_IN_RES_PHY_0;
		else
			csid_acquire.phy_sel = CAM_ISP_IFE_IN_RES_PHY_1;
	}

	/* Try acquiring CID resource from previously acquired HW */
	list_for_each_entry(cid_res_iterator, &ife_ctx->res_list_ife_cid,
		list) {
@@ -1766,6 +1773,15 @@ static int cam_ife_mgr_acquire_cid_res(
		csid_acquire.node_res = NULL;
		csid_acquire.res_type = CAM_ISP_RESOURCE_CID;
		csid_acquire.in_port = in_port;

		if (ife_ctx->is_tpg) {
			if (ife_ctx->res_list_tpg.hw_res[0]->hw_intf->hw_idx
				== 0)
				csid_acquire.phy_sel = CAM_ISP_IFE_IN_RES_PHY_0;
			else
				csid_acquire.phy_sel = CAM_ISP_IFE_IN_RES_PHY_1;
		}

		for (j = 0; j < CAM_IFE_CSID_HW_NUM_MAX; j++) {
			if (!ife_hw_mgr->csid_devices[j])
				continue;
+14 −0
Original line number Diff line number Diff line
@@ -688,6 +688,7 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
	struct cam_ife_csid_cid_data       *cid_data;
	uint32_t camera_hw_version;
	uint32_t valid_vc_dt;
	uint32_t res_type;

	CAM_DBG(CAM_ISP,
		"CSID:%d res_sel:0x%x Lane type:%d lane_num:%d dt:%d vc:%d",
@@ -952,6 +953,19 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
		csid_hw->csi2_rx_cfg.lane_num =
			cid_reserv->in_port->lane_num;

		res_type = cid_reserv->in_port->res_type;
		if ((res_type == CAM_ISP_IFE_IN_RES_CPHY_TPG_0) ||
			(res_type == CAM_ISP_IFE_IN_RES_CPHY_TPG_1) ||
			(res_type == CAM_ISP_IFE_IN_RES_CPHY_TPG_2)) {
			csid_hw->csi2_rx_cfg.phy_sel =
				(cid_reserv->phy_sel & 0xFF) - 1;
			csid_hw->csi2_reserve_cnt++;
			CAM_DBG(CAM_ISP, "CSID:%d CID:%d acquired",
				csid_hw->hw_intf->hw_idx,
				cid_reserv->node_res->res_id);
			goto end;
		}

		if (cid_reserv->in_port->res_type != CAM_ISP_IFE_IN_RES_TPG) {
			csid_hw->csi2_rx_cfg.phy_sel =
				(cid_reserv->in_port->res_type & 0xFF) - 1;
+2 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ struct cam_isp_in_port_generic_info {
 * @drop_enable : Flag to indicate CSID drop enable
 * @priv:         private data to be sent in callback
 * @event_cb:     CSID event callback to hw manager
 * @phy_sel:      Phy selection number if tpg is enabled from userspace
 *
 */
struct cam_csid_hw_reserve_resource_args {
@@ -142,6 +143,7 @@ struct cam_csid_hw_reserve_resource_args {
	bool                                      drop_enable;
	void                                     *priv;
	cam_hw_mgr_event_cb_func                  event_cb;
	uint32_t                                  phy_sel;
};

/**
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static int cam_top_tpg_ver2_start(
	cam_io_w_mb(val, soc_info->reg_map[0].mem_base + tpg_reg->tpg_cfg_2);

	/* program number of frames */
	cam_io_w_mb(1, soc_info->reg_map[0].mem_base + tpg_reg->tpg_cfg_3);
	cam_io_w_mb(0xFFFFF, soc_info->reg_map[0].mem_base + tpg_reg->tpg_cfg_3);

	cam_io_w_mb(tpg_reg->tpg_module_en, soc_info->reg_map[0].mem_base +
		tpg_reg->tpg_module_cfg);