Loading drivers/clk/clk.c +8 −3 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ static int clk_update_vdd(struct clk_vdd_class *vdd_class) pr_debug("Set Voltage level Min %d, Max %d\n", uv[new_base + i], uv[max_lvl + i]); rc = regulator_set_voltage(r[i], uv[new_base + i], uv[max_lvl + i]); vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); if (rc) goto set_voltage_fail; Loading @@ -578,11 +578,13 @@ static int clk_update_vdd(struct clk_vdd_class *vdd_class) return rc; enable_disable_fail: regulator_set_voltage(r[i], uv[cur_base + i], uv[max_lvl + i]); regulator_set_voltage(r[i], uv[cur_base + i], vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); set_voltage_fail: for (i--; i >= 0; i--) { regulator_set_voltage(r[i], uv[cur_base + i], uv[max_lvl + i]); regulator_set_voltage(r[i], uv[cur_base + i], vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels) regulator_disable(r[i]); else if (level == 0) Loading Loading @@ -693,6 +695,9 @@ static int clk_vdd_class_init(struct clk_vdd_class *vdd) { struct clk_handoff_vdd *v; if (vdd->skip_handoff) return 0; list_for_each_entry(v, &clk_handoff_vdd_list, list) { if (v->vdd_class == vdd) return 0; Loading drivers/clk/qcom/gpucc-sdm845.c +3 −0 Original line number Diff line number Diff line Loading @@ -564,6 +564,9 @@ static int gpu_cc_gfx_sdm845_probe(struct platform_device *pdev) return PTR_ERR(vdd_gfx.regulator[0]); } /* Avoid turning on the rail during clock registration */ vdd_gfx.skip_handoff = true; clk_fabia_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); ret = qcom_cc_really_probe(pdev, &gpu_cc_gfx_sdm845_desc, regmap); Loading include/linux/clk-provider.h +4 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,8 @@ struct regulator; regulator * @level_votes: array of votes for each level * @num_levels: specifies the size of level_votes array * @skip_handoff: do not vote for the max possible voltage during init * @use_max_uV: use INT_MAX for max_uV when calling regulator_set_voltage * @cur_level: the currently set voltage level * @lock: lock to protect this struct */ Loading @@ -288,6 +290,8 @@ struct clk_vdd_class { int *vdd_uv; int *level_votes; int num_levels; bool skip_handoff; bool use_max_uV; unsigned long cur_level; struct mutex lock; }; Loading Loading
drivers/clk/clk.c +8 −3 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ static int clk_update_vdd(struct clk_vdd_class *vdd_class) pr_debug("Set Voltage level Min %d, Max %d\n", uv[new_base + i], uv[max_lvl + i]); rc = regulator_set_voltage(r[i], uv[new_base + i], uv[max_lvl + i]); vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); if (rc) goto set_voltage_fail; Loading @@ -578,11 +578,13 @@ static int clk_update_vdd(struct clk_vdd_class *vdd_class) return rc; enable_disable_fail: regulator_set_voltage(r[i], uv[cur_base + i], uv[max_lvl + i]); regulator_set_voltage(r[i], uv[cur_base + i], vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); set_voltage_fail: for (i--; i >= 0; i--) { regulator_set_voltage(r[i], uv[cur_base + i], uv[max_lvl + i]); regulator_set_voltage(r[i], uv[cur_base + i], vdd_class->use_max_uV ? INT_MAX : uv[max_lvl + i]); if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels) regulator_disable(r[i]); else if (level == 0) Loading Loading @@ -693,6 +695,9 @@ static int clk_vdd_class_init(struct clk_vdd_class *vdd) { struct clk_handoff_vdd *v; if (vdd->skip_handoff) return 0; list_for_each_entry(v, &clk_handoff_vdd_list, list) { if (v->vdd_class == vdd) return 0; Loading
drivers/clk/qcom/gpucc-sdm845.c +3 −0 Original line number Diff line number Diff line Loading @@ -564,6 +564,9 @@ static int gpu_cc_gfx_sdm845_probe(struct platform_device *pdev) return PTR_ERR(vdd_gfx.regulator[0]); } /* Avoid turning on the rail during clock registration */ vdd_gfx.skip_handoff = true; clk_fabia_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); ret = qcom_cc_really_probe(pdev, &gpu_cc_gfx_sdm845_desc, regmap); Loading
include/linux/clk-provider.h +4 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,8 @@ struct regulator; regulator * @level_votes: array of votes for each level * @num_levels: specifies the size of level_votes array * @skip_handoff: do not vote for the max possible voltage during init * @use_max_uV: use INT_MAX for max_uV when calling regulator_set_voltage * @cur_level: the currently set voltage level * @lock: lock to protect this struct */ Loading @@ -288,6 +290,8 @@ struct clk_vdd_class { int *vdd_uv; int *level_votes; int num_levels; bool skip_handoff; bool use_max_uV; unsigned long cur_level; struct mutex lock; }; Loading