msm: camera: utils: Add support for LowSVS_D1

Currently, lowest clk voting level supported is LowSVS, this
change will add support to a lower voting level, LowSVS_D1.

CRs-Fixed: 3480799
Change-Id: Ibdfe9d1d05aa45439a537cebe828cceea83f39d4
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
This commit is contained in:
Atiya Kailany
2023-04-18 18:01:31 -07:00
committed by Camera Software Integration
parent 06420c01fc
commit 57f43538c7
34 changed files with 80 additions and 66 deletions

View File

@@ -34,7 +34,7 @@ int cam_cdm_util_cpas_start(struct cam_hw_info *cdm_hw)
core = (struct cam_cdm *)cdm_hw->core_info; core = (struct cam_cdm *)cdm_hw->core_info;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;

View File

@@ -1894,7 +1894,7 @@ int cam_hw_cdm_get_cdm_config(struct cam_hw_info *cdm_hw)
core = (struct cam_cdm *)cdm_hw->core_info; core = (struct cam_cdm *)cdm_hw->core_info;
soc_info = &cdm_hw->soc_info; soc_info = &cdm_hw->soc_info;
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_CDM, "Enable platform failed for dev %s", CAM_ERR(CAM_CDM, "Enable platform failed for dev %s",
soc_info->dev_name); soc_info->dev_name);
@@ -1997,7 +1997,7 @@ int cam_hw_cdm_init(void *hw_priv,
cdm_core = (struct cam_cdm *)cdm_hw->core_info; cdm_core = (struct cam_cdm *)cdm_hw->core_info;
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_CDM, "Enable platform failed for %s%d", CAM_ERR(CAM_CDM, "Enable platform failed for %s%d",
soc_info->label_name, soc_info->index); soc_info->label_name, soc_info->index);

View File

