diff options
author | Tom Rini <trini@konsulko.com> | 2021-03-04 13:12:51 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-04 13:12:51 -0500 |
commit | 19a33a7b5684b330bc904cbae93fd3c1e7c76430 (patch) | |
tree | fac56f635fb7a10236dd41868a0b1629184ab39c /arch/sandbox/include/asm/gpio.h | |
parent | 5a9d8633e5e5f5253010480fb0db3742b0ea1356 (diff) | |
parent | 8a45b2205749252f61d26508d5de9dcce020b2ef (diff) |
Merge branch '2021-03-03-gpio-improvements' into next
- GPIO uclass improvements
Diffstat (limited to 'arch/sandbox/include/asm/gpio.h')
-rw-r--r-- | arch/sandbox/include/asm/gpio.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/sandbox/include/asm/gpio.h b/arch/sandbox/include/asm/gpio.h index df4ba4fb5f3..9e10052667d 100644 --- a/arch/sandbox/include/asm/gpio.h +++ b/arch/sandbox/include/asm/gpio.h @@ -23,6 +23,15 @@ */ #include <asm-generic/gpio.h> +/* 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_EXT_PULL_UP BIT(29) /* GPIO has external pull-up */ +#define GPIOD_EXT_PULL_DOWN BIT(28) /* GPIO has external pull-down */ + +#define GPIOD_EXT_PULL (BIT(28) | BIT(29)) +#define GPIOD_SANDBOX_MASK GENMASK(31, 28) + /** * Return the simulated value of a GPIO (used only in sandbox test code) * @@ -69,17 +78,17 @@ int sandbox_gpio_set_direction(struct udevice *dev, unsigned int offset, * @param offset GPIO offset within bank * @return dir_flags: bitfield accesses by GPIOD_ defines */ -ulong sandbox_gpio_get_dir_flags(struct udevice *dev, unsigned int offset); +ulong sandbox_gpio_get_flags(struct udevice *dev, unsigned int offset); /** * Set the simulated flags of a GPIO (used only in sandbox test code) * * @param dev device to use * @param offset GPIO offset within bank - * @param flags dir_flags: bitfield accesses by GPIOD_ defines + * @param flags bitfield accesses by GPIOD_ defines * @return -1 on error, 0 if ok */ -int sandbox_gpio_set_dir_flags(struct udevice *dev, unsigned int offset, - ulong flags); +int sandbox_gpio_set_flags(struct udevice *dev, unsigned int offset, + ulong flags); #endif |