From 1f212afc4cefa2ca16e51486523b1854746fda79 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 Feb 2021 21:22:00 -0700 Subject: gpio: sandbox: Use a separate flag for the value At present with the sandbox GPIO driver it is not possible to change the value of GPIOD_IS_OUT_ACTIVE unless the GPIO is an output. This makes it hard to test changing the flags since we need to be aware of the internal workings of the driver. The feature is designed to aid testing. Split this feature out into a separate sandbox-specific flag, so that the flags can change unimpeded. This will make it easier to allow updating the flags in a future patch. Signed-off-by: Simon Glass --- arch/sandbox/include/asm/gpio.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/sandbox/include') diff --git a/arch/sandbox/include/asm/gpio.h b/arch/sandbox/include/asm/gpio.h index 20d7829655..74d7a4cd95 100644 --- a/arch/sandbox/include/asm/gpio.h +++ b/arch/sandbox/include/asm/gpio.h @@ -23,6 +23,11 @@ */ #include +/* 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_SANDBOX_MASK BIT(31) + /** * Return the simulated value of a GPIO (used only in sandbox test code) * -- cgit v1.2.3