summaryrefslogtreecommitdiff
path: root/board/dingdong
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/dingdong
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/dingdong')
-rw-r--r--board/dingdong/gpio.inc26
1 files changed, 14 insertions, 12 deletions
diff --git a/board/dingdong/gpio.inc b/board/dingdong/gpio.inc
index 95a75b88b1..9dc31bea66 100644
--- a/board/dingdong/gpio.inc
+++ b/board/dingdong/gpio.inc
@@ -4,20 +4,22 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-GPIO(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event)
-GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG, NULL)
-GPIO(STM_READY, A, 2, GPIO_OUT_LOW, NULL) /* factory test only */
-GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG, NULL)
-GPIO(DP_AUX_N, A, 5, GPIO_INPUT, NULL)
-GPIO(DP_AUX_P, A, 6, GPIO_INPUT, NULL)
-GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW, NULL)
-GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL)
-GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL)
-GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW, NULL)
+GPIO_INT(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event)
-GPIO(PD_DPSINK_PRESENT, B, 0, GPIO_INPUT, NULL)
-GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW, NULL)
+GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG)
+GPIO(STM_READY, A, 2, GPIO_OUT_LOW) /* factory test only */
+GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG)
+GPIO(DP_AUX_N, A, 5, GPIO_INPUT)
+GPIO(DP_AUX_P, A, 6, GPIO_INPUT)
+
+GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW)
+GPIO(USB_DM, A, 11, GPIO_ANALOG)
+GPIO(USB_DP, A, 12, GPIO_ANALOG)
+GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW)
+
+GPIO(PD_DPSINK_PRESENT, B, 0, GPIO_INPUT)
+GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW)
/* Unimplemented signals which we need to emulate for now */
UNIMPLEMENTED(ENTERING_RW)