diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2020-11-11 09:12:11 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-19 03:08:25 +0000 |
commit | 2f82556bb550f9a162e1c2a100faeda1b9dd291f (patch) | |
tree | 3ae6a49c5c68b8e73731b207e2c64e3c353f56ec | |
parent | b46612ae811e921aa37b1f029bb86c1ef541a243 (diff) | |
download | chrome-ec-2f82556bb550f9a162e1c2a100faeda1b9dd291f.tar.gz |
zephyr: add IOEX_ constants to gpio_signal.h
Multiple headers and platform/ec files need some of the IOEX_*
constants defined, even if we don't support IO expanders (yet). Add
this as a stopgap.
BUG=b:171312361
BRANCH=none
TEST=compile for volteer
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I78fa80047683eff9dca318a1656c21448a76579f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548301
Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r-- | zephyr/shim/include/gpio_signal.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/zephyr/shim/include/gpio_signal.h b/zephyr/shim/include/gpio_signal.h index 9d7fcc42c6..72a6e3aa69 100644 --- a/zephyr/shim/include/gpio_signal.h +++ b/zephyr/shim/include/gpio_signal.h @@ -7,6 +7,7 @@ #define __CROS_EC_GPIO_SIGNAL_H #include <devicetree.h> +#include <toolchain.h> #define GPIO_SIGNAL(id) DT_CAT(GPIO_, id) #define GPIO_SIGNAL_WITH_COMMA(id) GPIO_SIGNAL(id), @@ -14,9 +15,11 @@ enum gpio_signal { #if DT_NODE_EXISTS(DT_PATH(named_gpios)) DT_FOREACH_CHILD(DT_PATH(named_gpios), GPIO_SIGNAL_WITH_COMMA) #endif - GPIO_COUNT + GPIO_COUNT, + GPIO_LIMIT = 0x0FFF, }; #undef GPIO_SIGNAL_WITH_COMMA +BUILD_ASSERT(GPIO_COUNT < GPIO_LIMIT); /** @brief Converts a node identifier under named gpios to enum * @@ -26,4 +29,18 @@ enum gpio_signal { */ #define NAMED_GPIO(name) GPIO_SIGNAL(DT_PATH(named_gpios, name)) +/* + * While we don't support IO expanders at the moment, multiple + * platform/ec headers (e.g., espi.h) require some of these constants + * to be defined. Define them as a compatibility measure. + */ +enum ioex_signal { + IOEX_SIGNAL_START = GPIO_LIMIT + 1, + IOEX_SIGNAL_END = IOEX_SIGNAL_START, + IOEX_LIMIT = 0x1FFF, +}; +BUILD_ASSERT(IOEX_SIGNAL_END < IOEX_LIMIT); + +#define IOEX_COUNT (IOEX_SIGNAL_END - IOEX_SIGNAL_START) + #endif /* __CROS_EC_GPIO_SIGNAL_H */ |