The gpio-delay driver wraps one or more real GPIO lines and delays
their assertion/deassertion, but had no sandbox test coverage at all.

Patch 1 is a small, unrelated fix noticed while adding this coverage:
dm_test_gpio_requestf() requests a GPIO but never frees it, unlike
every other test in the file.

Patch 2 enables CONFIG_GPIO_DELAY on sandbox and sandbox64, and adds a
gpio-delay-test node to the sandbox test devicetree wrapping two real
GPIO lines (gpio_a 9 and 18), so the driver actually has something to
wrap during tests.

Patch 3 adds dm_test_gpio_delay, which requests both consumers wired
up by that node and checks that each is routed to its own wrapped
line, that a third, colliding consumer is rejected, and that a
request past the wrapped GPIO count is rejected rather than silently
accepted.

Depends on the already-sent v2 series "gpio: improve claim diagnostics
and fix gpio-delay offset handling":

https://patchwork.ozlabs.org/project/uboot/list/?series=516104

Patch 3 of this series (dm_test_gpio_delay) exercises two fixes from
that series specifically - "gpio: delay: set gpio_count and validate
index against it" and "gpio: delay: fix offset propagation in
gpio_delay_xlate()" - and fails without them applied first.

Pranav Sanwal (3):
  test: dm: free gpio in dm_test_gpio_requestf()
  test: sandbox: enable GPIO_DELAY
  test: dm: add sandbox coverage for gpio-delay

 arch/sandbox/dts/test.dts   | 10 ++++++
 configs/sandbox64_defconfig |  1 +
 configs/sandbox_defconfig   |  1 +
 test/dm/gpio.c              | 71 +++++++++++++++++++++++++++++++++++++
 4 files changed, 83 insertions(+)

-- 
2.43.7

Reply via email to