summaryrefslogtreecommitdiff
path: root/include/gpio_list.h
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2019-10-30 10:45:46 -0700
committerCommit Bot <commit-bot@chromium.org>2019-11-08 22:58:53 +0000
commitfe21ab18622825f2a402b970cfec50e429cc14f5 (patch)
treee606642079549f53df12ab7ddea63c04ef5d17a2 /include/gpio_list.h
parent551c8736317a3bd6eb9f8c95540af67e60969716 (diff)
downloadchrome-ec-fe21ab18622825f2a402b970cfec50e429cc14f5.tar.gz
gpio: Add UNUSED declaration for gpio.inc
This new gpio.inc macro is intended to mark pins that are unused on a given board. This allows the chip implementation to configure them for the lowest power configuration. This CL brings immediate functional change. A reference implementation is provided for the STM32F4 chip family in crrev.com/c/1894242. BRANCH=nocturne,hatch BUG=b:130561737 TEST=make buildall -j Change-Id: I0bc0a63401ae8f3bba4108b5b9f9ced26785f2bc Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1898796 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/gpio_list.h')
-rw-r--r--include/gpio_list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gpio_list.h b/include/gpio_list.h
index 180841bb9b..37d49a6f97 100644
--- a/include/gpio_list.h
+++ b/include/gpio_list.h
@@ -23,6 +23,14 @@ const struct gpio_info gpio_list[] = {
BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT);
+#define UNUSED(pin) {GPIO_##pin},
+/* Unconnected pin list. */
+const struct unused_pin_info unused_pin_list[] = {
+ #include "gpio.wrap"
+};
+
+const int unused_pin_count = ARRAY_SIZE(unused_pin_list);
+
/* GPIO Interrupt Handlers */
#define GPIO_INT(name, pin, flags, signal) signal,
void (* const gpio_irq_handlers[])(enum gpio_signal signal) = {
@@ -45,7 +53,9 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers);
*/
#define GPIO(name, pin, flags) pin
#define GPIO_INT(name, pin, flags, signal) pin
+#define UNUSED(pin) pin
/*
+ * Check at build time that pin/ports are only defined once.
* The compiler will complain if we use the same name twice. The linker ignores
* anything that gets by.
*/