* [PATCH 0/1] gpio: mcp23s08: Fix clearing of interrupt
@ 2016-03-15 7:46 Phil Reid
2016-03-15 7:46 ` [PATCH 1/1] " Phil Reid
0 siblings, 1 reply; 4+ messages in thread
From: Phil Reid @ 2016-03-15 7:46 UTC (permalink / raw)
To: linus.walleij, gnurou, linux-gpio; +Cc: Phil Reid
I think I had some debug statements in the code when testing with
patch 'gpio: mcp23s08: Add support for mcp23s18' which was hiding
the problem.
Phil Reid (1):
gpio: mcp23s08: Fix clearing of interrupt.
drivers/gpio/gpio-mcp23s08.c | 4 ++++
1 file changed, 4 insertions(+)
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] gpio: mcp23s08: Fix clearing of interrupt.
2016-03-15 7:46 [PATCH 0/1] gpio: mcp23s08: Fix clearing of interrupt Phil Reid
@ 2016-03-15 7:46 ` Phil Reid
2016-03-16 12:51 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Phil Reid @ 2016-03-15 7:46 UTC (permalink / raw)
To: linus.walleij, gnurou, linux-gpio; +Cc: Phil Reid
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>
---
drivers/gpio/gpio-mcp23s08.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 72521d9..b42524f 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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] gpio: mcp23s08: Fix clearing of interrupt.
2016-03-15 7:46 ` [PATCH 1/1] " Phil Reid
@ 2016-03-16 12:51 ` Linus Walleij
2016-03-17 1:57 ` Phil Reid
0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2016-03-16 12:51 UTC (permalink / raw)
To: Phil Reid; +Cc: Alexandre Courbot, linux-gpio
On Tue, Mar 15, 2016 at 8:46 AM, Phil Reid <preid@electromag.com.au> wrote:
> 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>
Patch applied.
Is there some way I could convince you to try to convert this driver
to use GPIOLIB_IRQCHIP in the same manner as other nested
GPIO irqchips, e.g. drivers/gpio/gpio-stmpe.c (see commit
fe44e70db0544e24cd1d00fc594b6e5b0afd333b)?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] gpio: mcp23s08: Fix clearing of interrupt.
2016-03-16 12:51 ` Linus Walleij
@ 2016-03-17 1:57 ` Phil Reid
0 siblings, 0 replies; 4+ messages in thread
From: Phil Reid @ 2016-03-17 1:57 UTC (permalink / raw)
To: Linus Walleij; +Cc: Alexandre Courbot, linux-gpio
G'day Linus,
On 16/03/2016 8:51 PM, Linus Walleij wrote:
> On Tue, Mar 15, 2016 at 8:46 AM, Phil Reid <preid@electromag.com.au> wrote:
>
>> 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>
>
> Patch applied.
Thanks.
>
> Is there some way I could convince you to try to convert this driver
> to use GPIOLIB_IRQCHIP in the same manner as other nested
> GPIO irqchips, e.g. drivers/gpio/gpio-stmpe.c (see commit
> fe44e70db0544e24cd1d00fc594b6e5b0afd333b)?
>
I'll have a look into it.
--
Regards
Phil Reid
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-17 1:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 7:46 [PATCH 0/1] gpio: mcp23s08: Fix clearing of interrupt Phil Reid
2016-03-15 7:46 ` [PATCH 1/1] " Phil Reid
2016-03-16 12:51 ` Linus Walleij
2016-03-17 1:57 ` Phil Reid
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.