Loading drivers/clk/qcom/clock.c +7 −4 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ static int update_vdd(struct clk_vdd_class *vdd_class) new_base = level * n_reg; for (i = 0; i < vdd_class->num_regulators; 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 Loading @@ -118,16 +118,19 @@ enable_disable_fail: * previous voltage setting for r[i] first. */ if (ua) { 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]); regulator_set_optimum_mode(r[i], ua[cur_base + i]); } set_mode_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 (ua) regulator_set_optimum_mode(r[i], ua[cur_base + i]); if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels) Loading include/linux/clk/msm-clk-provider.h +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ static inline void clk_debug_print_hw(struct clk *clk, struct seq_file *f) {} * @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 * This is useful when different vdd_class share same regulator. * @cur_level: the currently set voltage level * @lock: lock to protect this struct */ Loading @@ -86,6 +88,7 @@ struct clk_vdd_class { int *level_votes; int num_levels; bool skip_handoff; bool use_max_uV; unsigned long cur_level; struct mutex lock; }; Loading Loading
drivers/clk/qcom/clock.c +7 −4 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ static int update_vdd(struct clk_vdd_class *vdd_class) new_base = level * n_reg; for (i = 0; i < vdd_class->num_regulators; 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 Loading @@ -118,16 +118,19 @@ enable_disable_fail: * previous voltage setting for r[i] first. */ if (ua) { 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]); regulator_set_optimum_mode(r[i], ua[cur_base + i]); } set_mode_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 (ua) regulator_set_optimum_mode(r[i], ua[cur_base + i]); if (cur_lvl == 0 || cur_lvl == vdd_class->num_levels) Loading
include/linux/clk/msm-clk-provider.h +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ static inline void clk_debug_print_hw(struct clk *clk, struct seq_file *f) {} * @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 * This is useful when different vdd_class share same regulator. * @cur_level: the currently set voltage level * @lock: lock to protect this struct */ Loading @@ -86,6 +88,7 @@ struct clk_vdd_class { int *level_votes; int num_levels; bool skip_handoff; bool use_max_uV; unsigned long cur_level; struct mutex lock; }; Loading