diff options
author | Todd Broch <tbroch@chromium.org> | 2014-12-10 18:53:59 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-16 22:47:50 +0000 |
commit | 07203ac931d5cbe79ad33f1ec9193678c8c540bd (patch) | |
tree | d25bacf04bb725be7a2137f37deb79b7cdbf0a0e /include/gpio_list.h | |
parent | cf2883afe0ee144029582b62c005c79217905bf3 (diff) | |
download | chrome-ec-07203ac931d5cbe79ad33f1ec9193678c8c540bd.tar.gz |
Add config option to reduce GPIO name string size.
In order to reduce flash size on some constrained boards this CL
modifies the GPIO macro in gpio_list.h to change the name field from
that listed 'name' to the concat of 'port' and 'pin'.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:34489
TEST=manual
1. build with and without CONFIG_COMMON_GPIO_SHORTNAMES
See 897 bytes savings with config option
2. See reduced names for gpioget
> gpioget
0 E6
0 F2
1 B0
Change-Id: Ife1e1e2bcfa620ba87fe6c1ce2b47fe258c46514
Reviewed-on: https://chromium-review.googlesource.com/234587
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'include/gpio_list.h')
-rw-r--r-- | include/gpio_list.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/gpio_list.h b/include/gpio_list.h index 4ea1da27a3..c7e2962747 100644 --- a/include/gpio_list.h +++ b/include/gpio_list.h @@ -3,8 +3,13 @@ * found in the LICENSE file. */ +#ifdef CONFIG_COMMON_GPIO_SHORTNAMES +#define GPIO(name, port, pin, flags, signal) \ + {#port#pin, GPIO_##port, (1 << pin), flags, signal}, +#else #define GPIO(name, port, pin, flags, signal) \ {#name, GPIO_##port, (1 << pin), flags, signal}, +#endif #define UNIMPLEMENTED(name) \ {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT, NULL}, |