summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2016-03-15 10:46:30 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-03-16 15:41:59 +0300
commit3539699c03a6a349ffb8a2ac83ec40d6a981b2d6 (patch)
tree269fe28556a1bff5e20abdf954e3ba10fd940117 /drivers/gpio
parent1cfab8f8b397f7d95ad43f72ed9a1fa7d26e210e (diff)
downloadlinux-3539699c03a6a349ffb8a2ac83ec40d6a981b2d6.tar.xz
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 <preid@electromag.com.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-mcp23s08.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 971915830d7f..47e486910aab 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -49,6 +49,7 @@
# define IOCON_HAEN (1 << 3)
# define IOCON_ODR (1 << 2)
# define IOCON_INTPOL (1 << 1)
+# define IOCON_INTCC (1)
#define MCP_GPPU 0x06
#define MCP_INTF 0x07
#define MCP_INTCAP 0x08
@@ -680,6 +681,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
if (mirror)
status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
+ if (type == MCP_TYPE_S18)
+ status |= IOCON_INTCC | (IOCON_INTCC << 8);
+
status = mcp->ops->write(mcp, MCP_IOCON, status);
if (status < 0)
goto fail;