Lines Matching refs:uV
47 unsigned int uV = 0; in s2mps11_buck_hex2volt() local
59 uV = hex * S2MPS11_BUCK_HSTEP + S2MPS11_BUCK_UV_HMIN; in s2mps11_buck_hex2volt()
64 uV = hex * S2MPS11_BUCK9_STEP * 2 + S2MPS11_BUCK9_UV_MIN; in s2mps11_buck_hex2volt()
72 uV = hex * S2MPS11_BUCK_LSTEP + S2MPS11_BUCK_UV_MIN; in s2mps11_buck_hex2volt()
76 return uV; in s2mps11_buck_hex2volt()
82 static int s2mps11_buck_volt2hex(int buck, int uV) in s2mps11_buck_volt2hex() argument
90 hex = (uV - S2MPS11_BUCK_UV_HMIN) / S2MPS11_BUCK_HSTEP; in s2mps11_buck_volt2hex()
96 hex = (uV - S2MPS11_BUCK9_UV_MIN) / S2MPS11_BUCK9_STEP; in s2mps11_buck_volt2hex()
101 hex = (uV - S2MPS11_BUCK_UV_MIN) / S2MPS11_BUCK_LSTEP; in s2mps11_buck_volt2hex()
113 pr_err("Value: %d uV is wrong for BUCK%d", uV, buck); in s2mps11_buck_volt2hex()
117 static int s2mps11_buck_val(struct udevice *dev, int op, int *uV) in s2mps11_buck_val() argument
130 *uV = 0; in s2mps11_buck_val()
152 *uV = ret; in s2mps11_buck_val()
156 hex = s2mps11_buck_volt2hex(buck, *uV); in s2mps11_buck_val()
259 int uV; in buck_get_value() local
262 ret = s2mps11_buck_val(dev, PMIC_OP_GET, &uV); in buck_get_value()
265 return uV; in buck_get_value()
268 static int buck_set_value(struct udevice *dev, int uV) in buck_set_value() argument
270 return s2mps11_buck_val(dev, PMIC_OP_SET, &uV); in buck_set_value()
337 unsigned int uV = 0; in s2mps11_ldo_hex2volt() local
352 uV = hex * S2MPS11_LDO_STEP + S2MPS11_LDO_UV_MIN; in s2mps11_ldo_hex2volt()
355 uV = hex * S2MPS11_LDO_STEP * 2 + S2MPS11_LDO_UV_MIN; in s2mps11_ldo_hex2volt()
359 return uV; in s2mps11_ldo_hex2volt()
362 static int s2mps11_ldo_volt2hex(int ldo, int uV) in s2mps11_ldo_volt2hex() argument
374 hex = (uV - S2MPS11_LDO_UV_MIN) / S2MPS11_LDO_STEP; in s2mps11_ldo_volt2hex()
377 hex = (uV - S2MPS11_LDO_UV_MIN) / (S2MPS11_LDO_STEP * 2); in s2mps11_ldo_volt2hex()
384 pr_err("Value: %d uV is wrong for LDO%d", uV, ldo); in s2mps11_ldo_volt2hex()
390 static int s2mps11_ldo_val(struct udevice *dev, int op, int *uV) in s2mps11_ldo_val() argument
409 *uV = 0; in s2mps11_ldo_val()
415 *uV = ret; in s2mps11_ldo_val()
419 hex = s2mps11_ldo_volt2hex(ldo, *uV); in s2mps11_ldo_val()
527 int uV; in ldo_get_value() local
530 ret = s2mps11_ldo_val(dev, PMIC_OP_GET, &uV); in ldo_get_value()
534 return uV; in ldo_get_value()
537 static int ldo_set_value(struct udevice *dev, int uV) in ldo_set_value() argument
539 return s2mps11_ldo_val(dev, PMIC_OP_SET, &uV); in ldo_set_value()