[PATCH v3 0/3] reenable dm_gpio tests, add support for gpio-line-names lookup

Rasmus Villemoes ravi at prevas.dk
Tue Nov 4 18:44:55 CET 2025


Hopefully third time's the charm.

I merely wanted to add support (mostly for use by the 'gpio' shell
command) for looking up a gpio via the gpio-line-names DT property. We
already have a "gpio_request_by_line_name()", but cmd/gpio.c does a
separate "lookup + request", so it felt more natural to teach the
lookup machinery this as well. That ran into
OF_CONTROL-but-not-OF_LIBFDT being a thing for SPL, so here's yet
another attempt.

Now, when trying to do my civic duty and add tests for this, I found
that test/dm/gpio.c has been defunct for a couple of years, and
reinstating it is not entirely trivial.

After a couple of rounds CI is now happy with this:
https://github.com/u-boot/u-boot/pull/828

Rasmus Villemoes (3):
  test: gpio: include in build, and fixup bitrot
  gpio: search gpio-line-names property in dm_gpio_lookup_name
  test: gpio: add test for gpio-line-names lookup

 arch/sandbox/dts/test.dts  |  2 ++
 drivers/gpio/Kconfig       | 16 ++++++++++++++++
 drivers/gpio/gpio-uclass.c | 11 ++++++++++-
 test/dm/Makefile           |  2 +-
 test/dm/gpio.c             | 24 +++++++++++++++++++-----
 5 files changed, 48 insertions(+), 7 deletions(-)

-- 
2.51.0



More information about the U-Boot mailing list