Lines Matching refs:r
245 static int vrange_find_value(struct bd71837_vrange *r, unsigned int sel, in vrange_find_value() argument
248 if (!val || sel < r->min_sel || sel > r->max_sel) in vrange_find_value()
251 *val = r->min_volt + r->step * (sel - r->min_sel); in vrange_find_value()
255 static int vrange_find_selector(struct bd71837_vrange *r, int val, in vrange_find_selector() argument
259 int num_vals = r->max_sel - r->min_sel + 1; in vrange_find_selector()
261 if (val >= r->min_volt && in vrange_find_selector()
262 val <= r->min_volt + r->step * (num_vals - 1)) { in vrange_find_selector()
263 if (r->step) { in vrange_find_selector()
264 *sel = r->min_sel + ((val - r->min_volt) / r->step); in vrange_find_selector()
267 *sel = r->min_sel; in vrange_find_selector()
338 struct bd71837_vrange *r = &plat->ranges[i]; in bd71837_set_value() local
340 found = !vrange_find_selector(r, uvolt, &sel); in bd71837_set_value()
348 range = r->rangeval; in bd71837_set_value()
349 found = !vrange_find_value(r, sel, &tmp); in bd71837_set_value()
385 struct bd71837_vrange *r = &plat->ranges[i]; in bd71837_get_value() local
388 r->rangeval)) in bd71837_get_value()
391 if (!vrange_find_value(r, reg, &tmp)) in bd71837_get_value()