mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
msm: camera: isp: Add Phy source for CPHY TPG
Add Phy selection logic if PHY TPG is enabled. Add phy resource in case of external TPG. CRs-Fixed: 2787956 Change-Id: Ib9d827dc411965d8dd849de53932c62c9b4a4a02 Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
This commit is contained in:
parent
73c03a7992
commit
c2ef7b6bfb
4 changed files with 33 additions and 1 deletions
|
|
@ -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 @@ acquire_successful:
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -689,6 +689,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",
|
||||
|
|
@ -953,6 +954,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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue