Lines Matching refs:sel
45 static int stpmic1_output_find_uv(int sel, in stpmic1_output_find_uv() argument
53 if (sel >= range->min_sel && sel <= range->max_sel) in stpmic1_output_find_uv()
55 (sel - range->min_sel) * range->step; in stpmic1_output_find_uv()
142 int sel; in stpmic1_buck_get_uv() local
144 sel = pmic_reg_read(dev, STPMIC1_BUCKX_MAIN_CR(buck)); in stpmic1_buck_get_uv()
145 if (sel < 0) in stpmic1_buck_get_uv()
146 return sel; in stpmic1_buck_get_uv()
148 sel &= STPMIC1_BUCK_VOUT_MASK; in stpmic1_buck_get_uv()
149 sel >>= STPMIC1_BUCK_VOUT_SHIFT; in stpmic1_buck_get_uv()
151 return stpmic1_output_find_uv(sel, &buck_voltage_range[buck]); in stpmic1_buck_get_uv()
161 int sel, buck = dev->driver_data - 1; in stpmic1_buck_set_value() local
163 sel = stpmic1_output_find_sel(uv, &buck_voltage_range[buck]); in stpmic1_buck_set_value()
164 if (sel < 0) in stpmic1_buck_set_value()
165 return sel; in stpmic1_buck_set_value()
170 sel << STPMIC1_BUCK_VOUT_SHIFT); in stpmic1_buck_set_value()
314 int sel, ldo = dev->driver_data - 1; in stpmic1_ldo_get_value() local
316 sel = pmic_reg_read(dev->parent, STPMIC1_LDOX_MAIN_CR(ldo)); in stpmic1_ldo_get_value()
317 if (sel < 0) in stpmic1_ldo_get_value()
318 return sel; in stpmic1_ldo_get_value()
324 sel &= STPMIC1_LDO12356_VOUT_MASK; in stpmic1_ldo_get_value()
325 sel >>= STPMIC1_LDO12356_VOUT_SHIFT; in stpmic1_ldo_get_value()
328 if (ldo == STPMIC1_LDO3 && sel == STPMIC1_LDO3_DDR_SEL) in stpmic1_ldo_get_value()
331 return stpmic1_output_find_uv(sel, &ldo_voltage_range[ldo]); in stpmic1_ldo_get_value()
336 int sel, ldo = dev->driver_data - 1; in stpmic1_ldo_set_value() local
342 sel = stpmic1_output_find_sel(uv, &ldo_voltage_range[ldo]); in stpmic1_ldo_set_value()
343 if (sel < 0) in stpmic1_ldo_set_value()
344 return sel; in stpmic1_ldo_set_value()
349 sel << STPMIC1_LDO12356_VOUT_SHIFT); in stpmic1_ldo_set_value()