From cae35e246028a0780e1a5560e2bda3fa87494ac8 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 29 Jan 2016 13:51:57 -0800 Subject: [PATCH] gpio: allow pins to be enabled/disabled Some GPIO controllers allow individual pins to be detached from the controller (i.e. the controller no longer affects the pin output, or can read its state). This adds the configuration bits to the API so this feature can be used by apps. Change-Id: I355fd5910a5439dcabe01ab40cd887dda30eab72 Signed-off-by: Daniel Leung --- include/gpio.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/gpio.h b/include/gpio.h index a967eaa2884..26bcc28185d 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -63,6 +63,14 @@ extern "C" { #define GPIO_PUD_PULL_DOWN (2 << GPIO_PUD_POS) #define GPIO_PUD_MASK (3 << GPIO_PUD_POS) +/* Pin enable/disable + * + * Individual pins can be enabled or disabled + * if the controller supports this operation. + */ +#define GPIO_PIN_ENABLE (1 << 10) +#define GPIO_PIN_DISABLE (1 << 11) + /* application callback function signature*/ typedef void (*gpio_callback_t)(struct device *port, uint32_t pin);