Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8067a780 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: qcom: Add use_max_uV support for vdd_class"

parents 648c5075 7af7e4b2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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;

@@ -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)
+3 −0
Original line number Diff line number Diff line
@@ -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
 */
@@ -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;
};