@@ -523,7 +523,7 @@ static int cam_cpas_util_vote_default_ahb_axi(struct cam_hw_info *cpas_hw,
uint64_t applied_ab_bw = 0, applied_ib_bw = 0; uint64_t applied_ab_bw = 0, applied_ib_bw = 0;
rc = cam_cpas_util_vote_bus_client_level(&cpas_core->ahb_bus_client, rc = cam_cpas_util_vote_bus_client_level(&cpas_core->ahb_bus_client,
(enable == true) ? CAM_SVS_VOTE : CAM_SUSPEND_VOTE); (enable == true) ? CAM_LOWSVS_D1_VOTE : CAM_SUSPEND_VOTE);
if (rc) { if (rc) {
CAM_ERR(CAM_CPAS, "Failed in AHB vote, enable=%d, rc=%d", CAM_ERR(CAM_CPAS, "Failed in AHB vote, enable=%d, rc=%d",
enable, rc); enable, rc);
@@ -2118,7 +2118,7 @@ static int cam_cpas_util_get_ahb_level(struct cam_hw_info *cpas_hw,
(struct cam_cpas_private_soc *) cpas_hw->soc_info.soc_private; (struct cam_cpas_private_soc *) cpas_hw->soc_info.soc_private;
struct dev_pm_opp *opp; struct dev_pm_opp *opp;
unsigned int corner; unsigned int corner;
enum cam_vote_level level = CAM_SVS_VOTE; enum cam_vote_level level = CAM_LOWSVS_D1_VOTE;
unsigned long corner_freq = freq; unsigned long corner_freq = freq;
int i; int i;
@@ -2245,7 +2245,7 @@ static int cam_cpas_hw_update_ahb_vote(struct cam_hw_info *cpas_hw,
CAM_DBG(CAM_CPAS, "0 ahb vote from client %d", CAM_DBG(CAM_CPAS, "0 ahb vote from client %d",
client_handle); client_handle);
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_SVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
} }
if (!CAM_CPAS_CLIENT_VALID(client_indx)) if (!CAM_CPAS_CLIENT_VALID(client_indx))
@@ -2329,7 +2329,7 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
struct cam_ahb_vote *ahb_vote; struct cam_ahb_vote *ahb_vote;
struct cam_ahb_vote remove_ahb; struct cam_ahb_vote remove_ahb;
struct cam_axi_vote axi_vote = {0}; struct cam_axi_vote axi_vote = {0};
enum cam_vote_level applied_level = CAM_SVS_VOTE; enum cam_vote_level applied_level = CAM_LOWSVS_D1_VOTE;
int rc, i = 0, err_val = 0; int rc, i = 0, err_val = 0;
struct cam_cpas_private_soc *soc_private = NULL; struct cam_cpas_private_soc *soc_private = NULL;
bool invalid_start = true; bool invalid_start = true;
@@ -4697,7 +4697,8 @@ int cam_cpas_hw_probe(struct platform_device *pdev,
if (rc) if (rc)
goto axi_cleanup; goto axi_cleanup;
rc = cam_cpas_soc_enable_resources(&cpas_hw->soc_info, CAM_SVS_VOTE); rc = cam_cpas_soc_enable_resources(&cpas_hw->soc_info,
cpas_hw->soc_info.lowest_clk_level);
if (rc) { if (rc) {
CAM_ERR(CAM_CPAS, "failed in soc_enable_resources, rc=%d", rc); CAM_ERR(CAM_CPAS, "failed in soc_enable_resources, rc=%d", rc);
goto remove_default_vote; goto remove_default_vote;

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2021, The Linux Foundation. All rights reserved. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#include <linux/of.h> #include <linux/of.h>
@@ -156,7 +156,7 @@ int cam_cre_init_hw(void *device_priv,
} }
cpas_vote->ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote->ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote->ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote->ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote->axi_vote.num_paths = 1; cpas_vote->axi_vote.num_paths = 1;
cpas_vote->axi_vote.axi_path[0].path_data_type = cpas_vote->axi_vote.axi_path[0].path_data_type =
CAM_AXI_PATH_DATA_ALL; CAM_AXI_PATH_DATA_ALL;
@@ -480,7 +480,7 @@ int cam_cre_process_cmd(void *device_priv, uint32_t cmd_type,
if (!core_info->clk_enable) { if (!core_info->clk_enable) {
rc = cam_soc_util_clk_enable_default(soc_info, CAM_CLK_SW_CLIENT_IDX, rc = cam_soc_util_clk_enable_default(soc_info, CAM_CLK_SW_CLIENT_IDX,
CAM_SVS_VOTE); soc_info->lowest_clk_level);
if (rc) { if (rc) {
CAM_ERR(CAM_CRE, "Clock enable is failed"); CAM_ERR(CAM_CRE, "Clock enable is failed");
return rc; return rc;

View File

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2021, The Linux Foundation. All rights reserved. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
@@ -187,7 +188,7 @@ static int cam_cre_component_bind(struct device *dev,
goto enable_soc_failed; goto enable_soc_failed;
} }
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_AXI_PATH_DATA_CRE_WR_OUT; CAM_AXI_PATH_DATA_CRE_WR_OUT;

View File

@@ -40,7 +40,7 @@ int cam_cre_enable_soc_resources(struct cam_hw_soc_info *soc_info)
int rc; int rc;
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) if (rc)
CAM_ERR(CAM_CRE, "enable platform failed %d", rc); CAM_ERR(CAM_CRE, "enable platform failed %d", rc);

View File

@@ -114,7 +114,7 @@ int cam_custom_hw_sub_mod_enable_soc_resources(struct cam_hw_soc_info *soc_info)
struct cam_axi_vote axi_vote = {0}; struct cam_axi_vote axi_vote = {0};
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 2; axi_vote.num_paths = 2;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;
@@ -135,7 +135,7 @@ int cam_custom_hw_sub_mod_enable_soc_resources(struct cam_hw_soc_info *soc_info)
} }
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_LOWSVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_CUSTOM, "Error! enable platform failed rc=%d", rc); CAM_ERR(CAM_CUSTOM, "Error! enable platform failed rc=%d", rc);
goto stop_cpas; goto stop_cpas;

View File

@@ -111,7 +111,7 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info)
int rc; int rc;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 2; axi_vote.num_paths = 2;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;
@@ -132,7 +132,7 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info)
} }
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc); CAM_ERR(CAM_FD, "Error enable platform failed, rc=%d", rc);
goto stop_cpas; goto stop_cpas;

