summaryrefslogtreecommitdiff
path: root/include/gpio.h
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2017-06-05 12:30:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-05 18:33:57 -0700
commit4315a010b065b31073bdcef40b2f25adc97456e2 (patch)
tree2ca542d96010ee6703327c707a26afec31365555 /include/gpio.h
parent7dab0e853caf04a3c8d5d1f7b795a23f8b6142d9 (diff)
downloadchrome-ec-4315a010b065b31073bdcef40b2f25adc97456e2.tar.gz
g: add flag to delay int enable until board_init
Cr50 has different gpio configurations for different boards. They cannot be determined until board_init. We want a way to delay enabling the gpio interrupts until the board type can be determined. This change adds a gpio flag, GPIO_INT_DISABLE. When set gpio_pre_init will setup the interrupt, but not enable it. board_init then enables all of the interrupts with init_interrupts. BUG=b:35587228 BRANCH=cr50 TEST=use 'gpiocfg' to verify the setup hasn't changed. Add print statements to verify that gpio_pre_init skips enabling the interrupt on any gpio that has GPIO_INT_DISABLE set Change-Id: I91f73297ab80781b99aa82eda479ae311c13cb77 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/523808 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/gpio.h')
-rw-r--r--include/gpio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h
index 35f53801de..d1dad9056a 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -33,6 +33,8 @@
#define GPIO_ALTERNATE (1 << 17) /* GPIO used for alternate function. */
#define GPIO_LOCKED (1 << 18) /* Lock GPIO output and configuration */
#define GPIO_HIB_WAKE_HIGH (1 << 19) /* Hibernate wake on high level */
+#define GPIO_INT_DISABLE (1 << 20) /* Don't enable interrupt in */
+ /* gpio_pre_init */
/* Common flag combinations */
#define GPIO_OUT_LOW (GPIO_OUTPUT | GPIO_LOW)