Lines Matching +full:step +full:- +full:down
5 * SPDX-License-Identifier: GPL-2.0+
37 int retval = -1; in tps6586x_read()
60 int retval = -1; in tps6586x_write()
86 * @return 0 if ok, -1 on error
99 if (ctrl1 == -1 || ctrl2 == -1) in read_voltages()
100 return -ENOTSUPP; in read_voltages()
106 if (*sm0 == -1 || *sm1 == -1) in read_voltages()
107 return -ENOTSUPP; in read_voltages()
120 * Only one supply is needed in u-boot. set both v1 and v2 to in set_voltage()
132 return -ENOTSUPP; in set_voltage()
137 static int calculate_next_voltage(int voltage, int target, int step) in calculate_next_voltage() argument
139 int diff = voltage < target ? step : -step; in calculate_next_voltage()
141 if (abs(target - voltage) > step) in calculate_next_voltage()
156 if (ret != -1) { in tps6586x_set_pwm_mode()
163 if (ret == -1) in tps6586x_set_pwm_mode()
169 int tps6586x_adjust_sm0_sm1(int sm0_target, int sm1_target, int step, int rate, in tps6586x_adjust_sm0_sm1() argument
180 return -EINVAL; in tps6586x_adjust_sm0_sm1()
189 if (min_sm0_over_sm1 != -1 && sm0 < sm1 + min_sm0_over_sm1) { in tps6586x_adjust_sm0_sm1()
192 return -EINVAL; in tps6586x_adjust_sm0_sm1()
200 * So, find out which vdd to adjust first in each step. in tps6586x_adjust_sm0_sm1()
205 * case 2: both sm0 and sm1 need to move down in tps6586x_adjust_sm0_sm1()
208 * case 3: sm0 moves down and sm1 moves up in tps6586x_adjust_sm0_sm1()
211 * Adjust vdd_core and vdd_cpu one step at a time until they reach in tps6586x_adjust_sm0_sm1()
218 debug("%d-%d %d-%d ", sm0, sm0_target, sm1, sm1_target); in tps6586x_adjust_sm0_sm1()
223 * otherwise, hold down until new sm1 is set. in tps6586x_adjust_sm0_sm1()
225 sm0 = calculate_next_voltage(sm0, sm0_target, step); in tps6586x_adjust_sm0_sm1()
233 sm1 = calculate_next_voltage(sm1, sm1_target, step); in tps6586x_adjust_sm0_sm1()
241 debug("%d-%d %d-%d done\n", sm0, sm0_target, sm1, sm1_target); in tps6586x_adjust_sm0_sm1()
243 return bad ? -EINVAL : 0; in tps6586x_adjust_sm0_sm1()