Lines Matching refs:vdd_last
142 static inline int wait_for_voltage_change(int vdd_last) in wait_for_voltage_change() argument
148 for (timeout = 0; abs(vdd_last - vdd_current) <= 4 && in wait_for_voltage_change()
165 int timeout, vdd_current, vdd_last; in wait_for_voltage_stable() local
167 vdd_last = read_voltage(); in wait_for_voltage_stable()
171 for (timeout = 0; abs(vdd_last - vdd_current) >= 4 && in wait_for_voltage_stable()
173 vdd_last = vdd_current; in wait_for_voltage_stable()
187 int wait, vdd_last; in set_voltage() local
189 vdd_last = read_voltage(); in set_voltage()
191 wait = wait_for_voltage_change(vdd_last); in set_voltage()
197 vdd_last = wait_for_voltage_stable(wait); in set_voltage()
198 if (vdd_last < 0) in set_voltage()
200 debug("VID: Current voltage is %d mV\n", vdd_last); in set_voltage()
202 return vdd_last; in set_voltage()
213 int vdd_target, vdd_current, vdd_last; in adjust_vdd() local
304 vdd_last = read_voltage(); in adjust_vdd()
305 if (vdd_last < 0) { in adjust_vdd()
310 debug("VID: Core voltage is at %d mV\n", vdd_last); in adjust_vdd()
316 while (vdd_last > 0 && vid_current < 0x80 && in adjust_vdd()
317 vdd_last > (vdd_target + 8)) { in adjust_vdd()
319 vdd_last = set_voltage(vid_current); in adjust_vdd()
325 while (vdd_last > 0 && vid_current >= 0x40 && in adjust_vdd()
326 vdd_last < vdd_target + 2) { in adjust_vdd()
328 vdd_last = set_voltage(vid_current); in adjust_vdd()
330 if (vdd_last > 0) in adjust_vdd()
331 printf("VID: Core voltage %d mV\n", vdd_last); in adjust_vdd()