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>
This commit is contained in:
Randall Spangler
2013-10-14 12:50:12 -07:00
committed by chrome-internal-fetch
parent c856d14424
commit 301fd86115

View File

@@ -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;
}
}
}