diff options
author | Simon Glass <sjg@chromium.org> | 2021-02-05 07:22:07 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-03 23:40:11 +0300 |
commit | d638a183572dd58899250deb6b5ea2009ce05dc3 (patch) | |
tree | 8f06253a12e4a364aa51092ca31423a6e97b3910 /arch/sandbox | |
parent | edab114775e91def9c1695518876e461f76a0e1f (diff) | |
download | u-boot-d638a183572dd58899250deb6b5ea2009ce05dc3.tar.xz |
gpio: sandbox: Track whether a GPIO is driven
Add a new flag to keep track of whether sandbox is driving the pin, or
whether it is expecting an input signal. If it is driving, then the value
of the pin is the value being driven (0 or 1). If not driving, then we
consider the value 0, since we don't currently handle things like pull-ups
yet.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/include/asm/gpio.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sandbox/include/asm/gpio.h b/arch/sandbox/include/asm/gpio.h index 74d7a4cd95..33b83ea4cc 100644 --- a/arch/sandbox/include/asm/gpio.h +++ b/arch/sandbox/include/asm/gpio.h @@ -25,8 +25,9 @@ /* Our own private GPIO flags, which musn't conflict with GPIOD_... */ #define GPIOD_EXT_HIGH BIT(31) /* external source is high (else low) */ +#define GPIOD_EXT_DRIVEN BIT(30) /* external source is driven */ -#define GPIOD_SANDBOX_MASK BIT(31) +#define GPIOD_SANDBOX_MASK GENMASK(31, 30) /** * Return the simulated value of a GPIO (used only in sandbox test code) |