[PATCH 0/5] commands: gpio: add controller as optional argument

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Sep 5 03:35:41 PDT 2022


gpioinfo currently displays all GPIOs and the rest of the GPIO commands
like gpio_direction_output expects either a GPIO label or a global GPIO
number to act upon.

With this series, the gpio commands now accept an optional argument,
e.g.:

  gpioinfo gpio4
  gpio_direction_output -d gpio4 20 1

Controllers are identified by either device name, full path to the
device tree node backing it or an alias pointing at it.

Ahmad Fatoum (5):
  gpiolib: implement gpio_get_chip_by_dev()
  of: platform: optimize of_find_device_by_node when deep probing
  driver: implement find_device() helper
  commands: gpio: add -d argument to set/get commands
  gpiolib: gpioinfo: add optional CONTROLLER command line argument

 commands/gpio.c        | 51 +++++++++++++++++++++++++++++-------
 drivers/base/driver.c  | 16 ++++++++++++
 drivers/gpio/gpiolib.c | 59 ++++++++++++++++++++++++++++++++----------
 drivers/of/platform.c  |  3 +++
 include/driver.h       |  5 ++++
 include/gpio.h         |  1 +
 6 files changed, 111 insertions(+), 24 deletions(-)

-- 
2.30.2




More information about the barebox mailing list