[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZfqRTrKtPRbjUuEOn6s5VEmV9PJSRx6eCr+THHCOk2uA@mail.gmail.com>
Date: Thu, 2 Jun 2016 16:36:18 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Crestez Dan Leonard <leonard.crestez@...el.com>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Daniel Baluta <daniel.baluta@...el.com>,
Giuseppe Barba <giuseppe.barba@...com>,
Denis Ciocca <denis.ciocca@...com>
Subject: Re: [PATCH 3/3] iio: st_sensors: Use level interrupts
On Sun, May 29, 2016 at 9:29 PM, Jonathan Cameron <jic23@...nel.org> wrote:
> On 24/05/16 13:35, Crestez Dan Leonard wrote:
>> This might be completely crazy, but wouldn't it be possible to support
>> gpio level interrupts purely in software? Just read the GPIO state again
>> after the interrupt is unmasked and retrigger.
>>
>> This seems preferable to implementing per-driver workarounds. Perhaps it
>> would even fit in some gpio-irqchip glue.
>
> That's precisely the question I raised way back when writing the lis3l02dq
> driver. Apparently someone once had a go but it never went anywhere...
It is maybe possible to do in some cases. What you have to do
is to augment the GPIO irqchip driver to read the line status register
after handling an IRQ, if level IRQ is desired, and if the line is still high
after a rising edge or still low after a falling edge, just call the IRQ
handler again.
This will not work with threaded interrupt handlers, because that
code is in the "hard" path of the interrupt handling code, that
gets executed in response to an IRQ signal.
What it would take is code to go back into the "hard" irq handler
after the thread has run, and take a second lap in checking the
line levels.
I don't know if that is possible to achieve in Linux, hm :/
Yours,
Linus Walleij
Powered by blists - more mailing lists