mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
dm: gpio: Add of-platdata support
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@chromium.org>
This commit is contained in:
parent
3e57ad907c
commit
48609d0789
9 changed files with 93 additions and 9 deletions
21
drivers/gpio/sandbox_test.c
Normal file
21
drivers/gpio/sandbox_test.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Sandbox driver for testing GPIOs with of-platdata
|
||||
*
|
||||
* Copyright 2021 Google LLC
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <asm-generic/gpio.h>
|
||||
|
||||
static const struct udevice_id sandbox_gpio_test_ids[] = {
|
||||
{ .compatible = "sandbox,gpio-test" },
|
||||
{ }
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(sandbox_gpio_test) = {
|
||||
.name = "sandbox_gpio_test",
|
||||
.id = UCLASS_MISC,
|
||||
.of_match = sandbox_gpio_test_ids,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue