Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2013 Google, Inc |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <fdtdec.h> |
| 8 | #include <dm.h> |
Simon Glass | 336d461 | 2020-02-03 07:36:16 -0700 | [diff] [blame] | 9 | #include <malloc.h> |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 10 | #include <dm/root.h> |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 11 | #include <dm/test.h> |
| 12 | #include <dm/util.h> |
| 13 | #include <asm/gpio.h> |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 14 | #include <test/ut.h> |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 15 | |
| 16 | /* Test that sandbox GPIOs work correctly */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 17 | static int dm_test_gpio(struct unit_test_state *uts) |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 18 | { |
| 19 | unsigned int offset, gpio; |
| 20 | struct dm_gpio_ops *ops; |
Heiko Schocher | 54c5d08 | 2014-05-22 12:43:05 +0200 | [diff] [blame] | 21 | struct udevice *dev; |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 22 | const char *name; |
| 23 | int offset_count; |
| 24 | char buf[80]; |
| 25 | |
| 26 | /* |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 27 | * We expect to get 4 banks. One is anonymous (just numbered) and |
| 28 | * comes from platdata. The other are named a (20 gpios), |
| 29 | * b (10 gpios) and c (10 gpios) and come from the device tree. See |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 30 | * test/dm/test.dts. |
| 31 | */ |
| 32 | ut_assertok(gpio_lookup_name("b4", &dev, &offset, &gpio)); |
| 33 | ut_asserteq_str(dev->name, "extra-gpios"); |
| 34 | ut_asserteq(4, offset); |
| 35 | ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 20 + 4, gpio); |
| 36 | |
| 37 | name = gpio_get_bank_info(dev, &offset_count); |
| 38 | ut_asserteq_str("b", name); |
| 39 | ut_asserteq(10, offset_count); |
| 40 | |
| 41 | /* Get the operations for this device */ |
| 42 | ops = gpio_get_ops(dev); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 43 | ut_assert(ops->get_function); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 44 | |
| 45 | /* Cannot get a value until it is reserved */ |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 46 | ut_asserteq(-EBUSY, gpio_get_value(gpio + 1)); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 47 | /* |
| 48 | * Now some tests that use the 'sandbox' back door. All GPIOs |
| 49 | * should default to input, include b4 that we are using here. |
| 50 | */ |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 51 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 52 | ut_asserteq_str("b4: input: 0 [ ]", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 53 | |
| 54 | /* Change it to an output */ |
| 55 | sandbox_gpio_set_direction(dev, offset, 1); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 56 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 57 | ut_asserteq_str("b4: output: 0 [ ]", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 58 | |
| 59 | sandbox_gpio_set_value(dev, offset, 1); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 60 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 61 | ut_asserteq_str("b4: output: 1 [ ]", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 62 | |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 63 | ut_assertok(gpio_request(gpio, "testing")); |
| 64 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 65 | ut_asserteq_str("b4: output: 1 [x] testing", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 66 | |
| 67 | /* Change the value a bit */ |
| 68 | ut_asserteq(1, ops->get_value(dev, offset)); |
| 69 | ut_assertok(ops->set_value(dev, offset, 0)); |
| 70 | ut_asserteq(0, ops->get_value(dev, offset)); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 71 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 72 | ut_asserteq_str("b4: output: 0 [x] testing", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 73 | ut_assertok(ops->set_value(dev, offset, 1)); |
| 74 | ut_asserteq(1, ops->get_value(dev, offset)); |
| 75 | |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 76 | /* Make it an open drain output, and reset it */ |
| 77 | ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE, |
| 78 | sandbox_gpio_get_dir_flags(dev, offset)); |
| 79 | ut_assertok(ops->set_dir_flags(dev, offset, |
| 80 | GPIOD_IS_OUT | GPIOD_OPEN_DRAIN)); |
| 81 | ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN, |
| 82 | sandbox_gpio_get_dir_flags(dev, offset)); |
| 83 | ut_assertok(ops->set_dir_flags(dev, offset, |
| 84 | GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE)); |
| 85 | ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE, |
| 86 | sandbox_gpio_get_dir_flags(dev, offset)); |
| 87 | |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 88 | /* Make it an input */ |
| 89 | ut_assertok(ops->direction_input(dev, offset)); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 90 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 91 | ut_asserteq_str("b4: input: 1 [x] testing", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 92 | sandbox_gpio_set_value(dev, offset, 0); |
| 93 | ut_asserteq(0, sandbox_gpio_get_value(dev, offset)); |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 94 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 95 | ut_asserteq_str("b4: input: 0 [x] testing", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 96 | |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 97 | ut_assertok(gpio_free(gpio)); |
| 98 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 99 | ut_asserteq_str("b4: input: 0 [ ]", buf); |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 100 | |
| 101 | /* Check the 'a' bank also */ |
| 102 | ut_assertok(gpio_lookup_name("a15", &dev, &offset, &gpio)); |
| 103 | ut_asserteq_str(dev->name, "base-gpios"); |
| 104 | ut_asserteq(15, offset); |
| 105 | ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 15, gpio); |
| 106 | |
| 107 | name = gpio_get_bank_info(dev, &offset_count); |
| 108 | ut_asserteq_str("a", name); |
| 109 | ut_asserteq(20, offset_count); |
| 110 | |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 111 | return 0; |
| 112 | } |
| 113 | DM_TEST(dm_test_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
| 114 | |
| 115 | /* Test that sandbox anonymous GPIOs work correctly */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 116 | static int dm_test_gpio_anon(struct unit_test_state *uts) |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 117 | { |
| 118 | unsigned int offset, gpio; |
| 119 | struct udevice *dev; |
| 120 | const char *name; |
| 121 | int offset_count; |
| 122 | |
Simon Glass | 96495d9 | 2014-02-26 15:59:24 -0700 | [diff] [blame] | 123 | /* And the anonymous bank */ |
| 124 | ut_assertok(gpio_lookup_name("14", &dev, &offset, &gpio)); |
| 125 | ut_asserteq_str(dev->name, "gpio_sandbox"); |
| 126 | ut_asserteq(14, offset); |
| 127 | ut_asserteq(14, gpio); |
| 128 | |
| 129 | name = gpio_get_bank_info(dev, &offset_count); |
| 130 | ut_asserteq_ptr(NULL, name); |
| 131 | ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT, offset_count); |
| 132 | |
| 133 | return 0; |
| 134 | } |
Simon Glass | 4b8f11c | 2014-10-04 11:29:48 -0600 | [diff] [blame] | 135 | DM_TEST(dm_test_gpio_anon, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
Simon Glass | d44f597 | 2014-10-04 11:29:49 -0600 | [diff] [blame] | 136 | |
| 137 | /* Test that gpio_requestf() works as expected */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 138 | static int dm_test_gpio_requestf(struct unit_test_state *uts) |
Simon Glass | d44f597 | 2014-10-04 11:29:49 -0600 | [diff] [blame] | 139 | { |
| 140 | unsigned int offset, gpio; |
| 141 | struct udevice *dev; |
| 142 | char buf[80]; |
| 143 | |
| 144 | ut_assertok(gpio_lookup_name("b5", &dev, &offset, &gpio)); |
| 145 | ut_assertok(gpio_requestf(gpio, "testing %d %s", 1, "hi")); |
| 146 | sandbox_gpio_set_direction(dev, offset, 1); |
| 147 | sandbox_gpio_set_value(dev, offset, 1); |
| 148 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 149 | ut_asserteq_str("b5: output: 1 [x] testing 1 hi", buf); |
| 150 | |
| 151 | return 0; |
| 152 | } |
| 153 | DM_TEST(dm_test_gpio_requestf, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 154 | |
| 155 | /* Test that gpio_request() copies its string */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 156 | static int dm_test_gpio_copy(struct unit_test_state *uts) |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 157 | { |
| 158 | unsigned int offset, gpio; |
| 159 | struct udevice *dev; |
| 160 | char buf[80], name[10]; |
| 161 | |
| 162 | ut_assertok(gpio_lookup_name("b6", &dev, &offset, &gpio)); |
| 163 | strcpy(name, "odd_name"); |
| 164 | ut_assertok(gpio_request(gpio, name)); |
| 165 | sandbox_gpio_set_direction(dev, offset, 1); |
| 166 | sandbox_gpio_set_value(dev, offset, 1); |
| 167 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 168 | ut_asserteq_str("b6: output: 1 [x] odd_name", buf); |
| 169 | strcpy(name, "nothing"); |
| 170 | ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); |
| 171 | ut_asserteq_str("b6: output: 1 [x] odd_name", buf); |
| 172 | |
| 173 | return 0; |
| 174 | } |
| 175 | DM_TEST(dm_test_gpio_copy, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
| 176 | |
| 177 | /* Test that we don't leak memory with GPIOs */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 178 | static int dm_test_gpio_leak(struct unit_test_state *uts) |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 179 | { |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 180 | ut_assertok(dm_test_gpio(uts)); |
| 181 | ut_assertok(dm_test_gpio_anon(uts)); |
| 182 | ut_assertok(dm_test_gpio_requestf(uts)); |
| 183 | ut_assertok(dm_leak_check_end(uts)); |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 184 | |
| 185 | return 0; |
| 186 | } |
Simon Glass | 4324174 | 2014-10-04 11:29:51 -0600 | [diff] [blame] | 187 | DM_TEST(dm_test_gpio_leak, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 188 | |
| 189 | /* Test that we can find GPIOs using phandles */ |
Joe Hershberger | e721b88 | 2015-05-20 14:27:27 -0500 | [diff] [blame] | 190 | static int dm_test_gpio_phandles(struct unit_test_state *uts) |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 191 | { |
| 192 | struct gpio_desc desc, desc_list[8], desc_list2[8]; |
| 193 | struct udevice *dev, *gpio_a, *gpio_b; |
| 194 | |
| 195 | ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev)); |
| 196 | ut_asserteq_str("a-test", dev->name); |
| 197 | |
| 198 | ut_assertok(gpio_request_by_name(dev, "test-gpios", 1, &desc, 0)); |
| 199 | ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio_a)); |
| 200 | ut_assertok(uclass_get_device(UCLASS_GPIO, 2, &gpio_b)); |
| 201 | ut_asserteq_str("base-gpios", gpio_a->name); |
| 202 | ut_asserteq(true, !!device_active(gpio_a)); |
| 203 | ut_asserteq_ptr(gpio_a, desc.dev); |
| 204 | ut_asserteq(4, desc.offset); |
| 205 | /* GPIOF_INPUT is the sandbox GPIO driver default */ |
| 206 | ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 4, NULL)); |
| 207 | ut_assertok(dm_gpio_free(dev, &desc)); |
| 208 | |
| 209 | ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 3, &desc, |
| 210 | 0)); |
| 211 | ut_asserteq_ptr(NULL, desc.dev); |
| 212 | ut_asserteq(desc.offset, 0); |
| 213 | ut_asserteq(-ENOENT, gpio_request_by_name(dev, "test-gpios", 5, &desc, |
| 214 | 0)); |
| 215 | |
| 216 | /* Last GPIO is ignord as it comes after <0> */ |
| 217 | ut_asserteq(3, gpio_request_list_by_name(dev, "test-gpios", desc_list, |
| 218 | ARRAY_SIZE(desc_list), 0)); |
| 219 | ut_asserteq(-EBUSY, gpio_request_list_by_name(dev, "test-gpios", |
| 220 | desc_list2, |
| 221 | ARRAY_SIZE(desc_list2), |
| 222 | 0)); |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 223 | ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 4, NULL)); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 224 | ut_assertok(gpio_free_list(dev, desc_list, 3)); |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 225 | ut_asserteq(GPIOF_UNUSED, gpio_get_function(gpio_a, 4, NULL)); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 226 | ut_asserteq(3, gpio_request_list_by_name(dev, "test-gpios", desc_list, |
| 227 | ARRAY_SIZE(desc_list), |
| 228 | GPIOD_IS_OUT | |
| 229 | GPIOD_IS_OUT_ACTIVE)); |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 230 | ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_a, 4, NULL)); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 231 | ut_asserteq_ptr(gpio_a, desc_list[0].dev); |
| 232 | ut_asserteq(1, desc_list[0].offset); |
| 233 | ut_asserteq_ptr(gpio_a, desc_list[1].dev); |
| 234 | ut_asserteq(4, desc_list[1].offset); |
| 235 | ut_asserteq_ptr(gpio_b, desc_list[2].dev); |
| 236 | ut_asserteq(5, desc_list[2].offset); |
| 237 | ut_asserteq(1, dm_gpio_get_value(desc_list)); |
| 238 | ut_assertok(gpio_free_list(dev, desc_list, 3)); |
| 239 | |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 240 | ut_asserteq(GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE, |
| 241 | sandbox_gpio_get_dir_flags(gpio_a, 1)); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 242 | ut_asserteq(6, gpio_request_list_by_name(dev, "test2-gpios", desc_list, |
| 243 | ARRAY_SIZE(desc_list), 0)); |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 244 | |
| 245 | /* This was set to output previously but flags resetted to 0 = INPUT */ |
| 246 | ut_asserteq(0, sandbox_gpio_get_dir_flags(gpio_a, 1)); |
| 247 | ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_a, 1, NULL)); |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 248 | |
| 249 | /* Active low should invert the input value */ |
| 250 | ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 6, NULL)); |
| 251 | ut_asserteq(1, dm_gpio_get_value(&desc_list[2])); |
| 252 | |
| 253 | ut_asserteq(GPIOF_INPUT, gpio_get_function(gpio_b, 7, NULL)); |
| 254 | ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 8, NULL)); |
| 255 | ut_asserteq(0, dm_gpio_get_value(&desc_list[4])); |
| 256 | ut_asserteq(GPIOF_OUTPUT, gpio_get_function(gpio_b, 9, NULL)); |
| 257 | ut_asserteq(1, dm_gpio_get_value(&desc_list[5])); |
| 258 | |
Simon Glass | 3669e0e | 2015-01-05 20:05:29 -0700 | [diff] [blame] | 259 | return 0; |
| 260 | } |
| 261 | DM_TEST(dm_test_gpio_phandles, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |
Patrick Delaunay | ff52665 | 2020-01-13 11:35:14 +0100 | [diff] [blame] | 262 | |
| 263 | /* Check the gpio pin configuration get from device tree information */ |
| 264 | static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts) |
| 265 | { |
| 266 | struct gpio_desc desc_list[6]; |
| 267 | struct udevice *dev; |
| 268 | ulong flags; |
| 269 | |
| 270 | ut_assertok(uclass_get_device(UCLASS_TEST_FDT, 0, &dev)); |
| 271 | |
| 272 | ut_asserteq(6, gpio_request_list_by_name(dev, "test3-gpios", desc_list, |
| 273 | ARRAY_SIZE(desc_list), 0)); |
| 274 | |
| 275 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[0], &flags)); |
| 276 | ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN, flags); |
| 277 | |
| 278 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[1], &flags)); |
| 279 | ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_SOURCE, flags); |
| 280 | |
| 281 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[2], &flags)); |
| 282 | ut_asserteq(GPIOD_IS_OUT, flags); |
| 283 | |
| 284 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[3], &flags)); |
| 285 | ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_UP, flags); |
| 286 | |
| 287 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[4], &flags)); |
| 288 | ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_DOWN, flags); |
| 289 | |
| 290 | ut_assertok(dm_gpio_get_dir_flags(&desc_list[5], &flags)); |
| 291 | ut_asserteq(GPIOD_IS_IN, flags); |
| 292 | |
| 293 | ut_assertok(gpio_free_list(dev, desc_list, 6)); |
| 294 | |
| 295 | return 0; |
| 296 | } |
| 297 | DM_TEST(dm_test_gpio_get_dir_flags, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); |