Skip to content

Commit 3539699

Browse files
reid-plinusw
authored andcommitted
gpio: mcp23s08: Fix clearing of interrupt.
The mcp23s18 is configurable on clearing the interrupt on either reading INTCAP or GPIO. Since driver reads INTCAP in IRQ and not the GPIO reg need to set control byte for this mode. Signed-off-by: Phil Reid <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 1cfab8f commit 3539699

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpio/gpio-mcp23s08.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
# define IOCON_HAEN (1 << 3)
5050
# define IOCON_ODR (1 << 2)
5151
# define IOCON_INTPOL (1 << 1)
52+
# define IOCON_INTCC (1)
5253
#define MCP_GPPU 0x06
5354
#define MCP_INTF 0x07
5455
#define MCP_INTCAP 0x08
@@ -680,6 +681,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
680681
if (mirror)
681682
status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
682683

684+
if (type == MCP_TYPE_S18)
685+
status |= IOCON_INTCC | (IOCON_INTCC << 8);
686+
683687
status = mcp->ops->write(mcp, MCP_IOCON, status);
684688
if (status < 0)
685689
goto fail;

0 commit comments

Comments
 (0)