View File

@@ -70,7 +70,7 @@ int cam_bps_init_hw(void *device_priv,
} }
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_BPS_DEFAULT_AXI_PATH; CAM_BPS_DEFAULT_AXI_PATH;

View File

@@ -667,7 +667,7 @@ static int cam_icp_remove_ctx_bw(struct cam_icp_hw_mgr *hw_mgr,
if (total_ab_bw == 0) { if (total_ab_bw == 0) {
/* If no more contexts are active, reduce AHB vote to minimum */ /* If no more contexts are active, reduce AHB vote to minimum */
clk_update.ahb_vote.type = CAM_VOTE_ABSOLUTE; clk_update.ahb_vote.type = CAM_VOTE_ABSOLUTE;
clk_update.ahb_vote.vote.level = CAM_LOWSVS_VOTE; clk_update.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
clk_update.ahb_vote_valid = true; clk_update.ahb_vote_valid = true;
} else { } else {
clk_update.ahb_vote_valid = false; clk_update.ahb_vote_valid = false;

View File

@@ -237,7 +237,7 @@ int cam_icp_soc_resources_enable(struct cam_hw_soc_info *soc_info)
int rc = 0; int rc = 0;
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "failed to enable soc resources rc=%d", rc); CAM_ERR(CAM_ICP, "failed to enable soc resources rc=%d", rc);

View File

@@ -220,7 +220,7 @@ int cam_icp_v1_init_hw(void *device_priv, void *args,
icp_v1_soc_info = soc_info->soc_private; icp_v1_soc_info = soc_info->soc_private;
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_ICP_DEFAULT_AXI_PATH; CAM_ICP_DEFAULT_AXI_PATH;

View File

@@ -172,7 +172,7 @@ static int cam_icp_v2_cpas_start(struct cam_icp_v2_core_info *core_info)
struct cam_icp_cpas_vote vote; struct cam_icp_cpas_vote vote;
vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
vote.ahb_vote.vote.level = CAM_LOWSVS_VOTE; vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
vote.axi_vote.num_paths = 1; vote.axi_vote.num_paths = 1;
vote.axi_vote.axi_path[0].path_data_type = CAM_ICP_DEFAULT_AXI_PATH; vote.axi_vote.axi_path[0].path_data_type = CAM_ICP_DEFAULT_AXI_PATH;

View File

@@ -68,7 +68,7 @@ int cam_ipe_init_hw(void *device_priv,
} }
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_IPE_DEFAULT_AXI_PATH; CAM_IPE_DEFAULT_AXI_PATH;

View File

@@ -71,7 +71,7 @@ int cam_ofe_init_hw(void *device_priv,
} }
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_OFE_DEFAULT_AXI_PATH; CAM_OFE_DEFAULT_AXI_PATH;

View File

@@ -4676,6 +4676,7 @@ static int cam_ife_csid_ver2_set_cesta_clk_rate(struct cam_ife_csid_ver2_hw *csi
{ {
struct cam_hw_soc_info *soc_info = &csid_hw->hw_info->soc_info; struct cam_hw_soc_info *soc_info = &csid_hw->hw_info->soc_info;
bool channel_switch = force_channel_switch; bool channel_switch = force_channel_switch;
uint32_t lowest_clk_lvl = soc_info->lowest_clk_level;
int rc = 0; int rc = 0;
CAM_DBG(CAM_ISP, "CSID:%d clk_rate=%llu, channel_switch=%d, identifier=%s", CAM_DBG(CAM_ISP, "CSID:%d clk_rate=%llu, channel_switch=%d, identifier=%s",
@@ -4684,12 +4685,12 @@ static int cam_ife_csid_ver2_set_cesta_clk_rate(struct cam_ife_csid_ver2_hw *csi
if (csid_hw->clk_rate) { if (csid_hw->clk_rate) {
rc = cam_soc_util_set_src_clk_rate(soc_info, csid_hw->hw_intf->hw_idx, rc = cam_soc_util_set_src_clk_rate(soc_info, csid_hw->hw_intf->hw_idx,
csid_hw->clk_rate, csid_hw->clk_rate,
soc_info->clk_rate[CAM_LOWSVS_VOTE][soc_info->src_clk_idx]); soc_info->clk_rate[lowest_clk_lvl][soc_info->src_clk_idx]);
if (rc) { if (rc) {
CAM_ERR(CAM_ISP, CAM_ERR(CAM_ISP,
"Failed in setting cesta clk rates[high low]:[%ld %ld] client_idx:%d rc:%d", "Failed in setting cesta clk rates[high low]:[%ld %ld] client_idx:%d rc:%d",
csid_hw->clk_rate, csid_hw->clk_rate,
soc_info->clk_rate[CAM_LOWSVS_VOTE][soc_info->src_clk_idx], soc_info->clk_rate[lowest_clk_lvl][soc_info->src_clk_idx],
csid_hw->hw_intf->hw_idx, rc); csid_hw->hw_intf->hw_idx, rc);
return rc; return rc;
} }
@@ -7100,7 +7101,7 @@ int cam_ife_csid_ver2_irq_line_test(void *hw_priv)
mem_base = csid_hw->hw_info->soc_info.reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base; mem_base = csid_hw->hw_info->soc_info.reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base;
csid_reg = csid_hw->core_info->csid_reg; csid_reg = csid_hw->core_info->csid_reg;
rc = cam_ife_csid_enable_soc_resources(soc_info, CAM_LOWSVS_VOTE); rc = cam_ife_csid_enable_soc_resources(soc_info, soc_info->lowest_clk_level);
if (rc) { if (rc) {
CAM_ERR(CAM_ISP, "CSID[%u] Enable soc failed", csid_hw->hw_intf->hw_idx); CAM_ERR(CAM_ISP, "CSID[%u] Enable soc failed", csid_hw->hw_intf->hw_idx);
return rc; return rc;

View File

@@ -167,7 +167,7 @@ int cam_ife_csid_enable_soc_resources(
soc_private = soc_info->soc_private; soc_private = soc_info->soc_private;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE;

View File

@@ -184,7 +184,7 @@ int cam_sfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
soc_private = soc_info->soc_private; soc_private = soc_info->soc_private;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_SFE_NRDI; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_SFE_NRDI;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE;
@@ -212,7 +212,7 @@ int cam_sfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
*/ */
rc = cam_soc_util_enable_platform_resource(soc_info, rc = cam_soc_util_enable_platform_resource(soc_info,
(soc_info->is_clk_drv_en ? soc_info->index : CAM_CLK_SW_CLIENT_IDX), true, (soc_info->is_clk_drv_en ? soc_info->index : CAM_CLK_SW_CLIENT_IDX), true,
CAM_LOWSVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_SFE, "Enable platform failed rc=%d", rc); CAM_ERR(CAM_SFE, "Enable platform failed rc=%d", rc);
goto stop_cpas; goto stop_cpas;

View File

@@ -178,10 +178,12 @@ static int cam_sfe_top_set_hw_clk_rate(struct cam_sfe_top_priv *top_priv,
int rc = 0, clk_lvl = -1; int rc = 0, clk_lvl = -1;
unsigned long cesta_clk_rate_high, cesta_clk_rate_low; unsigned long cesta_clk_rate_high, cesta_clk_rate_low;
int cesta_client_idx = -1; int cesta_client_idx = -1;
uint32_t lowest_clk_lvl;
soc_info = top_priv->common_data.soc_info; soc_info = top_priv->common_data.soc_info;
soc_private = (struct cam_sfe_soc_private *)soc_info->soc_private; soc_private = (struct cam_sfe_soc_private *)soc_info->soc_private;
lowest_clk_lvl = soc_info->lowest_clk_level;
cesta_clk_rate_high = final_clk_rate; cesta_clk_rate_high = final_clk_rate;
cesta_clk_rate_low = final_clk_rate; cesta_clk_rate_low = final_clk_rate;
@@ -189,7 +191,7 @@ static int cam_sfe_top_set_hw_clk_rate(struct cam_sfe_top_priv *top_priv,
cesta_client_idx = top_priv->common_data.hw_intf->hw_idx; cesta_client_idx = top_priv->common_data.hw_intf->hw_idx;
if (is_drv_config_en) if (is_drv_config_en)
cesta_clk_rate_low = cesta_clk_rate_low =
soc_info->clk_rate[CAM_LOWSVS_VOTE][soc_info->src_clk_idx]; soc_info->clk_rate[lowest_clk_lvl][soc_info->src_clk_idx];
else else
cesta_clk_rate_low = final_clk_rate; cesta_clk_rate_low = final_clk_rate;
} }

View File

@@ -95,7 +95,7 @@ int cam_tfe_csid_enable_soc_resources(
soc_private = soc_info->soc_private; soc_private = soc_info->soc_private;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_SVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE;

View File

@@ -159,7 +159,7 @@ int cam_tfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
soc_private = soc_info->soc_private; soc_private = soc_info->soc_private;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_SVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_IFE_VID; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_IFE_VID;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE;
@@ -175,7 +175,7 @@ int cam_tfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
} }
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDXs, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDXs, true,
CAM_LOWSVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc); CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc);
goto stop_cpas; goto stop_cpas;

View File

@@ -267,7 +267,7 @@ int cam_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
soc_private = soc_info->soc_private; soc_private = soc_info->soc_private;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
if (soc_private->is_ife_lite) { if (soc_private->is_ife_lite) {
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_IFE_RDI1; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_IFE_RDI1;
@@ -298,7 +298,7 @@ int cam_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
rc = cam_soc_util_enable_platform_resource(soc_info, rc = cam_soc_util_enable_platform_resource(soc_info,
(soc_info->is_clk_drv_en ? soc_info->index : CAM_CLK_SW_CLIENT_IDX), true, (soc_info->is_clk_drv_en ? soc_info->index : CAM_CLK_SW_CLIENT_IDX), true,
CAM_LOWSVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc); CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc);
goto stop_cpas; goto stop_cpas;

View File

@@ -93,10 +93,12 @@ static int cam_vfe_top_set_hw_clk_rate(struct cam_vfe_top_priv_common *top_commo
int rc = 0, clk_lvl = -1; int rc = 0, clk_lvl = -1;
unsigned long cesta_clk_rate_high = 0, cesta_clk_rate_low = 0; unsigned long cesta_clk_rate_high = 0, cesta_clk_rate_low = 0;
int cesta_client_idx = -1; int cesta_client_idx = -1;
uint32_t lowest_clk_lvl;
soc_info = top_common->soc_info; soc_info = top_common->soc_info;
soc_private = (struct cam_vfe_soc_private *)soc_info->soc_private; soc_private = (struct cam_vfe_soc_private *)soc_info->soc_private;
lowest_clk_lvl = soc_info->lowest_clk_level;
cesta_clk_rate_high = final_clk_rate; cesta_clk_rate_high = final_clk_rate;
cesta_clk_rate_low = final_clk_rate; cesta_clk_rate_low = final_clk_rate;
@@ -104,7 +106,7 @@ static int cam_vfe_top_set_hw_clk_rate(struct cam_vfe_top_priv_common *top_commo
cesta_client_idx = top_common->hw_idx; cesta_client_idx = top_common->hw_idx;
if (is_drv_config_en) if (is_drv_config_en)
cesta_clk_rate_low = cesta_clk_rate_low =
soc_info->clk_rate[CAM_LOWSVS_VOTE][soc_info->src_clk_idx]; soc_info->clk_rate[lowest_clk_lvl][soc_info->src_clk_idx];
else else
cesta_clk_rate_low = final_clk_rate; cesta_clk_rate_low = final_clk_rate;
} }

View File

@@ -66,7 +66,7 @@ int cam_jpeg_dma_init_hw(void *device_priv,
} }
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 2; axi_vote.num_paths = 2;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;

View File

@@ -69,7 +69,7 @@ int cam_jpeg_enc_init_hw(void *device_priv,
} }
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 2; axi_vote.num_paths = 2;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;

View File

@@ -25,7 +25,7 @@ int cam_lrme_soc_enable_resources(struct cam_hw_info *lrme_hw)
int rc = 0; int rc = 0;
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 2; axi_vote.num_paths = 2;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_READ;
@@ -45,7 +45,7 @@ int cam_lrme_soc_enable_resources(struct cam_hw_info *lrme_hw)
} }
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_SVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc) { if (rc) {
CAM_ERR(CAM_LRME, CAM_ERR(CAM_LRME,
"Failed to enable platform resource, rc %d", rc); "Failed to enable platform resource, rc %d", rc);

View File

@@ -203,7 +203,7 @@ int cam_ope_init_hw(void *device_priv,
} }
cpas_vote->ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote->ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote->ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote->ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote->axi_vote.num_paths = 1; cpas_vote->axi_vote.num_paths = 1;
cpas_vote->axi_vote.axi_path[0].path_data_type = cpas_vote->axi_vote.axi_path[0].path_data_type =
CAM_AXI_PATH_DATA_ALL; CAM_AXI_PATH_DATA_ALL;

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#include <linux/module.h> #include <linux/module.h>
@@ -199,7 +199,7 @@ static int cam_ope_component_bind(struct device *dev,
goto enable_soc_failed; goto enable_soc_failed;
} }
cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE;
cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
cpas_vote.axi_vote.num_paths = 1; cpas_vote.axi_vote.num_paths = 1;
cpas_vote.axi_vote.axi_path[0].path_data_type = cpas_vote.axi_vote.axi_path[0].path_data_type =
CAM_AXI_PATH_DATA_OPE_WR_VID; CAM_AXI_PATH_DATA_OPE_WR_VID;

View File

@@ -158,7 +158,7 @@ int cam_cci_init(struct v4l2_subdev *sd,
} }
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL; axi_vote.axi_path[0].path_data_type = CAM_AXI_PATH_DATA_ALL;
axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE; axi_vote.axi_path[0].transac_type = CAM_AXI_TRANSACTION_WRITE;
@@ -177,7 +177,7 @@ int cam_cci_init(struct v4l2_subdev *sd,
/* Enable Regulators and IRQ*/ /* Enable Regulators and IRQ*/
rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, rc = cam_soc_util_enable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true,
CAM_LOWSVS_VOTE, true); soc_info->lowest_clk_level, true);
if (rc < 0) { if (rc < 0) {
CAM_DBG(CAM_CCI, "CCI%d_I2C_M%d request platform resources failed, rc: %d", CAM_DBG(CAM_CCI, "CCI%d_I2C_M%d request platform resources failed, rc: %d",
cci_dev->soc_info.index, master, rc); cci_dev->soc_info.index, master, rc);

View File

@@ -116,7 +116,7 @@ static int cam_csiphy_cpas_ops(
if (start) { if (start) {
ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.type = CAM_VOTE_ABSOLUTE;
ahb_vote.vote.level = CAM_LOWSVS_VOTE; ahb_vote.vote.level = CAM_LOWSVS_D1_VOTE;
axi_vote.num_paths = 1; axi_vote.num_paths = 1;
axi_vote.axi_path[0].path_data_type = axi_vote.axi_path[0].path_data_type =
CAM_AXI_PATH_DATA_ALL; CAM_AXI_PATH_DATA_ALL;
@@ -2523,7 +2523,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
if (soc_info->is_clk_drv_en && param->use_hw_client_voting) { if (soc_info->is_clk_drv_en && param->use_hw_client_voting) {
if (param->is_drv_config_en) if (param->is_drv_config_en)
clk_vote_level_low = CAM_LOWSVS_VOTE; clk_vote_level_low = soc_info->lowest_clk_level;
rc = cam_soc_util_set_clk_rate_level(&csiphy_dev->soc_info, rc = cam_soc_util_set_clk_rate_level(&csiphy_dev->soc_info,
param->conn_csid_idx, clk_vote_level_high, param->conn_csid_idx, clk_vote_level_high,

View File

@@ -260,8 +260,9 @@ static void cam_csiphy_subdev_handle_message(struct v4l2_subdev *sd,
phy_idx, clk_rate, rc); phy_idx, clk_rate, rc);
} else if (halt_resume_info->csid_state == CAM_SUBDEV_PHY_CSID_RESUME) { } else if (halt_resume_info->csid_state == CAM_SUBDEV_PHY_CSID_RESUME) {
int32_t src_idx = csiphy_dev->soc_info.src_clk_idx; int32_t src_idx = csiphy_dev->soc_info.src_clk_idx;
uint32_t lowest_clk_level = csiphy_dev->soc_info.lowest_clk_level;
clk_rate = csiphy_dev->soc_info.clk_rate[CAM_LOWSVS_VOTE][src_idx]; clk_rate = csiphy_dev->soc_info.clk_rate[lowest_clk_level][src_idx];
rc = cam_soc_util_set_src_clk_rate(&csiphy_dev->soc_info, rc = cam_soc_util_set_src_clk_rate(&csiphy_dev->soc_info,
CAM_CLK_SW_CLIENT_IDX, clk_rate, 0); CAM_CLK_SW_CLIENT_IDX, clk_rate, 0);

View File

@@ -214,7 +214,7 @@ int32_t cam_csiphy_enable_hw(struct csiphy_device *csiphy_dev, int32_t index)
if (soc_info->is_clk_drv_en && param->use_hw_client_voting && param->is_drv_config_en) { if (soc_info->is_clk_drv_en && param->use_hw_client_voting && param->is_drv_config_en) {
int clk_vote_level_high = vote_level; int clk_vote_level_high = vote_level;
int clk_vote_level_low = CAM_LOWSVS_VOTE; int clk_vote_level_low = soc_info->lowest_clk_level;
rc = cam_soc_util_set_clk_rate_level(soc_info, param->conn_csid_idx, rc = cam_soc_util_set_clk_rate_level(soc_info, param->conn_csid_idx,
clk_vote_level_high, clk_vote_level_low, false); clk_vote_level_high, clk_vote_level_low, false);

View File

@@ -1020,18 +1020,20 @@ const char *cam_soc_util_get_string_from_level(enum cam_vote_level level)
return ""; return "";
case CAM_MINSVS_VOTE: case CAM_MINSVS_VOTE:
return "MINSVS[1]"; return "MINSVS[1]";
case CAM_LOWSVS_D1_VOTE:
return "LOWSVSD1[2]";
case CAM_LOWSVS_VOTE: case CAM_LOWSVS_VOTE:
return "LOWSVS[2]"; return "LOWSVS[3]";
case CAM_SVS_VOTE: case CAM_SVS_VOTE:
return "SVS[3]"; return "SVS[4]";
case CAM_SVSL1_VOTE: case CAM_SVSL1_VOTE:
return "SVSL1[4]"; return "SVSL1[5]";
case CAM_NOMINAL_VOTE: case CAM_NOMINAL_VOTE:
return "NOM[5]"; return "NOM[6]";
case CAM_NOMINALL1_VOTE: case CAM_NOMINALL1_VOTE:
return "NOML1[6]"; return "NOML1[7]";
case CAM_TURBO_VOTE: case CAM_TURBO_VOTE:
return "TURBO[7]"; return "TURBO[8]";
default: default:
return ""; return "";
} }
@@ -1212,6 +1214,8 @@ int cam_soc_util_get_level_from_string(const char *string,
*level = CAM_SUSPEND_VOTE; *level = CAM_SUSPEND_VOTE;
} else if (!strcmp(string, "minsvs")) { } else if (!strcmp(string, "minsvs")) {
*level = CAM_MINSVS_VOTE; *level = CAM_MINSVS_VOTE;
} else if (!strcmp(string, "lowsvsd1")) {
*level = CAM_LOWSVS_D1_VOTE;
} else if (!strcmp(string, "lowsvs")) { } else if (!strcmp(string, "lowsvs")) {
*level = CAM_LOWSVS_VOTE; *level = CAM_LOWSVS_VOTE;
} else if (!strcmp(string, "svs")) { } else if (!strcmp(string, "svs")) {
@@ -2223,7 +2227,7 @@ int cam_soc_util_set_clk_rate_level(struct cam_hw_soc_info *soc_info,
{ {
int i, rc = 0; int i, rc = 0;
enum cam_vote_level apply_level_high; enum cam_vote_level apply_level_high;
enum cam_vote_level apply_level_low = CAM_LOWSVS_VOTE; enum cam_vote_level apply_level_low = soc_info->lowest_clk_level;
unsigned long applied_clk_rate; unsigned long applied_clk_rate;
if ((soc_info->num_clk == 0) || if ((soc_info->num_clk == 0) ||

View File

@@ -66,19 +66,21 @@
/** /**
* enum cam_vote_level - Enum for voting level * enum cam_vote_level - Enum for voting level
* *
* @CAM_SUSPEND_VOTE : Suspend vote * @CAM_SUSPEND_VOTE : Suspend vote
* @CAM_MINSVS_VOTE : Min SVS vote * @CAM_MINSVS_VOTE : Min SVS vote
* @CAM_LOWSVS_VOTE : Low SVS vote * @CAM_LOWSVS_D1_VOTE : Low SVS D1 vote
* @CAM_SVS_VOTE : SVS vote * @CAM_LOWSVS_VOTE : Low SVS vote
* @CAM_SVSL1_VOTE : SVS Plus vote * @CAM_SVS_VOTE : SVS vote
* @CAM_NOMINAL_VOTE : Nominal vote * @CAM_SVSL1_VOTE : SVS Plus vote
* @CAM_NOMINALL1_VOTE: Nominal plus vote * @CAM_NOMINAL_VOTE : Nominal vote
* @CAM_TURBO_VOTE : Turbo vote * @CAM_NOMINALL1_VOTE : Nominal plus vote
* @CAM_MAX_VOTE : Max voting level, This is invalid level. * @CAM_TURBO_VOTE : Turbo vote
* @CAM_MAX_VOTE : Max voting level, This is invalid level.
*/ */
enum cam_vote_level { enum cam_vote_level {
CAM_SUSPEND_VOTE, CAM_SUSPEND_VOTE,
CAM_MINSVS_VOTE, CAM_MINSVS_VOTE,
CAM_LOWSVS_D1_VOTE,
CAM_LOWSVS_VOTE, CAM_LOWSVS_VOTE,
CAM_SVS_VOTE, CAM_SVS_VOTE,
CAM_SVSL1_VOTE, CAM_SVSL1_VOTE,