Lines Matching +full:vdd +full:- +full:l

1 // SPDX-License-Identifier: GPL-2.0+
36 int __weak board_adjust_vdd(int vdd) in board_adjust_vdd() argument
48 * accuracy. So we just check each address in a hopefully non-intrusive mode
52 * 0x08 (Verified on T1040RDB-PA,T4240RDB-PB,X-T4240RDB-16GPA)
53 * 0x09 (Verified on T1040RDB-PA)
73 return -1; in find_ir_chip_on_i2c()
117 return -1; in read_voltage_from_INA220()
150 return -1; in read_voltage_from_IR()
168 voltage_read -= board_vdd_drop_compensation(); in read_voltage_from_IR()
181 /* select the PAGE 0 using PMBus commands PAGE for VDD*/ in read_voltage_from_LTC()
185 printf("VID: failed to select VDD Page 0\n"); in read_voltage_from_LTC()
214 return -1; in read_voltage()
225 static int wait_for_new_voltage(int vdd, int i2caddress) in wait_for_new_voltage() argument
240 abs(vdd - vdd_current) > (IR_VDD_STEP_UP + IR_VDD_STEP_DOWN) && in wait_for_new_voltage()
246 return -1; in wait_for_new_voltage()
257 int timeout, vdd_current, vdd; in wait_for_voltage_stable() local
259 vdd = read_voltage(i2caddress); in wait_for_voltage_stable()
268 abs(vdd - vdd_current) > ADC_MIN_ACCURACY && in wait_for_voltage_stable()
269 timeout > 0; timeout--) { in wait_for_voltage_stable()
270 vdd = vdd_current; in wait_for_voltage_stable()
275 return -1; in wait_for_voltage_stable()
280 static int set_voltage_to_IR(int i2caddress, int vdd) in set_voltage_to_IR() argument
289 vdd += board_vdd_drop_compensation(); in set_voltage_to_IR()
291 vid = DIV_ROUND_UP(vdd - 265, 5); in set_voltage_to_IR()
293 vid = DIV_ROUND_UP(vdd - 245, 5); in set_voltage_to_IR()
300 return -1; in set_voltage_to_IR()
302 wait = wait_for_new_voltage(vdd, i2caddress); in set_voltage_to_IR()
304 return -1; in set_voltage_to_IR()
309 return -1; in set_voltage_to_IR()
317 /* this function sets the VDD and returns the value set */
318 static int set_voltage_to_LTC(int i2caddress, int vdd) in set_voltage_to_LTC() argument
320 int ret, vdd_last, vdd_target = vdd; in set_voltage_to_LTC()
324 vdd = (vdd * 4096) / 1000; in set_voltage_to_LTC()
326 /* 5-byte buffer which needs to be sent following the in set_voltage_to_LTC()
330 vdd & 0xFF, (vdd & 0xFF00) >> 8}; in set_voltage_to_LTC()
337 return -1; in set_voltage_to_LTC()
345 return -1; in set_voltage_to_LTC()
347 count--; in set_voltage_to_LTC()
348 temp = vdd_last - vdd_target; in set_voltage_to_LTC()
355 static int set_voltage(int i2caddress, int vdd) in set_voltage() argument
357 int vdd_last = -1; in set_voltage()
360 vdd_last = set_voltage_to_IR(i2caddress, vdd); in set_voltage()
362 vdd_last = set_voltage_to_LTC(i2caddress, vdd); in set_voltage()
386 static const u16 vdd[32] = { in adjust_vdd() local
422 static const uint16_t vdd[32] = { in adjust_vdd() local
458 static const uint16_t vdd[32] = { in adjust_vdd() local
502 ret = -1; in adjust_vdd()
510 ret = -1; in adjust_vdd()
523 ret = -1; in adjust_vdd()
528 ret = -1; in adjust_vdd()
534 fusesr = in_le32(&gur->dcfg_fusesr); in adjust_vdd()
541 vdd_target = vdd[vid]; in adjust_vdd()
543 /* check override variable for overriding VDD */ in adjust_vdd()
551 debug("VDD override is %lu\n", vdd_override); in adjust_vdd()
566 ret = -1; in adjust_vdd()
578 ret = -1; in adjust_vdd()
600 vdd_last > vdd_target + (IR_VDD_STEP_DOWN - 1)) { in adjust_vdd()
601 vdd_current -= IR_VDD_STEP_DOWN; in adjust_vdd()
607 ret = -1; in adjust_vdd()
615 ret = -1; in adjust_vdd()
638 static const uint16_t vdd[32] = { in adjust_vdd() local
674 ret = -1; in adjust_vdd()
682 ret = -1; in adjust_vdd()
695 ret = -1; in adjust_vdd()
700 ret = -1; in adjust_vdd()
706 fusesr = in_be32(&gur->dcfg_fusesr); in adjust_vdd()
709 * --------------------------------------- in adjust_vdd()
711 * |-------------------------------------| in adjust_vdd()
712 * | 5b00000 | 5b00001-5b11110 | 5b11111 | in adjust_vdd()
713 * ---------------+---------+-----------------+---------| in adjust_vdd()
715 * | A |----------+---------+-----------------+---------| in adjust_vdd()
719 * | A |----------+---------+-----------------+---------| in adjust_vdd()
720 * | L | 5b11111 | No VID | VID = DA_V | NO VID | in adjust_vdd()
722 * ------------------------------------------------------ in adjust_vdd()
739 vdd_target = vdd[vid]; in adjust_vdd()
741 /* check override variable for overriding VDD */ in adjust_vdd()
748 debug("VDD override is %lu\n", vdd_override); in adjust_vdd()
768 ret = -1; in adjust_vdd()
785 vdd_last > vdd_target + (IR_VDD_STEP_DOWN - 1)) { in adjust_vdd()
786 vdd_current -= IR_VDD_STEP_DOWN; in adjust_vdd()
794 ret = -1; in adjust_vdd()
812 return -1; in print_vdd()
838 return ret < 0 ? -1 : 0; in print_vdd()
871 "override VDD",
872 " - override with the voltage specified in mV, eg. 1050"
877 "read VDD",
878 " - Read the voltage specified in mV"