diff options
Diffstat (limited to 'include/gpio_list.h')
-rw-r--r-- | include/gpio_list.h | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/include/gpio_list.h b/include/gpio_list.h index 6bd43187d9..17fc0d3b09 100644 --- a/include/gpio_list.h +++ b/include/gpio_list.h @@ -1,4 +1,4 @@ -/* Copyright 2014 The Chromium OS Authors. All rights reserved. +/* Copyright 2014 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -8,35 +8,35 @@ #include "gpio_signal.h" #ifdef CONFIG_COMMON_GPIO_SHORTNAMES -#define GPIO(name, pin, flags) {GPIO_NAME_BY_##pin, GPIO_##pin, flags}, +#define GPIO(name, pin, flags) { GPIO_NAME_BY_##pin, GPIO_##pin, flags }, #define GPIO_INT(name, pin, flags, signal) \ - {GPIO_NAME_BY_##pin, GPIO_##pin, flags}, + { GPIO_NAME_BY_##pin, GPIO_##pin, flags }, #else -#define GPIO(name, pin, flags) {#name, GPIO_##pin, flags}, -#define GPIO_INT(name, pin, flags, signal) {#name, GPIO_##pin, flags}, +#define GPIO(name, pin, flags) { #name, GPIO_##pin, flags }, +#define GPIO_INT(name, pin, flags, signal) { #name, GPIO_##pin, flags }, #endif -#define UNIMPLEMENTED(name) {#name, UNIMPLEMENTED_GPIO_BANK, 0, GPIO_DEFAULT}, +#define UNIMPLEMENTED(name) { #name, UNIMPLEMENTED_GPIO_BANK, 0, GPIO_DEFAULT }, /* GPIO signal list. */ __const_data const struct gpio_info gpio_list[] = { - #include "gpio.wrap" +#include "gpio.wrap" }; BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); -#define UNUSED(pin) {GPIO_##pin}, +#define UNUSED(pin) { GPIO_##pin }, /* Unconnected pin list. */ __const_data const struct unused_pin_info unused_pin_list[] = { - #include "gpio.wrap" +#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) = { - #include "gpio.wrap" +void (*const gpio_irq_handlers[])(enum gpio_signal signal) = { +#include "gpio.wrap" }; const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); @@ -47,7 +47,7 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); * * This constraint is handled within gpio.wrap. */ -#define GPIO_INT(name, pin, flags, signal) \ +#define GPIO_INT(name, pin, flags, signal) \ BUILD_ASSERT(GPIO_##name < ARRAY_SIZE(gpio_irq_handlers)); #include "gpio.wrap" @@ -64,8 +64,9 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); * The compiler will complain if we use the same name twice. The linker ignores * anything that gets by. */ -#define PIN(a, b...) static const int _pin_ ## a ## _ ## b \ - __attribute__((unused, section(".unused"))) = __LINE__; +#define PIN(a, b...) \ + static const int _pin_##a##_##b \ + __attribute__((unused, section(".unused"))) = __LINE__; #include "gpio.wrap" #include "ioexpander.h" @@ -83,7 +84,7 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); * - flags: the same as the flags of GPIO. * */ -#define IOEX(name, expin, flags) {#name, IOEX_##expin, flags}, +#define IOEX(name, expin, flags) { #name, IOEX_##expin, flags }, /* * Define the IO expander IO which supports interrupt in gpio.inc by * the format: @@ -97,18 +98,18 @@ const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); * - flags: the same as the flags of GPIO. * - handler: the IOEX IO's interrupt handler. */ -#define IOEX_INT(name, expin, flags, handler) {#name, IOEX_##expin, flags}, +#define IOEX_INT(name, expin, flags, handler) { #name, IOEX_##expin, flags }, /* IO expander signal list. */ const struct ioex_info ioex_list[] = { - #include "gpio.wrap" +#include "gpio.wrap" }; BUILD_ASSERT(ARRAY_SIZE(ioex_list) == IOEX_COUNT); /* IO Expander Interrupt Handlers */ #define IOEX_INT(name, expin, flags, handler) handler, -void (* const ioex_irq_handlers[])(enum ioex_signal signal) = { - #include "gpio.wrap" +void (*const ioex_irq_handlers[])(enum ioex_signal signal) = { +#include "gpio.wrap" }; const int ioex_ih_count = ARRAY_SIZE(ioex_irq_handlers); /* @@ -116,9 +117,9 @@ const int ioex_ih_count = ARRAY_SIZE(ioex_irq_handlers); * IOEX's declaration in the gpio.inc * file. */ -#define IOEX_INT(name, expin, flags, handler) \ - BUILD_ASSERT(IOEX_##name - IOEX_SIGNAL_START \ - < ARRAY_SIZE(ioex_irq_handlers)); +#define IOEX_INT(name, expin, flags, handler) \ + BUILD_ASSERT(IOEX_##name - IOEX_SIGNAL_START < \ + ARRAY_SIZE(ioex_irq_handlers)); #include "gpio.wrap" #define IOEX(name, expin, flags) expin @@ -128,9 +129,9 @@ const int ioex_ih_count = ARRAY_SIZE(ioex_irq_handlers); * number declared is greater or equal to CONFIG_IO_EXPANDER_PORT_COUNT. * The linker ignores anything that gets by. */ -#define EXPIN(a, b, c...) \ - static const int _expin_ ## a ## _ ## b ## _ ## c \ - __attribute__((unused, section(".unused"))) = __LINE__; \ +#define EXPIN(a, b, c...) \ + static const int _expin_##a##_##b##_##c \ + __attribute__((unused, section(".unused"))) = __LINE__; \ BUILD_ASSERT(a < CONFIG_IO_EXPANDER_PORT_COUNT); #include "gpio.wrap" |