diff --git a/drivers/soc/rockchip/rockchip_opp_select.c b/drivers/soc/rockchip/rockchip_opp_select.c index 549c8b6c5b4f..e7f0644600b4 100644 --- a/drivers/soc/rockchip/rockchip_opp_select.c +++ b/drivers/soc/rockchip/rockchip_opp_select.c @@ -1390,7 +1390,7 @@ static void rockchip_init_pvtpll_table(struct device *dev, res = sip_smc_get_pvtpll_info(PVTPLL_GET_INFO, info->pvtpll_clk_id); if (res.a0) { - info->pvtpll_clk_id = UINT_MAX; + info->pvtpll_smc = false; goto out; } if (!res.a1) @@ -1698,6 +1698,7 @@ int rockchip_init_opp_info(struct device *dev, struct rockchip_opp_info *info, info->process = -EINVAL; info->volt_sel = -EINVAL; info->pvtpll_clk_id = UINT_MAX; + info->pvtpll_smc = true; info->is_runtime_active = true; mutex_init(&info->dvfs_mutex); @@ -2070,6 +2071,10 @@ static int rockchip_pvtpll_set_volt_sel(struct device *dev, if (info->pvtpll_clk_id == UINT_MAX) return 0; + if (!info->pvtpll_smc) + return rockchip_pvtpll_volt_sel_adjust(info->pvtpll_clk_id, + info->volt_sel); + res = sip_smc_pvtpll_config(PVTPLL_VOLT_SEL, info->pvtpll_clk_id, (u32)info->volt_sel, 0, 0, 0, 0); if (res.a0) diff --git a/include/soc/rockchip/rockchip_opp_select.h b/include/soc/rockchip/rockchip_opp_select.h index f448b3814508..e11c4cccd4bb 100644 --- a/include/soc/rockchip/rockchip_opp_select.h +++ b/include/soc/rockchip/rockchip_opp_select.h @@ -97,6 +97,7 @@ struct pvtpll_opp_table { * @init_freq: Set the initial frequency when init opp table. * @is_rate_volt_checked: Marks if device has checked initial rate and voltage. * @pvtpll_clk_id: Device's clock id. + * @pvtpll_smc: Marks if smc call of pvtpll is available. * @pvtpll_low_temp: Marks if device has low temperature pvtpll config. */ struct rockchip_opp_info { @@ -138,6 +139,7 @@ struct rockchip_opp_info { bool is_rate_volt_checked; u32 pvtpll_clk_id; + bool pvtpll_smc; bool pvtpll_low_temp; };