• Home
  • Raw
  • Download

Lines Matching refs:r

27 unsigned int linear_range_values_in_range(const struct linear_range *r)  in linear_range_values_in_range()  argument
29 if (!r) in linear_range_values_in_range()
31 return r->max_sel - r->min_sel + 1; in linear_range_values_in_range()
46 unsigned int linear_range_values_in_range_array(const struct linear_range *r, in linear_range_values_in_range_array() argument
54 values = linear_range_values_in_range(&r[i]); in linear_range_values_in_range_array()
70 unsigned int linear_range_get_max_value(const struct linear_range *r) in linear_range_get_max_value() argument
72 return r->min + (r->max_sel - r->min_sel) * r->step; in linear_range_get_max_value()
87 int linear_range_get_value(const struct linear_range *r, unsigned int selector, in linear_range_get_value() argument
90 if (r->min_sel > selector || r->max_sel < selector) in linear_range_get_value()
93 *val = r->min + (selector - r->min_sel) * r->step; in linear_range_get_value()
111 int linear_range_get_value_array(const struct linear_range *r, int ranges, in linear_range_get_value_array() argument
117 if (r[i].min_sel <= selector && r[i].max_sel >= selector) in linear_range_get_value_array()
118 return linear_range_get_value(&r[i], selector, val); in linear_range_get_value_array()
138 int linear_range_get_selector_low(const struct linear_range *r, in linear_range_get_selector_low() argument
144 if (r->min > val) in linear_range_get_selector_low()
147 if (linear_range_get_max_value(r) < val) { in linear_range_get_selector_low()
148 *selector = r->max_sel; in linear_range_get_selector_low()
154 if (r->step == 0) in linear_range_get_selector_low()
155 *selector = r->min_sel; in linear_range_get_selector_low()
157 *selector = (val - r->min) / r->step + r->min_sel; in linear_range_get_selector_low()
182 int linear_range_get_selector_low_array(const struct linear_range *r, in linear_range_get_selector_low_array() argument
192 tmpret = linear_range_get_selector_low(&r[i], val, selector, in linear_range_get_selector_low_array()
219 int linear_range_get_selector_high(const struct linear_range *r, in linear_range_get_selector_high() argument
225 if (linear_range_get_max_value(r) < val) in linear_range_get_selector_high()
228 if (r->min > val) { in linear_range_get_selector_high()
229 *selector = r->min_sel; in linear_range_get_selector_high()
235 if (r->step == 0) in linear_range_get_selector_high()
236 *selector = r->max_sel; in linear_range_get_selector_high()
238 *selector = DIV_ROUND_UP(val - r->min, r->step) + r->min_sel; in linear_range_get_selector_high()
255 void linear_range_get_selector_within(const struct linear_range *r, in linear_range_get_selector_within() argument
258 if (r->min > val) { in linear_range_get_selector_within()
259 *selector = r->min_sel; in linear_range_get_selector_within()
263 if (linear_range_get_max_value(r) < val) { in linear_range_get_selector_within()
264 *selector = r->max_sel; in linear_range_get_selector_within()
268 if (r->step == 0) in linear_range_get_selector_within()
269 *selector = r->min_sel; in linear_range_get_selector_within()
271 *selector = (val - r->min) / r->step + r->min_sel; in linear_range_get_selector_within()