summaryrefslogtreecommitdiff
path: root/board/hadoken/gpio.inc
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-04-08 16:42:55 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-10 22:08:25 +0000
commite9883124ff1600db5788e44c332a403499fb5da6 (patch)
tree5e5b64b72e89037845cc549e1c4262bf9d224a04 /board/hadoken/gpio.inc
parent0b043fed030129ea99272f1ba729307fafaa93e2 (diff)
downloadchrome-ec-e9883124ff1600db5788e44c332a403499fb5da6.tar.gz
gpio: Refactor IRQ handler pointer out of gpio_list
In the gpio_info struct, we had a irq_handler pointer defined even though a majority of the GPIOs did not have irq handlers associated. By removing the irq_handler pointer out of the struct, we can save some space with some targets saving more than others. (For example, ~260 bytes for samus_pd). This change also brings about a new define: GPIO_INT(name, port, pin, flags, signal) And the existing GPIO macro has had the signal parameter removed since they were just NULL. GPIO(name, port, pin, flags) In each of the gpio.inc files, all the GPIOs with irq handlers must be defined at the top of the file. This is because their enum values from gpio_signal are used as the index to the gpio_irq_handlers table. BUG=chromium:471331 BRANCH=none TEST=Flashed ec to samus and samus_pd, verified lightbar tap, lid, power button, keyboard, charging, all still working. TEST=Moved a GPIO_INT declaration after a GPIO declaration and watched the build fail. TEST=make -j BOARD=peppy tests TEST=make -j BOARD=auron tests TEST=make -j BOARD=link tests Change-Id: Id6e261b0a3cd63223ca92f2e96a80c95e85cdefb Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/263973 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/hadoken/gpio.inc')
-rw-r--r--board/hadoken/gpio.inc60
1 files changed, 30 insertions, 30 deletions
diff --git a/board/hadoken/gpio.inc b/board/hadoken/gpio.inc
index 009953bf93..26e8a0fd76 100644
--- a/board/hadoken/gpio.inc
+++ b/board/hadoken/gpio.inc
@@ -14,44 +14,44 @@
/*
* TODO(yjlou): call keyboard_raw_gpio_interrupt() in chip/nrf51/keyboard_raw.c
*/
-GPIO(KB_IN00, 0, 6, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN01, 0, 24, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN02, 0, 1, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN03, 0, 4, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN04, 0, 0, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN05, 0, 30, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN06, 0, 27, GPIO_KB_INPUT, NULL)
-GPIO(KB_IN07, 0, 26, GPIO_KB_INPUT, NULL)
+GPIO(KB_IN00, 0, 6, GPIO_KB_INPUT)
+GPIO(KB_IN01, 0, 24, GPIO_KB_INPUT)
+GPIO(KB_IN02, 0, 1, GPIO_KB_INPUT)
+GPIO(KB_IN03, 0, 4, GPIO_KB_INPUT)
+GPIO(KB_IN04, 0, 0, GPIO_KB_INPUT)
+GPIO(KB_IN05, 0, 30, GPIO_KB_INPUT)
+GPIO(KB_IN06, 0, 27, GPIO_KB_INPUT)
+GPIO(KB_IN07, 0, 26, GPIO_KB_INPUT)
/* Other inputs */
-GPIO(MCU_GPIO_13, 0, 13, GPIO_INPUT, NULL) /* PAIR on the debug board */
-GPIO(MCU_GPIO_14, 0, 14, GPIO_INPUT, NULL) /* TP 4 */
-GPIO(MCU_GPIO_17, 0, 17, GPIO_INPUT, NULL) /* TP 5 */
-GPIO(MCU_GPIO_19, 0, 19, GPIO_INPUT, NULL) /* TP 6 */
-GPIO(BQ27621_GPOUT, 0, 20, GPIO_INPUT, NULL) /* Fuel Gauge */
-GPIO(LID_PRESENT_L, 0, 31, GPIO_INPUT, NULL) /* Hall sensor */
+GPIO(MCU_GPIO_13, 0, 13, GPIO_INPUT) /* PAIR on the debug board */
+GPIO(MCU_GPIO_14, 0, 14, GPIO_INPUT) /* TP 4 */
+GPIO(MCU_GPIO_17, 0, 17, GPIO_INPUT) /* TP 5 */
+GPIO(MCU_GPIO_19, 0, 19, GPIO_INPUT) /* TP 6 */
+GPIO(BQ27621_GPOUT, 0, 20, GPIO_INPUT) /* Fuel Gauge */
+GPIO(LID_PRESENT_L, 0, 31, GPIO_INPUT) /* Hall sensor */
/* Will be an output at some point */
-GPIO(IND_CHRG_DISABLE, 0, 21, GPIO_INPUT, NULL) /* Control for charging */
+GPIO(IND_CHRG_DISABLE, 0, 21, GPIO_INPUT) /* Control for charging */
/* Outputs */
-GPIO(KB_OUT00, 0, 2, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT01, 0, 10, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT02, 0, 7, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT03, 0, 5, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT04, 0, 3, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT05, 0, 9, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT06, 0, 8, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT07, 0, 28, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT08, 0, 18, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT09, 0, 16, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT10, 0, 12, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT11, 0, 15, GPIO_KB_OUTPUT, NULL)
-GPIO(KB_OUT12, 0, 11, GPIO_KB_OUTPUT, NULL)
+GPIO(KB_OUT00, 0, 2, GPIO_KB_OUTPUT)
+GPIO(KB_OUT01, 0, 10, GPIO_KB_OUTPUT)
+GPIO(KB_OUT02, 0, 7, GPIO_KB_OUTPUT)
+GPIO(KB_OUT03, 0, 5, GPIO_KB_OUTPUT)
+GPIO(KB_OUT04, 0, 3, GPIO_KB_OUTPUT)
+GPIO(KB_OUT05, 0, 9, GPIO_KB_OUTPUT)
+GPIO(KB_OUT06, 0, 8, GPIO_KB_OUTPUT)
+GPIO(KB_OUT07, 0, 28, GPIO_KB_OUTPUT)
+GPIO(KB_OUT08, 0, 18, GPIO_KB_OUTPUT)
+GPIO(KB_OUT09, 0, 16, GPIO_KB_OUTPUT)
+GPIO(KB_OUT10, 0, 12, GPIO_KB_OUTPUT)
+GPIO(KB_OUT11, 0, 15, GPIO_KB_OUTPUT)
+GPIO(KB_OUT12, 0, 11, GPIO_KB_OUTPUT)
/* Configure the TWI (I2C) interface in the init function. */
-GPIO(MCU_SCL, 0, 23, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL)
-GPIO(MCU_SDA, 0, 22, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL)
+GPIO(MCU_SCL, 0, 23, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
+GPIO(MCU_SDA, 0, 22, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
/* Use port 0 for I2C (TWI0), Pins 22 & 23 */
ALTERNATE(0, 0x800000, NRF51_TWI0_ALT_FUNC_SCL, MODULE_I2C, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)