blob: b5ee4e4f871da1595ea67fb0d55c9264cbef63b7 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glass96495d92014-02-26 15:59:24 -07002/*
3 * Copyright (C) 2013 Google, Inc
Simon Glass96495d92014-02-26 15:59:24 -07004 */
5
6#include <common.h>
7#include <fdtdec.h>
8#include <dm.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -06009#include <log.h>
Simon Glass336d4612020-02-03 07:36:16 -070010#include <malloc.h>
Simon Glass43241742014-10-04 11:29:51 -060011#include <dm/root.h>
Simon Glass96495d92014-02-26 15:59:24 -070012#include <dm/test.h>
13#include <dm/util.h>
14#include <asm/gpio.h>
Joe Hershbergere721b882015-05-20 14:27:27 -050015#include <test/ut.h>
Simon Glass96495d92014-02-26 15:59:24 -070016
17/* Test that sandbox GPIOs work correctly */
Joe Hershbergere721b882015-05-20 14:27:27 -050018static int dm_test_gpio(struct unit_test_state *uts)
Simon Glass96495d92014-02-26 15:59:24 -070019{
20 unsigned int offset, gpio;
21 struct dm_gpio_ops *ops;
Heiko Schocher54c5d082014-05-22 12:43:05 +020022 struct udevice *dev;
Simon Glass96495d92014-02-26 15:59:24 -070023 const char *name;
24 int offset_count;
25 char buf[80];
26
27 /*
Patrick Delaunayff526652020-01-13 11:35:14 +010028 * We expect to get 4 banks. One is anonymous (just numbered) and
29 * comes from platdata. The other are named a (20 gpios),
30 * b (10 gpios) and c (10 gpios) and come from the device tree. See
Simon Glass96495d92014-02-26 15:59:24 -070031 * test/dm/test.dts.
32 */
33 ut_assertok(gpio_lookup_name("b4", &dev, &offset, &gpio));
34 ut_asserteq_str(dev->name, "extra-gpios");
35 ut_asserteq(4, offset);
36 ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 20 + 4, gpio);
37
38 name = gpio_get_bank_info(dev, &offset_count);
39 ut_asserteq_str("b", name);
40 ut_asserteq(10, offset_count);
41
42 /* Get the operations for this device */
43 ops = gpio_get_ops(dev);
Simon Glass4b8f11c2014-10-04 11:29:48 -060044 ut_assert(ops->get_function);
Simon Glass96495d92014-02-26 15:59:24 -070045
46 /* Cannot get a value until it is reserved */
Simon Glass4b8f11c2014-10-04 11:29:48 -060047 ut_asserteq(-EBUSY, gpio_get_value(gpio + 1));
Simon Glass96495d92014-02-26 15:59:24 -070048 /*
49 * Now some tests that use the 'sandbox' back door. All GPIOs
50 * should default to input, include b4 that we are using here.
51 */
Simon Glass4b8f11c2014-10-04 11:29:48 -060052 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
53 ut_asserteq_str("b4: input: 0 [ ]", buf);
Simon Glass96495d92014-02-26 15:59:24 -070054
55 /* Change it to an output */
56 sandbox_gpio_set_direction(dev, offset, 1);
Simon Glass4b8f11c2014-10-04 11:29:48 -060057 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
58 ut_asserteq_str("b4: output: 0 [ ]", buf);
Simon Glass96495d92014-02-26 15:59:24 -070059
60 sandbox_gpio_set_value(dev, offset, 1);
Simon Glass4b8f11c2014-10-04 11:29:48 -060061 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
62 ut_asserteq_str("b4: output: 1 [ ]", buf);
Simon Glass96495d92014-02-26 15:59:24 -070063
Simon Glass4b8f11c2014-10-04 11:29:48 -060064 ut_assertok(gpio_request(gpio, "testing"));
65 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
66 ut_asserteq_str("b4: output: 1 [x] testing", buf);
Simon Glass96495d92014-02-26 15:59:24 -070067
68 /* Change the value a bit */
69 ut_asserteq(1, ops->get_value(dev, offset));
70 ut_assertok(ops->set_value(dev, offset, 0));
71 ut_asserteq(0, ops->get_value(dev, offset));
Simon Glass4b8f11c2014-10-04 11:29:48 -060072 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
73 ut_asserteq_str("b4: output: 0 [x] testing", buf);
Simon Glass96495d92014-02-26 15:59:24 -070074 ut_assertok(ops->set_value(dev, offset, 1));
75 ut_asserteq(1, ops->get_value(dev, offset));
76
Patrick Delaunayff526652020-01-13 11:35:14 +010077 /* Make it an open drain output, and reset it */
78 ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE,
79 sandbox_gpio_get_dir_flags(dev, offset));
80 ut_assertok(ops->set_dir_flags(dev, offset,
81 GPIOD_IS_OUT | GPIOD_OPEN_DRAIN));
82 ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN,
83 sandbox_gpio_get_dir_flags(dev, offset));
84 ut_assertok(ops->set_dir_flags(dev, offset,
85 GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE));
86 ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE,
87 sandbox_gpio_get_dir_flags(dev, offset));
88
Simon Glass96495d92014-02-26 15:59:24 -070089 /* Make it an input */
90 ut_assertok(ops->direction_input(dev, offset));
Simon Glass4b8f11c2014-10-04 11:29:48 -060091 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
92 ut_asserteq_str("b4: input: 1 [x] testing", buf);
Simon Glass96495d92014-02-26 15:59:24 -070093 sandbox_gpio_set_value(dev, offset, 0);
94 ut_asserteq(0, sandbox_gpio_get_value(dev, offset));
Simon Glass4b8f11c2014-10-04 11:29:48 -060095 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
96 ut_asserteq_str("b4: input: 0 [x] testing", buf);
Simon Glass96495d92014-02-26 15:59:24 -070097
Simon Glass4b8f11c2014-10-04 11:29:48 -060098 ut_assertok(gpio_free(gpio));
99 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
100 ut_asserteq_str("b4: input: 0 [ ]", buf);
Simon Glass96495d92014-02-26 15:59:24 -0700101
102 /* Check the 'a' bank also */
103 ut_assertok(gpio_lookup_name("a15", &dev, &offset, &gpio));
104 ut_asserteq_str(dev->name, "base-gpios");
105 ut_asserteq(15, offset);
106 ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 15, gpio);
107
108 name = gpio_get_bank_info(dev, &offset_count);
109 ut_asserteq_str("a", name);
110 ut_asserteq(20, offset_count);
111
Simon Glass4b8f11c2014-10-04 11:29:48 -0600112 return 0;
113}
114DM_TEST(dm_test_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
115
Neil Armstrong9bf87e22020-05-05 10:43:18 +0200116/* Test that GPIO open-drain/open-source emulation works correctly */
117static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts)
118{
119 struct gpio_desc desc_list[8];
120 struct udevice *dev, *gpio_c;
121 char buf[80];
122
123 ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
124 ut_asserteq_str("a-test", dev->name);
125
126 ut_assertok(uclass_get_device(UCLASS_GPIO, 3, &gpio_c));
127 ut_asserteq_str("pinmux-gpios", gpio_c->name);
128
129 ut_asserteq(8, gpio_request_list_by_name(dev, "test3-gpios", desc_list,
130 ARRAY_SIZE(desc_list), 0))
131
132 ut_asserteq(true, !!device_active(gpio_c));
133 ut_asserteq_ptr(gpio_c, desc_list[0].dev);
134 ut_asserteq_ptr(gpio_c, desc_list[1].dev);
135 ut_asserteq_ptr(gpio_c, desc_list[2].dev);
136 ut_asserteq_ptr(gpio_c, desc_list[3].dev);
137 ut_asserteq_ptr(gpio_c, desc_list[4].dev);
138 ut_asserteq_ptr(gpio_c, desc_list[5].dev);
139 ut_asserteq_ptr(gpio_c, desc_list[6].dev);
140 ut_asserteq_ptr(gpio_c, desc_list[7].dev);
141
142 /* GPIO 0 is (GPIO_OUT|GPIO_OPEN_DRAIN) */
143 ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN,
144 sandbox_gpio_get_dir_flags(gpio_c, 0));
145
146 /* Set it as output high, should become an input */
147 ut_assertok(dm_gpio_set_value(&desc_list[0], 1));
148 ut_assertok(gpio_get_status(gpio_c, 0, buf, sizeof(buf)));
149 ut_asserteq_str("c0: input: 0 [x] a-test.test3-gpios0", buf);
150
151 /* Set it as output low, should become output low */
152 ut_assertok(dm_gpio_set_value(&desc_list[0], 0));
153 ut_assertok(gpio_get_status(gpio_c, 0, buf, sizeof(buf)));
154 ut_asserteq_str("c0: output: 0 [x] a-test.test3-gpios0", buf);
155
156 /* GPIO 1 is (GPIO_OUT|GPIO_OPEN_SOURCE) */
157 ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_SOURCE,
158 sandbox_gpio_get_dir_flags(gpio_c, 1));
159
160 /* Set it as output high, should become output high */
161 ut_assertok(dm_gpio_set_value(&desc_list[1], 1));
162 ut_assertok(gpio_get_status(gpio_c, 1, buf, sizeof(buf)));
163 ut_asserteq_str("c1: output: 1 [x] a-test.test3-gpios1", buf);
164
165 /* Set it as output low, should become an input */
166 ut_assertok(dm_gpio_set_value(&desc_list[1], 0));
167 ut_assertok(gpio_get_status(gpio_c, 1, buf, sizeof(buf)));
168 ut_asserteq_str("c1: input: 1 [x] a-test.test3-gpios1", buf);
169
170 /* GPIO 6 is (GPIO_ACTIVE_LOW|GPIO_OUT|GPIO_OPEN_DRAIN) */
171 ut_asserteq(GPIOD_ACTIVE_LOW | GPIOD_IS_OUT | GPIOD_OPEN_DRAIN,
172 sandbox_gpio_get_dir_flags(gpio_c, 6));
173
174 /* Set it as output high, should become output low */
175 ut_assertok(dm_gpio_set_value(&desc_list[6], 1));
176 ut_assertok(gpio_get_status(gpio_c, 6, buf, sizeof(buf)));
177 ut_asserteq_str("c6: output: 0 [x] a-test.test3-gpios6", buf);
178
179 /* Set it as output low, should become an input */
180 ut_assertok(dm_gpio_set_value(&desc_list[6], 0));
181 ut_assertok(gpio_get_status(gpio_c, 6, buf, sizeof(buf)));
182 ut_asserteq_str("c6: input: 0 [x] a-test.test3-gpios6", buf);
183
184 /* GPIO 7 is (GPIO_ACTIVE_LOW|GPIO_OUT|GPIO_OPEN_SOURCE) */
185 ut_asserteq(GPIOD_ACTIVE_LOW | GPIOD_IS_OUT | GPIOD_OPEN_SOURCE,
186 sandbox_gpio_get_dir_flags(gpio_c, 7));
187
188 /* Set it as output high, should become an input */
189 ut_assertok(dm_gpio_set_value(&desc_list[7], 1));
190 ut_assertok(gpio_get_status(gpio_c, 7, buf, sizeof(buf)));
191 ut_asserteq_str("c7: input: 0 [x] a-test.test3-gpios7", buf);
192
193 /* Set it as output low, should become output high */
194 ut_assertok(dm_gpio_set_value(&desc_list[7], 0));
195 ut_assertok(gpio_get_status(gpio_c, 7, buf, sizeof(buf)));
196 ut_asserteq_str("c7: output: 1 [x] a-test.test3-gpios7", buf);
197
198 ut_assertok(gpio_free_list(dev, desc_list, 8));
199
200 return 0;
201}
202DM_TEST(dm_test_gpio_opendrain_opensource,
203 DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
204
Simon Glass4b8f11c2014-10-04 11:29:48 -0600205/* Test that sandbox anonymous GPIOs work correctly */
Joe Hershbergere721b882015-05-20 14:27:27 -0500206static int dm_test_gpio_anon(struct unit_test_state *uts)
Simon Glass4b8f11c2014-10-04 11:29:48 -0600207{
208 unsigned int offset, gpio;
209 struct udevice *dev;
210 const char *name;
211 int offset_count;
212
Simon Glass96495d92014-02-26 15:59:24 -0700213 /* And the anonymous bank */
214 ut_assertok(gpio_lookup_name("14", &dev, &offset, &gpio));
215 ut_asserteq_str(dev->name, "gpio_sandbox");
216 ut_asserteq(14, offset);
217 ut_asserteq(14, gpio);
218
219 name = gpio_get_bank_info(dev, &offset_count);
220 ut_asserteq_ptr(NULL, name);
221 ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT, offset_count);
222
223 return 0;
224}
Simon Glass4b8f11c2014-10-04 11:29:48 -0600225DM_TEST(dm_test_gpio_anon, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
Simon Glassd44f5972014-10-04 11:29:49 -0600226
227/* Test that gpio_requestf() works as expected */
Joe Hershbergere721b882015-05-20 14:27:27 -0500228static int dm_test_gpio_requestf(struct unit_test_state *uts)
Simon Glassd44f5972014-10-04 11:29:49 -0600229{
230 unsigned int offset, gpio;
231 struct udevice *dev;
232 char buf[80];
233
234 ut_assertok(gpio_lookup_name("b5", &dev, &offset, &gpio));
235 ut_assertok(gpio_requestf(gpio, "testing %d %s", 1, "hi"));
236 sandbox_gpio_set_direction(dev, offset, 1);
237 sandbox_gpio_set_value(dev, offset, 1);
238 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
239 ut_asserteq_str("b5: output: 1 [x] testing 1 hi", buf);
240
241 return 0;
242}
243DM_TEST(dm_test_gpio_requestf, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
Simon Glass43241742014-10-04 11:29:51 -0600244
245/* Test that gpio_request() copies its string */
Joe Hershbergere721b882015-05-20 14:27:27 -0500246static int dm_test_gpio_copy(struct unit_test_state *uts)
Simon Glass43241742014-10-04 11:29:51 -0600247{
248 unsigned int offset, gpio;
249 struct udevice *dev;
250 char buf[80], name[10];
251
252 ut_assertok(gpio_lookup_name("b6", &dev, &offset, &gpio));
253 strcpy(name, "odd_name");
254 ut_assertok(gpio_request(gpio, name));
255 sandbox_gpio_set_direction(dev, offset, 1);
256 sandbox_gpio_set_value(dev, offset, 1);
257 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
258 ut_asserteq_str("b6: output: 1 [x] odd_name", buf);
259 strcpy(name, "nothing");
260 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
261 ut_asserteq_str("b6: output: 1 [x] odd_name", buf);
262
263 return 0;
264}
265DM_TEST(dm_test_gpio_copy, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
266
267/* Test that we don't leak memory with GPIOs */
Joe Hershbergere721b882015-05-20 14:27:27 -0500268static int dm_test_gpio_leak(struct unit_test_state *uts)
Simon Glass43241742014-10-04 11:29:51 -0600269{
Joe Hershbergere721b882015-05-20 14:27:27 -0500270 ut_assertok(dm_test_gpio(uts));
271 ut_assertok(dm_test_gpio_anon(uts));
272 ut_assertok(dm_test_gpio_requestf(uts));
273 ut_assertok(dm_leak_check_end(uts));
Simon Glass43241742014-10-04 11:29:51 -0600274
275 return 0;
276}
Simon Glass43241742014-10-04 11:29:51 -0600277DM_TEST(dm_test_gpio_leak, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
Simon Glass3669e0e2015-01-05 20:05:29 -0700278
279/* Test that we can find GPIOs using phandles */
Joe Hershbergere721b882015-05-20 14:27:27 -0500280static int dm_test_gpio_phandles(struct unit_test_state *uts)
Simon Glass3669e0e2015-01-05 20:05:29 -0700281{
282 struct gpio_desc desc, desc_list[8], desc_list2[8];
283 struct udevice *dev, *gpio_a, *gpio_b;
284
285 ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
286 ut_asserteq_str("a-test", dev->name);
287
288 ut_assertok(gpio_request_by_name(dev, "test-gpios", 1, &desc, 0));
289 ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio_a));
290 ut_assertok(uclass_get_device(UCLASS_GPIO, 2, &gpio_b));
291 ut_asserteq_str("base-gpios", gpio_a->name);
292 ut_asserteq(true, !!device_active(gpio_a));
293 ut_asserteq_ptr(gpio_a, desc.dev);
294 ut_asserteq(4, desc.offset);
295 /* GPIOF_INPUT is the sandbox GPIO driver default */
296 ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 4, NULL));
297 ut_assertok(dm_gpio_free(dev, &desc));
298
299 ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 3, &desc,
300 0));
301 ut_asserteq_ptr(NULL, desc.dev);
302 ut_asserteq(desc.offset, 0);
303 ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 5, &desc,
304 0));
305
306 /* Last GPIO is ignord as it comes after <0> */
307 ut_asserteq(3, gpio_request_list_by_name(dev, "test-gpios", desc_list,
308 ARRAY_SIZE(desc_list), 0));
309 ut_asserteq(-EBUSY, gpio_request_list_by_name(dev, "test-gpios",
310 desc_list2,
311 ARRAY_SIZE(desc_list2),
312 0));
Patrick Delaunayff526652020-01-13 11:35:14 +0100313 ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 4, NULL));
Simon Glass3669e0e2015-01-05 20:05:29 -0700314 ut_assertok(gpio_free_list(dev, desc_list, 3));
Patrick Delaunayff526652020-01-13 11:35:14 +0100315 ut_asserteq(GPIOF_UNUSED, gpio_get_function(gpio_a, 4, NULL));
Simon Glass3669e0e2015-01-05 20:05:29 -0700316 ut_asserteq(3, gpio_request_list_by_name(dev, "test-gpios", desc_list,
317 ARRAY_SIZE(desc_list),
318 GPIOD_IS_OUT |
319 GPIOD_IS_OUT_ACTIVE));
Patrick Delaunayff526652020-01-13 11:35:14 +0100320 ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_a, 4, NULL));
Simon Glass3669e0e2015-01-05 20:05:29 -0700321 ut_asserteq_ptr(gpio_a, desc_list[0].dev);
322 ut_asserteq(1, desc_list[0].offset);
323 ut_asserteq_ptr(gpio_a, desc_list[1].dev);
324 ut_asserteq(4, desc_list[1].offset);
325 ut_asserteq_ptr(gpio_b, desc_list[2].dev);
326 ut_asserteq(5, desc_list[2].offset);
327 ut_asserteq(1, dm_gpio_get_value(desc_list));
328 ut_assertok(gpio_free_list(dev, desc_list, 3));
329
Patrick Delaunayff526652020-01-13 11:35:14 +0100330 ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE,
331 sandbox_gpio_get_dir_flags(gpio_a, 1));
Simon Glass3669e0e2015-01-05 20:05:29 -0700332 ut_asserteq(6, gpio_request_list_by_name(dev, "test2-gpios", desc_list,
333 ARRAY_SIZE(desc_list), 0));
Patrick Delaunayff526652020-01-13 11:35:14 +0100334
335 /* This was set to output previously but flags resetted to 0 = INPUT */
336 ut_asserteq(0, sandbox_gpio_get_dir_flags(gpio_a, 1));
337 ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 1, NULL));
Simon Glass3669e0e2015-01-05 20:05:29 -0700338
339 /* Active low should invert the input value */
340 ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 6, NULL));
341 ut_asserteq(1, dm_gpio_get_value(&desc_list[2]));
342
343 ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 7, NULL));
344 ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 8, NULL));
345 ut_asserteq(0, dm_gpio_get_value(&desc_list[4]));
346 ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 9, NULL));
347 ut_asserteq(1, dm_gpio_get_value(&desc_list[5]));
348
Simon Glass3669e0e2015-01-05 20:05:29 -0700349 return 0;
350}
351DM_TEST(dm_test_gpio_phandles, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
Patrick Delaunayff526652020-01-13 11:35:14 +0100352
353/* Check the gpio pin configuration get from device tree information */
354static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts)
355{
356 struct gpio_desc desc_list[6];
357 struct udevice *dev;
358 ulong flags;
359
360 ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev));
361
362 ut_asserteq(6, gpio_request_list_by_name(dev, "test3-gpios", desc_list,
363 ARRAY_SIZE(desc_list), 0));
364
365 ut_assertok(dm_gpio_get_dir_flags(&desc_list[0], &flags));
366 ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN, flags);
367
368 ut_assertok(dm_gpio_get_dir_flags(&desc_list[1], &flags));
369 ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_SOURCE, flags);
370
371 ut_assertok(dm_gpio_get_dir_flags(&desc_list[2], &flags));
372 ut_asserteq(GPIOD_IS_OUT, flags);
373
374 ut_assertok(dm_gpio_get_dir_flags(&desc_list[3], &flags));
375 ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_UP, flags);
376
377 ut_assertok(dm_gpio_get_dir_flags(&desc_list[4], &flags));
378 ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_DOWN, flags);
379
380 ut_assertok(dm_gpio_get_dir_flags(&desc_list[5], &flags));
381 ut_asserteq(GPIOD_IS_IN, flags);
382
383 ut_assertok(gpio_free_list(dev, desc_list, 6));
384
385 return 0;
386}
387DM_TEST(dm_test_gpio_get_dir_flags, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);