Lines Matching refs:vdd_last
141 static inline int wait_for_voltage_change(int vdd_last) in wait_for_voltage_change() argument
147 for (timeout = 0; abs(vdd_last - vdd_current) <= 4 && in wait_for_voltage_change()
164 int timeout, vdd_current, vdd_last; in wait_for_voltage_stable() local
166 vdd_last = read_voltage(); in wait_for_voltage_stable()
170 for (timeout = 0; abs(vdd_last - vdd_current) >= 4 && in wait_for_voltage_stable()
172 vdd_last = vdd_current; in wait_for_voltage_stable()
186 int wait, vdd_last; in set_voltage() local
188 vdd_last = read_voltage(); in set_voltage()
190 wait = wait_for_voltage_change(vdd_last); in set_voltage()
196 vdd_last = wait_for_voltage_stable(wait); in set_voltage()
197 if (vdd_last < 0) in set_voltage()
199 debug("VID: Current voltage is %d mV\n", vdd_last); in set_voltage()
201 return vdd_last; in set_voltage()
212 int vdd_target, vdd_current, vdd_last; in adjust_vdd() local
303 vdd_last = read_voltage(); in adjust_vdd()
304 if (vdd_last < 0) { in adjust_vdd()
309 debug("VID: Core voltage is at %d mV\n", vdd_last); in adjust_vdd()
315 while (vdd_last > 0 && vid_current < 0x80 && in adjust_vdd()
316 vdd_last > (vdd_target + 8)) { in adjust_vdd()
318 vdd_last = set_voltage(vid_current); in adjust_vdd()
324 while (vdd_last > 0 && vid_current >= 0x40 && in adjust_vdd()
325 vdd_last < vdd_target + 2) { in adjust_vdd()
327 vdd_last = set_voltage(vid_current); in adjust_vdd()
329 if (vdd_last > 0) in adjust_vdd()
330 printf("VID: Core voltage %d mV\n", vdd_last); in adjust_vdd()