diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-14 12:50:12 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-15 18:21:14 +0000 |
commit | 301fd861159c2e3682265aa5dce198bde697ed5e (patch) | |
tree | 72b889b5de2db8f4c3afdaecb3ef198b75cfe57b /chip | |
parent | c856d14424e7dc4a9cd29e5877cf07db0b04ebca (diff) | |
download | chrome-ec-301fd861159c2e3682265aa5dce198bde697ed5e.tar.gz |
lm4: GPIO interrupt handler scans through fewer GPIOs
Rather than scan the entire GPIO table, stop as soon as all interrupt
bits have been handled. We hand-order the table so GPIOs with
interrupts are first, so this should reduce interrupt overhead.
BUG=chrome-os-partner:23296
BRANCH=none
TEST=boot rambi
x86indebug -1
apshutdown
powerbtn
...That should print lots of 'x86 in' debug messages as pins
change state, showing that the interrupt handlers are still responding.
Change-Id: I7942cd51870ad51de068d90d68cf6634ff2fb1a0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173031
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/lm4/gpio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index a6aeeaa58f..604cd91234 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -290,9 +290,11 @@ static void gpio_interrupt(int port, uint32_t mis) int i = 0; const struct gpio_info *g = gpio_list; - for (i = 0; i < GPIO_COUNT; i++, g++) { - if (port == g->port && (mis & g->mask) && g->irq_handler) + for (i = 0; i < GPIO_COUNT && mis; i++, g++) { + if (port == g->port && (mis & g->mask) && g->irq_handler) { g->irq_handler(i); + mis &= ~g->mask; + } } } |