Lines Matching +full:2 +full:- +full:3

1 // SPDX-License-Identifier: GPL-2.0+
25 1, 2, 4, 8, 16, 32, 64, 128, in test_find_closest()
27 static u32 wd_timeout_table[] = { 2, 4, 6, 8, 16, 32, 48, 64 }; in test_find_closest()
28 static int array_prog1a[] = { 1, 2, 3, 4, 5 }; in test_find_closest()
29 static u32 array_prog1b[] = { 2, 3, 4, 5, 6 }; in test_find_closest()
30 static int array_prog1mix[] = { -2, -1, 0, 1, 2 }; in test_find_closest()
31 static int array_prog2a[] = { 1, 3, 5, 7 }; in test_find_closest()
32 static u32 array_prog2b[] = { 2, 4, 6, 8 }; in test_find_closest()
34 static u32 array_prog3b[] = { 2, 5, 8, 11 }; in test_find_closest()
36 static u32 array_prog4b[] = { 2, 6, 10, 14 }; in test_find_closest()
38 FIND_CLOSEST_RANGE_CHECK(-3, 2, ina226_avg_tab, 0); in test_find_closest()
39 FIND_CLOSEST_RANGE_CHECK(3, 10, ina226_avg_tab, 1); in test_find_closest()
40 FIND_CLOSEST_RANGE_CHECK(11, 40, ina226_avg_tab, 2); in test_find_closest()
41 FIND_CLOSEST_RANGE_CHECK(41, 96, ina226_avg_tab, 3); in test_find_closest()
48 FIND_CLOSEST_RANGE_CHECK(-3, 1, ad7616_oversampling_avail, 0); in test_find_closest()
49 FIND_CLOSEST_RANGE_CHECK(2, 3, ad7616_oversampling_avail, 1); in test_find_closest()
50 FIND_CLOSEST_RANGE_CHECK(4, 6, ad7616_oversampling_avail, 2); in test_find_closest()
51 FIND_CLOSEST_RANGE_CHECK(7, 12, ad7616_oversampling_avail, 3); in test_find_closest()
57 FIND_CLOSEST_RANGE_CHECK(-3, 3, wd_timeout_table, 0); in test_find_closest()
59 FIND_CLOSEST_RANGE_CHECK(6, 7, wd_timeout_table, 2); in test_find_closest()
60 FIND_CLOSEST_RANGE_CHECK(8, 12, wd_timeout_table, 3); in test_find_closest()
67 * arrays (like 1,2,3,4,5), but even so, it should work as long as the in test_find_closest()
69 FIND_CLOSEST_RANGE_CHECK(-3, 1, array_prog1a, 0); in test_find_closest()
70 FIND_CLOSEST_RANGE_CHECK(2, 2, array_prog1a, 1); in test_find_closest()
71 FIND_CLOSEST_RANGE_CHECK(3, 3, array_prog1a, 2); in test_find_closest()
72 FIND_CLOSEST_RANGE_CHECK(4, 4, array_prog1a, 3); in test_find_closest()
75 FIND_CLOSEST_RANGE_CHECK(-3, 2, array_prog1b, 0); in test_find_closest()
76 FIND_CLOSEST_RANGE_CHECK(3, 3, array_prog1b, 1); in test_find_closest()
77 FIND_CLOSEST_RANGE_CHECK(4, 4, array_prog1b, 2); in test_find_closest()
78 FIND_CLOSEST_RANGE_CHECK(5, 5, array_prog1b, 3); in test_find_closest()
81 FIND_CLOSEST_RANGE_CHECK(-4, -2, array_prog1mix, 0); in test_find_closest()
82 FIND_CLOSEST_RANGE_CHECK(-1, -1, array_prog1mix, 1); in test_find_closest()
83 FIND_CLOSEST_RANGE_CHECK(0, 0, array_prog1mix, 2); in test_find_closest()
84 FIND_CLOSEST_RANGE_CHECK(1, 1, array_prog1mix, 3); in test_find_closest()
85 FIND_CLOSEST_RANGE_CHECK(2, 5, array_prog1mix, 4); in test_find_closest()
87 FIND_CLOSEST_RANGE_CHECK(-3, 2, array_prog2a, 0); in test_find_closest()
88 FIND_CLOSEST_RANGE_CHECK(3, 4, array_prog2a, 1); in test_find_closest()
89 FIND_CLOSEST_RANGE_CHECK(5, 6, array_prog2a, 2); in test_find_closest()
90 FIND_CLOSEST_RANGE_CHECK(7, 10, array_prog2a, 3); in test_find_closest()
92 FIND_CLOSEST_RANGE_CHECK(-3, 3, array_prog2b, 0); in test_find_closest()
94 FIND_CLOSEST_RANGE_CHECK(6, 7, array_prog2b, 2); in test_find_closest()
95 FIND_CLOSEST_RANGE_CHECK(8, 10, array_prog2b, 3); in test_find_closest()
97 FIND_CLOSEST_RANGE_CHECK(-3, 2, array_prog3a, 0); in test_find_closest()
98 FIND_CLOSEST_RANGE_CHECK(3, 5, array_prog3a, 1); in test_find_closest()
99 FIND_CLOSEST_RANGE_CHECK(6, 8, array_prog3a, 2); in test_find_closest()
100 FIND_CLOSEST_RANGE_CHECK(9, 20, array_prog3a, 3); in test_find_closest()
102 FIND_CLOSEST_RANGE_CHECK(-3, 3, array_prog3b, 0); in test_find_closest()
104 FIND_CLOSEST_RANGE_CHECK(7, 9, array_prog3b, 2); in test_find_closest()
105 FIND_CLOSEST_RANGE_CHECK(10, 20, array_prog3b, 3); in test_find_closest()
107 FIND_CLOSEST_RANGE_CHECK(-3, 3, array_prog4a, 0); in test_find_closest()
109 FIND_CLOSEST_RANGE_CHECK(8, 11, array_prog4a, 2); in test_find_closest()
110 FIND_CLOSEST_RANGE_CHECK(12, 20, array_prog4a, 3); in test_find_closest()
112 FIND_CLOSEST_RANGE_CHECK(-3, 4, array_prog4b, 0); in test_find_closest()
114 FIND_CLOSEST_RANGE_CHECK(9, 12, array_prog4b, 2); in test_find_closest()
115 FIND_CLOSEST_RANGE_CHECK(13, 20, array_prog4b, 3); in test_find_closest()
133 128, 64, 32, 16, 8, 4, 2, 1 in test_find_closest_descending()
135 static u32 wd_timeout_table[] = { 64, 48, 32, 16, 8, 6, 4, 2 }; in test_find_closest_descending()
136 static int array_prog1a[] = { 5, 4, 3, 2, 1 }; in test_find_closest_descending()
137 static u32 array_prog1b[] = { 6, 5, 4, 3, 2 }; in test_find_closest_descending()
138 static int array_prog1mix[] = { 2, 1, 0, -1, -2 }; in test_find_closest_descending()
139 static int array_prog2a[] = { 7, 5, 3, 1 }; in test_find_closest_descending()
140 static u32 array_prog2b[] = { 8, 6, 4, 2 }; in test_find_closest_descending()
142 static u32 array_prog3b[] = { 11, 8, 5, 2 }; in test_find_closest_descending()
144 static u32 array_prog4b[] = { 14, 10, 6, 2 }; in test_find_closest_descending()
146 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 2, ina226_avg_tab, 7); in test_find_closest_descending()
147 FIND_CLOSEST_DESC_RANGE_CHECK(3, 10, ina226_avg_tab, 6); in test_find_closest_descending()
150 FIND_CLOSEST_DESC_RANGE_CHECK(97, 192, ina226_avg_tab, 3); in test_find_closest_descending()
151 FIND_CLOSEST_DESC_RANGE_CHECK(193, 384, ina226_avg_tab, 2); in test_find_closest_descending()
155 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 1, ad7616_oversampling_avail, 7); in test_find_closest_descending()
156 FIND_CLOSEST_DESC_RANGE_CHECK(2, 3, ad7616_oversampling_avail, 6); in test_find_closest_descending()
159 FIND_CLOSEST_DESC_RANGE_CHECK(13, 24, ad7616_oversampling_avail, 3); in test_find_closest_descending()
160 FIND_CLOSEST_DESC_RANGE_CHECK(25, 48, ad7616_oversampling_avail, 2); in test_find_closest_descending()
164 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 3, wd_timeout_table, 7); in test_find_closest_descending()
168 FIND_CLOSEST_DESC_RANGE_CHECK(13, 24, wd_timeout_table, 3); in test_find_closest_descending()
169 FIND_CLOSEST_DESC_RANGE_CHECK(25, 40, wd_timeout_table, 2); in test_find_closest_descending()
174 * for monotonic arrays (like 5,4,3,2,1), but even so, it should still in test_find_closest_descending()
176 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 1, array_prog1a, 4); in test_find_closest_descending()
177 FIND_CLOSEST_DESC_RANGE_CHECK(2, 2, array_prog1a, 3); in test_find_closest_descending()
178 FIND_CLOSEST_DESC_RANGE_CHECK(3, 3, array_prog1a, 2); in test_find_closest_descending()
182 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 2, array_prog1b, 4); in test_find_closest_descending()
183 FIND_CLOSEST_DESC_RANGE_CHECK(3, 3, array_prog1b, 3); in test_find_closest_descending()
184 FIND_CLOSEST_DESC_RANGE_CHECK(4, 4, array_prog1b, 2); in test_find_closest_descending()
188 FIND_CLOSEST_DESC_RANGE_CHECK(-4, -2, array_prog1mix, 4); in test_find_closest_descending()
189 FIND_CLOSEST_DESC_RANGE_CHECK(-1, -1, array_prog1mix, 3); in test_find_closest_descending()
190 FIND_CLOSEST_DESC_RANGE_CHECK(0, 0, array_prog1mix, 2); in test_find_closest_descending()
192 FIND_CLOSEST_DESC_RANGE_CHECK(2, 5, array_prog1mix, 0); in test_find_closest_descending()
194 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 2, array_prog2a, 3); in test_find_closest_descending()
195 FIND_CLOSEST_DESC_RANGE_CHECK(3, 4, array_prog2a, 2); in test_find_closest_descending()
199 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 3, array_prog2b, 3); in test_find_closest_descending()
200 FIND_CLOSEST_DESC_RANGE_CHECK(4, 5, array_prog2b, 2); in test_find_closest_descending()
204 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 2, array_prog3a, 3); in test_find_closest_descending()
205 FIND_CLOSEST_DESC_RANGE_CHECK(3, 5, array_prog3a, 2); in test_find_closest_descending()
209 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 3, array_prog3b, 3); in test_find_closest_descending()
210 FIND_CLOSEST_DESC_RANGE_CHECK(4, 6, array_prog3b, 2); in test_find_closest_descending()
214 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 3, array_prog4a, 3); in test_find_closest_descending()
215 FIND_CLOSEST_DESC_RANGE_CHECK(4, 7, array_prog4a, 2); in test_find_closest_descending()
219 FIND_CLOSEST_DESC_RANGE_CHECK(-3, 4, array_prog4b, 3); in test_find_closest_descending()
220 FIND_CLOSEST_DESC_RANGE_CHECK(5, 8, array_prog4b, 2); in test_find_closest_descending()