diff options
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h index 7b3f512b19..56aae22236 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -6,6 +6,11 @@ void gpio_set_value(unsigned gpio, int value); int gpio_get_value(unsigned gpio); int gpio_direction_output(unsigned gpio, int value); int gpio_direction_input(unsigned gpio); + +void gpio_set_active(unsigned gpio, bool state); +int gpio_is_active(unsigned gpio); +int gpio_direction_active(unsigned gpio, bool state); + #else static inline void gpio_set_value(unsigned gpio, int value) { @@ -22,6 +27,18 @@ static inline int gpio_direction_input(unsigned gpio) { return -EINVAL; } + +static inline void gpio_set_active(unsigned gpio, int value) +{ +} +static inline int gpio_is_active(unsigned gpio) +{ + return 0; +} +static inline int gpio_direction_active(unsigned gpio, int value) +{ + return -EINVAL; +} #endif #define ARCH_NR_GPIOS 256 @@ -45,6 +62,14 @@ static inline int gpio_is_valid(int gpio) #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) +#define GPIOF_LOGICAL BIT(2) +#define GPIOF_ACTIVE_HIGH GPIOF_LOGICAL +#define GPIOF_ACTIVE_LOW (BIT(3) | GPIOF_LOGICAL) +#define GPIOF_INIT_INACTIVE GPIOF_LOGICAL +#define GPIOF_INIT_ACTIVE (GPIOF_LOGICAL | GPIOF_INIT_HIGH) +#define GPIOF_OUT_INIT_ACTIVE (GPIOF_DIR_OUT | GPIOF_INIT_ACTIVE) +#define GPIOF_OUT_INIT_INACTIVE (GPIOF_DIR_OUT | GPIOF_INIT_INACTIVE) + /** * struct gpio - a structure describing a GPIO with configuration * @gpio: the GPIO number |