Lines Matching refs:uV

69 static int max77686_buck_volt2hex(int buck, int uV)  in max77686_buck_volt2hex()  argument
79 hex = (uV - MAX77686_BUCK_UV_LMIN) / MAX77686_BUCK_UV_LSTEP; in max77686_buck_volt2hex()
90 hex = (uV - MAX77686_BUCK_UV_HMIN) / MAX77686_BUCK_UV_HSTEP; in max77686_buck_volt2hex()
98 pr_err("Value: %d uV is wrong for BUCK%d", uV, buck); in max77686_buck_volt2hex()
104 unsigned uV = 0; in max77686_buck_hex2volt() local
119 uV = hex * MAX77686_BUCK_UV_LSTEP + MAX77686_BUCK_UV_LMIN; in max77686_buck_hex2volt()
127 uV = hex * MAX77686_BUCK_UV_HSTEP + MAX77686_BUCK_UV_HMIN; in max77686_buck_hex2volt()
131 return uV; in max77686_buck_hex2volt()
138 static int max77686_ldo_volt2hex(int ldo, int uV) in max77686_ldo_volt2hex() argument
149 hex = (uV - MAX77686_LDO_UV_MIN) / MAX77686_LDO_UV_LSTEP; in max77686_ldo_volt2hex()
153 hex = (uV - MAX77686_LDO_UV_MIN) / MAX77686_LDO_UV_HSTEP; in max77686_ldo_volt2hex()
160 pr_err("Value: %d uV is wrong for LDO%d", uV, ldo); in max77686_ldo_volt2hex()
166 unsigned int uV = 0; in max77686_ldo_hex2volt() local
179 uV = hex * MAX77686_LDO_UV_LSTEP + MAX77686_LDO_UV_MIN; in max77686_ldo_hex2volt()
183 uV = hex * MAX77686_LDO_UV_HSTEP + MAX77686_LDO_UV_MIN; in max77686_ldo_hex2volt()
186 return uV; in max77686_ldo_hex2volt()
317 static int max77686_ldo_val(struct udevice *dev, int op, int *uV) in max77686_ldo_val() argument
324 *uV = 0; in max77686_ldo_val()
343 *uV = ret; in max77686_ldo_val()
347 hex = max77686_ldo_volt2hex(ldo, *uV); in max77686_ldo_val()
358 static int max77686_buck_val(struct udevice *dev, int op, int *uV) in max77686_buck_val() argument
371 *uV = 0; in max77686_buck_val()
397 *uV = ret; in max77686_buck_val()
401 hex = max77686_buck_volt2hex(buck, *uV); in max77686_buck_val()
673 int uV; in ldo_get_value() local
676 ret = max77686_ldo_val(dev, PMIC_OP_GET, &uV); in ldo_get_value()
680 return uV; in ldo_get_value()
683 static int ldo_set_value(struct udevice *dev, int uV) in ldo_set_value() argument
685 return max77686_ldo_val(dev, PMIC_OP_SET, &uV); in ldo_set_value()
737 int uV; in buck_get_value() local
740 ret = max77686_buck_val(dev, PMIC_OP_GET, &uV); in buck_get_value()
744 return uV; in buck_get_value()
747 static int buck_set_value(struct udevice *dev, int uV) in buck_set_value() argument
749 return max77686_buck_val(dev, PMIC_OP_SET, &uV); in buck_set_value()