Skip to content

Commit 6a41a7a

Browse files
arbraunscarlescufi
authored andcommitted
drivers: mcp23xxx: explain more common causes for spurious interrupts
Interrupt handling in this chip is broken beyond repair, anyone unfortunate enough to have to use it will probably come across this error and wonder what's up. Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
1 parent 82af470 commit 6a41a7a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpio/gpio_mcp23xxx.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,13 @@ static void mcp23xxx_work_handler(struct k_work *work)
412412
}
413413

414414
if (!intf) {
415-
/* Probable cause: REG_GPIO was read from somewhere else before the interrupt
416-
* handler had a chance to run
415+
/* Probable causes:
416+
* - REG_GPIO was read from somewhere else before the interrupt handler had a chance
417+
* to run
418+
* - Even though the datasheet says differently, reading INTCAP while a level
419+
* interrupt is active briefly (~2ns) causes the interrupt line to go high and
420+
* low again. This causes a second ISR to be scheduled, which then won't
421+
* find any active interrupts if the callback has disabled the level interrupt.
417422
*/
418423
LOG_ERR("Spurious interrupt");
419424
goto fail;

0 commit comments

Comments
 (0)