[PATCH 12/12] dm: gpio: Add of-platdata support

Simon Glass sjg at chromium.org
Sun Sep 26 20:40:18 CEST 2021


Add support for accessing GPIOs using of-plata. This uses the same
mechanism as for clocks, but allows use of the xlate() method so that
the driver can interpret the parameters.

Update the condition for GPIO_HOG so that it is not built into SPL,
since it needs SPL_OF_REAL which is not enabled in sandbox_spl.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/sandbox/dts/sandbox.dtsi    |  8 +++++++-
 configs/sandbox_noinst_defconfig |  2 ++
 configs/sandbox_spl_defconfig    |  2 ++
 drivers/gpio/Makefile            |  4 ++--
 drivers/gpio/gpio-uclass.c       | 26 ++++++++++++++++++++++++--
 drivers/gpio/sandbox.c           | 14 ++++++++++----
 drivers/gpio/sandbox_test.c      | 21 +++++++++++++++++++++
 include/asm-generic/gpio.h       |  5 +++++
 test/dm/of_platdata.c            | 20 ++++++++++++++++++++
 9 files changed, 93 insertions(+), 9 deletions(-)
 create mode 100644 drivers/gpio/sandbox_test.c

Applied to u-boot-dm/next, thanks!


More information about the U-Boot mailing list