Loading drivers/cam_cdm/cam_cdm.h +5 −2 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ struct cam_cdm_common_reg_data { * @icl_reg: registers to read information related to good * and invalid commands in FIFO * @spare: spare register * @priority_group_bit_offset offset of priority group bits * */ struct cam_cdm_common_regs { Loading Loading @@ -349,6 +350,7 @@ struct cam_cdm_common_regs { const struct cam_cdm_perf_regs *perf_reg; const struct cam_cdm_icl_regs *icl_reg; uint32_t spare; uint32_t priority_group_bit_offset; }; /** Loading Loading @@ -530,10 +532,11 @@ struct cam_cdm { /* struct cam_cdm_private_dt_data - CDM hw custom dt data */ struct cam_cdm_private_dt_data { bool dt_cdm_shared; uint32_t dt_num_supported_clients; const char *dt_cdm_client_name[CAM_PER_CDM_MAX_REGISTERED_CLIENTS]; bool config_fifo; uint8_t priority_group; uint32_t fifo_depth[CAM_CDM_BL_FIFO_MAX]; uint32_t dt_num_supported_clients; const char *dt_cdm_client_name[CAM_PER_CDM_MAX_REGISTERED_CLIENTS]; }; /* struct cam_cdm_intf_devices - CDM mgr interface devices */ Loading drivers/cam_cdm/cam_cdm_hw_core.c +16 −16 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) uint32_t cfg_mask = 0; int rc; struct cam_cdm *core = (struct cam_cdm *)cdm_hw->core_info; struct cam_cdm_private_dt_data *pvt_data = pvt_data = cdm_hw->soc_info.soc_private; cfg_mask = cfg_mask | CAM_CDM_AHB_STOP_ON_ERROR| Loading @@ -497,21 +499,20 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) goto end; } if (cdm_version < CAM_CDM_VERSION_2_0) { rc = cam_cdm_write_hw_reg(cdm_hw, core->offsets->cmn_reg->core_cfg, cfg_mask); if (rc) { CAM_ERR(CAM_CDM, "Error writing cdm core cfg"); rc = -EIO; goto end; } } else { if (cdm_version >= CAM_CDM_VERSION_2_0) { if (core->id != CAM_CDM_CPAS) cfg_mask = cfg_mask | CAM_CDM_IMPLICIT_WAIT_EN; if (core->arbitration == CAM_CDM_ARBITRATION_ROUND_ROBIN) cfg_mask = cfg_mask | CAM_CDM_ARB_SEL_RR; } if (cdm_version >= CAM_CDM_VERSION_2_1) { cfg_mask = cfg_mask | ((uint32_t)pvt_data->priority_group << core->offsets->cmn_reg->priority_group_bit_offset); } rc = cam_cdm_write_hw_reg(cdm_hw, core->offsets->cmn_reg->core_cfg, cfg_mask); if (rc) { Loading @@ -519,7 +520,6 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) rc = -EIO; goto end; } } end: return rc; Loading drivers/cam_cdm/cam_cdm_hw_reg_2_1.h +1 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ static struct cam_cdm_common_regs cdm_hw_2_1_cmn_reg_offset = { .perf_reg = NULL, .icl_reg = &cdm_2_1_icl, .spare = 0x3fc, .priority_group_bit_offset = 20, }; static struct cam_cdm_common_reg_data cdm_hw_2_1_cmn_reg_data = { Loading drivers/cam_cdm/cam_cdm_soc.c +11 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,14 @@ int cam_cdm_soc_load_dt_private(struct platform_device *pdev, CAM_ERR(CAM_CDM, "Reading cdm-client-names failed"); goto end; } } rc = of_property_read_u8(pdev->dev.of_node, "cdm-priority-group", &ptr->priority_group); if (rc < 0) { ptr->priority_group = 0; rc = 0; } ptr->config_fifo = of_property_read_bool(pdev->dev.of_node, Loading Loading @@ -154,12 +162,13 @@ int cam_hw_cdm_soc_get_dt_properties(struct cam_hw_info *cdm_hw, int rc; struct cam_hw_soc_info *soc_ptr; const struct of_device_id *id; struct cam_cdm *cdm_core = cdm_hw->core_info; struct cam_cdm *cdm_core = NULL; if (!cdm_hw || (cdm_hw->soc_info.soc_private) || !(cdm_hw->soc_info.pdev)) return -EINVAL; cdm_core = cdm_hw->core_info; soc_ptr = &cdm_hw->soc_info; rc = cam_soc_util_get_dt_properties(soc_ptr); Loading Loading @@ -191,7 +200,7 @@ int cam_hw_cdm_soc_get_dt_properties(struct cam_hw_info *cdm_hw, CAM_DBG(CAM_CDM, "name %s", cdm_core->name); snprintf(cdm_core->name, sizeof(cdm_core->name) + 1, "%s%d", snprintf(cdm_core->name, sizeof(cdm_core->name), "%s%d", id->compatible, soc_ptr->index); CAM_DBG(CAM_CDM, "name %s", cdm_core->name); Loading Loading
drivers/cam_cdm/cam_cdm.h +5 −2 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ struct cam_cdm_common_reg_data { * @icl_reg: registers to read information related to good * and invalid commands in FIFO * @spare: spare register * @priority_group_bit_offset offset of priority group bits * */ struct cam_cdm_common_regs { Loading Loading @@ -349,6 +350,7 @@ struct cam_cdm_common_regs { const struct cam_cdm_perf_regs *perf_reg; const struct cam_cdm_icl_regs *icl_reg; uint32_t spare; uint32_t priority_group_bit_offset; }; /** Loading Loading @@ -530,10 +532,11 @@ struct cam_cdm { /* struct cam_cdm_private_dt_data - CDM hw custom dt data */ struct cam_cdm_private_dt_data { bool dt_cdm_shared; uint32_t dt_num_supported_clients; const char *dt_cdm_client_name[CAM_PER_CDM_MAX_REGISTERED_CLIENTS]; bool config_fifo; uint8_t priority_group; uint32_t fifo_depth[CAM_CDM_BL_FIFO_MAX]; uint32_t dt_num_supported_clients; const char *dt_cdm_client_name[CAM_PER_CDM_MAX_REGISTERED_CLIENTS]; }; /* struct cam_cdm_intf_devices - CDM mgr interface devices */ Loading
drivers/cam_cdm/cam_cdm_hw_core.c +16 −16 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) uint32_t cfg_mask = 0; int rc; struct cam_cdm *core = (struct cam_cdm *)cdm_hw->core_info; struct cam_cdm_private_dt_data *pvt_data = pvt_data = cdm_hw->soc_info.soc_private; cfg_mask = cfg_mask | CAM_CDM_AHB_STOP_ON_ERROR| Loading @@ -497,21 +499,20 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) goto end; } if (cdm_version < CAM_CDM_VERSION_2_0) { rc = cam_cdm_write_hw_reg(cdm_hw, core->offsets->cmn_reg->core_cfg, cfg_mask); if (rc) { CAM_ERR(CAM_CDM, "Error writing cdm core cfg"); rc = -EIO; goto end; } } else { if (cdm_version >= CAM_CDM_VERSION_2_0) { if (core->id != CAM_CDM_CPAS) cfg_mask = cfg_mask | CAM_CDM_IMPLICIT_WAIT_EN; if (core->arbitration == CAM_CDM_ARBITRATION_ROUND_ROBIN) cfg_mask = cfg_mask | CAM_CDM_ARB_SEL_RR; } if (cdm_version >= CAM_CDM_VERSION_2_1) { cfg_mask = cfg_mask | ((uint32_t)pvt_data->priority_group << core->offsets->cmn_reg->priority_group_bit_offset); } rc = cam_cdm_write_hw_reg(cdm_hw, core->offsets->cmn_reg->core_cfg, cfg_mask); if (rc) { Loading @@ -519,7 +520,6 @@ int cam_hw_cdm_set_cdm_core_cfg(struct cam_hw_info *cdm_hw) rc = -EIO; goto end; } } end: return rc; Loading
drivers/cam_cdm/cam_cdm_hw_reg_2_1.h +1 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ static struct cam_cdm_common_regs cdm_hw_2_1_cmn_reg_offset = { .perf_reg = NULL, .icl_reg = &cdm_2_1_icl, .spare = 0x3fc, .priority_group_bit_offset = 20, }; static struct cam_cdm_common_reg_data cdm_hw_2_1_cmn_reg_data = { Loading
drivers/cam_cdm/cam_cdm_soc.c +11 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,14 @@ int cam_cdm_soc_load_dt_private(struct platform_device *pdev, CAM_ERR(CAM_CDM, "Reading cdm-client-names failed"); goto end; } } rc = of_property_read_u8(pdev->dev.of_node, "cdm-priority-group", &ptr->priority_group); if (rc < 0) { ptr->priority_group = 0; rc = 0; } ptr->config_fifo = of_property_read_bool(pdev->dev.of_node, Loading Loading @@ -154,12 +162,13 @@ int cam_hw_cdm_soc_get_dt_properties(struct cam_hw_info *cdm_hw, int rc; struct cam_hw_soc_info *soc_ptr; const struct of_device_id *id; struct cam_cdm *cdm_core = cdm_hw->core_info; struct cam_cdm *cdm_core = NULL; if (!cdm_hw || (cdm_hw->soc_info.soc_private) || !(cdm_hw->soc_info.pdev)) return -EINVAL; cdm_core = cdm_hw->core_info; soc_ptr = &cdm_hw->soc_info; rc = cam_soc_util_get_dt_properties(soc_ptr); Loading Loading @@ -191,7 +200,7 @@ int cam_hw_cdm_soc_get_dt_properties(struct cam_hw_info *cdm_hw, CAM_DBG(CAM_CDM, "name %s", cdm_core->name); snprintf(cdm_core->name, sizeof(cdm_core->name) + 1, "%s%d", snprintf(cdm_core->name, sizeof(cdm_core->name), "%s%d", id->compatible, soc_ptr->index); CAM_DBG(CAM_CDM, "name %s", cdm_core->name); Loading