diff options
author | Aseda Aboagye <aaboagye@google.com> | 2015-04-08 16:42:55 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-10 22:08:25 +0000 |
commit | e9883124ff1600db5788e44c332a403499fb5da6 (patch) | |
tree | 5e5b64b72e89037845cc549e1c4262bf9d224a04 /board/snow/gpio.inc | |
parent | 0b043fed030129ea99272f1ba729307fafaa93e2 (diff) | |
download | chrome-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/snow/gpio.inc')
-rw-r--r-- | board/snow/gpio.inc | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/board/snow/gpio.inc b/board/snow/gpio.inc index ea49c0b812..db7d92d3ca 100644 --- a/board/snow/gpio.inc +++ b/board/snow/gpio.inc @@ -6,65 +6,65 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) /* Keyboard power button */ -GPIO(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ -GPIO(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ -GPIO(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ -GPIO(SPI1_NSS, A, 4, GPIO_DEFAULT, spi_event) +GPIO_INT(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) /* Keyboard power button */ +GPIO_INT(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ +GPIO_INT(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ +GPIO_INT(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ +GPIO_INT(SPI1_NSS, A, 4, GPIO_DEFAULT, spi_event) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(AC_PWRBTN_L, A, 0, GPIO_INT_BOTH, NULL) -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) /* Write protection pin (low active) */ +GPIO(AC_PWRBTN_L, A, 0, GPIO_INT_BOTH) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Write protection pin (low active) */ /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(I2C1_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(I2C2_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(I2C2_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(I2C1_SCL, B, 6, GPIO_INPUT) +GPIO(I2C1_SDA, B, 7, GPIO_INPUT) +GPIO(I2C2_SCL, B, 10, GPIO_INPUT) +GPIO(I2C2_SDA, B, 11, GPIO_INPUT) /* Outputs */ -GPIO(AC_STATUS, A, 5, GPIO_DEFAULT, NULL) -GPIO(SPI1_MISO, A, 6, GPIO_DEFAULT, NULL) -GPIO(EN_PP1350, A, 2, GPIO_OUT_LOW, NULL) /* DDR 1.35v rail enable */ -GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW, NULL) /* 5.0v rail enable */ -GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW, NULL) /* 3.3v rail enable */ -GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH, NULL) /* 5v rail ready */ -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) /* Force hard reset of the pmic */ +GPIO(AC_STATUS, A, 5, GPIO_DEFAULT) +GPIO(SPI1_MISO, A, 6, GPIO_DEFAULT) +GPIO(EN_PP1350, A, 2, GPIO_OUT_LOW) /* DDR 1.35v rail enable */ +GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW) /* 5.0v rail enable */ +GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW) /* 3.3v rail enable */ +GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH) /* 5v rail ready */ +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) /* Force hard reset of the pmic */ /* EC is R/W mode for the kbc mux */ -GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW, NULL) -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) +GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW) +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) /* To audio codec (KB noise cancellation) */ -GPIO(CODEC_INT, D, 1, GPIO_ODR_HIGH, NULL) -GPIO(LED_POWER_L, B, 3, GPIO_INPUT, NULL) /* Keyboard power LED */ -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT, NULL) +GPIO(CODEC_INT, D, 1, GPIO_ODR_HIGH) +GPIO(LED_POWER_L, B, 3, GPIO_INPUT) /* Keyboard power LED */ +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT) |