0001
0002
0003
0004 #ifndef LINEAR_RANGE_H
0005 #define LINEAR_RANGE_H
0006
0007 #include <linux/types.h>
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 struct linear_range {
0023 unsigned int min;
0024 unsigned int min_sel;
0025 unsigned int max_sel;
0026 unsigned int step;
0027 };
0028
0029 unsigned int linear_range_values_in_range(const struct linear_range *r);
0030 unsigned int linear_range_values_in_range_array(const struct linear_range *r,
0031 int ranges);
0032 unsigned int linear_range_get_max_value(const struct linear_range *r);
0033
0034 int linear_range_get_value(const struct linear_range *r, unsigned int selector,
0035 unsigned int *val);
0036 int linear_range_get_value_array(const struct linear_range *r, int ranges,
0037 unsigned int selector, unsigned int *val);
0038 int linear_range_get_selector_low(const struct linear_range *r,
0039 unsigned int val, unsigned int *selector,
0040 bool *found);
0041 int linear_range_get_selector_high(const struct linear_range *r,
0042 unsigned int val, unsigned int *selector,
0043 bool *found);
0044 void linear_range_get_selector_within(const struct linear_range *r,
0045 unsigned int val, unsigned int *selector);
0046 int linear_range_get_selector_low_array(const struct linear_range *r,
0047 int ranges, unsigned int val,
0048 unsigned int *selector, bool *found);
0049
0050 #endif