Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756150AbcDAN3Y (ORCPT ); Fri, 1 Apr 2016 09:29:24 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:36338 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935AbcDAN3W convert rfc822-to-8bit (ORCPT ); Fri, 1 Apr 2016 09:29:22 -0400 MIME-Version: 1.0 In-Reply-To: <5801670.ZsrEAbzXnC@ws-stein> References: <1458752487-32767-1-git-send-email-alexander.stein@systec-electronic.com> <5801670.ZsrEAbzXnC@ws-stein> Date: Fri, 1 Apr 2016 15:29:21 +0200 Message-ID: Subject: Re: [PATCH 1/1] gpio: mcp23s08: Add support for level triggered interrupts From: Linus Walleij To: Alexander Stein Cc: Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1172 Lines: 30 On Thu, Mar 31, 2016 at 10:58 AM, Alexander Stein wrote: > On Thursday 31 March 2016 10:41:24, Linus Walleij wrote: > From the reference manual: >> The INTCAP register captures the GPIO port value at >> the time the interrupt occurred. The register is ‘read >> only’ and is updated only when an interrupt occurs. The >> register will remain unchanged until the interrupt is >> cleared via a read of INTCAP or GPIO. > > So, i guess you're right. Although currently I don't know why > handle_simple_irq would not work if this would not be the case. The usual construction is that for edge triggered interrupts there is an ACK register where a bit goes to "1" whenever it triggers on an edge, and this must be taken down by an explicit read or even write of the ACK registers. Level triggered interrupts by contrast, are just a register reflecting the value of the interrupt line: it only remains set to "1" as long as the external source holds it high, and will go low as soon as the device causing he interrupt releases it. Therefor level triggered interrupts often do not need any explicit ACK at all. Yours, Linus Walleij