summaryrefslogtreecommitdiff
path: root/include/gpio_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpio_list.h')
-rw-r--r--include/gpio_list.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/include/gpio_list.h b/include/gpio_list.h
index c7e2962747..c9bdd5668d 100644
--- a/include/gpio_list.h
+++ b/include/gpio_list.h
@@ -3,17 +3,21 @@
* found in the LICENSE file.
*/
+#include "gpio_signal.h"
+
#ifdef CONFIG_COMMON_GPIO_SHORTNAMES
-#define GPIO(name, port, pin, flags, signal) \
- {#port#pin, GPIO_##port, (1 << pin), flags, signal},
+#define GPIO(name, port, pin, flags) \
+ {#port#pin, GPIO_##port, (1 << pin), flags},
#else
-#define GPIO(name, port, pin, flags, signal) \
- {#name, GPIO_##port, (1 << pin), flags, signal},
+#define GPIO(name, port, pin, flags) \
+ {#name, GPIO_##port, (1 << pin), flags},
#endif
#define UNIMPLEMENTED(name) \
- {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT, NULL},
+ {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT},
+#define GPIO_INT(name, port, pin, flags, signal) \
+ GPIO(name, port, pin, flags)
/* GPIO signal list. */
const struct gpio_info gpio_list[] = {
#include "gpio.wrap"
@@ -33,3 +37,18 @@ const struct gpio_alt_func gpio_alt_funcs[] = {
};
const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs);
+
+/* GPIO Interrupt Handlers */
+#define GPIO_INT(name, port, pin, flags, signal) signal,
+void (* const gpio_irq_handlers[])(enum gpio_signal signal) = {
+ #include "gpio.wrap"
+};
+const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers);
+
+/*
+ * ALL GPIOs with interrupt handlers must be declared at the top of the gpio.inc
+ * file.
+ */
+#define GPIO_INT(name, port, pin, flags, signal) \
+ BUILD_ASSERT(GPIO_##name < ARRAY_SIZE(gpio_irq_handlers));
+#include "gpio.wrap"